plume-sig / zk-nullifier-sig

Implementation of PLUME: nullifier friendly signature scheme on ECDSA
MIT License
134 stars 22 forks source link

`sha256_preimage_bit_length` is a free signal #13

Closed 0xbok closed 10 months ago

0xbok commented 1 year ago

verify_nullifier.circom#L33

Prover is free to choose any value forsha256_preimage_bit_length to generate the sha256 hash for c. Since the length of the hash pre-image is fixed, it can be removed as an input signal. The TODO comment indicates this too:

// ...TODO: calculate internally in circom to simplify API
signal input sha256_preimage_bit_length;

Recommendation: sha256_preimage_bit_length should always be equal to message_bits (6*33*8).