Skip to content

Commit

Permalink
Use big-endian in all of the nameaccumulator spec. (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus23 authored Apr 11, 2024
1 parent 3c4b79a commit 5229f36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/nameaccumulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Proofs and witnesses of relationships between name accumulators come in various
| Proof component | Representation |
|----------------------------------------|----------------|
| Element in the quadratic residue group | 256 byte big-endian byte array |
| Prime hash $l$ | 16 byte little-endian byte array and [unsigned varint] counter |
| Residue $r$ | 16 byte little-endian byte array |
| Prime hash $l$ | 16 byte big-endian byte array and [unsigned varint] counter |
| Residue $r$ | 16 byte big-endian byte array |

Collecting these proof components into their own structures is up to implementations. Future versions of this specification may describe an encoding.

Expand Down Expand Up @@ -92,7 +92,7 @@ This algorithm updates an accumulator state by adding an arbitrary number of pri
The algorithm for this proof is the "proof of knowledge of exponent" (PoKE*) from [this paper][IOP Batching Boneh], made non-interactive via the Fiat-Shamir heuristic.

The number $l$ from the protocol is derived via SHA-3-hashing the big-endian bytes of the modulus, base, commitment and a counter. The base is the accumulator state before the elements were added and the commitment is the state after.
The counter is the lowest 32-bit number that makes the first 128-bit truncated hash prime, if interpreted as a little-endian unsigned 128-bit integer.
The counter is the lowest 32-bit number that makes the first 128-bit truncated hash prime, if interpreted as a big-endian unsigned 128-bit integer.

```ts
function deriveLHash(
Expand Down

0 comments on commit 5229f36

Please sign in to comment.