decentralized-identity / bbs-signature

The BBS Signature Scheme
https://identity.foundation/bbs-signature/draft-irtf-cfrg-bbs-signatures.html
Apache License 2.0
79 stars 26 forks source link

P1 calculation in tooling code #217

Closed dev0x1 closed 2 years ago

dev0x1 commented 2 years ago

As per spec, P1 is calculated using create_generators with a specific generator_seed. create_generators procedure as described here starts calculation with n=1 but below reference reference code in tooling to calculate P1 uses n=0. https://github.com/decentralized-identity/bbs-signature/blob/3e69a8b16fd7788993e9d3a8849f311ade47fc5e/tooling/message-generators/src/main.rs#L193 I think the code should be updated as below and then the new values of P1 also need to be updated in the cipher suites constants section.

let extra = 1usize.to_be_bytes()[4..].to_vec();
BasileiosKal commented 2 years ago

Thanks for pointing this out! Addressed in #221.

tmarkovski commented 2 years ago

Actually, usize has variable length on different architectures, so using u64 is a better option.