Skip to content

fix: implement BLAKE-512 as declared by the ciphersuite label - #12

Open
rdubois-crypto wants to merge 1 commit into
Railgun-Community:mainfrom
ZKNoxHQ:fix/blake512-ciphersuite
Open

fix: implement BLAKE-512 as declared by the ciphersuite label#12
rdubois-crypto wants to merge 1 commit into
Railgun-Community:mainfrom
ZKNoxHQ:fix/blake512-ciphersuite

Conversation

@rdubois-crypto

Copy link
Copy Markdown
Collaborator

The ciphersuite is named FROST-EDBABYJUJUB-BLAKE512-v1, but the default hash function in RFC9591Hasher was blake2b with a 64-byte digest, which is a different algorithm from BLAKE-512 (the BLAKE-1 / SHA-3 finalist). The domain-separation label therefore did not describe the hash actually in use.

BLAKE-512 is also the hash the wider RAILGUN / circomlib EdDSA-on- BabyJubJub stack is built around (key pruning and nonce derivation), which is what hardware implementations validate their vectors against.

Switch the default hasher to blake512 from @noble/hashes/blake1 and regenerate the H1/H3/H4/H5 test vectors for the existing fixed input. No dependency change: blake1 ships in the @noble/hashes version already pinned. Custom hashers injected via the constructor are unaffected.

Fix #10

The ciphersuite is named FROST-EDBABYJUJUB-BLAKE512-v1, but the default
hash function in RFC9591Hasher was blake2b with a 64-byte digest, which
is a different algorithm from BLAKE-512 (the BLAKE-1 / SHA-3 finalist).
The domain-separation label therefore did not describe the hash actually
in use.

BLAKE-512 is also the hash the wider RAILGUN / circomlib EdDSA-on-
BabyJubJub stack is built around (key pruning and nonce derivation),
which is what hardware implementations validate their vectors against.

Switch the default hasher to blake512 from @noble/hashes/blake1 and
regenerate the H1/H3/H4/H5 test vectors for the existing fixed input.
No dependency change: blake1 ships in the @noble/hashes version already
pinned. Custom hashers injected via the constructor are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frost use blake2b instead of blake512

1 participant