mimblewimble / rust-secp256k1-zkp

ZKP fork for rust-secp256k1, adds wrappers for range proofs, pedersen commitments, etc
Creative Commons Zero v1.0 Universal
56 stars 51 forks source link

Pass null pointer if extra_data is empty #39

Closed yoss22 closed 5 years ago

yoss22 commented 5 years ago

Currently if extra_data is empty we pass an empty vec with length 0 to secp256k1. This causes an additional unnecessary sha256 call in both the prover and the verifier. This commit changes the calls to pass a null pointer to secp256k1 which avoids this extra hashing.

NOTE: This is consensus breaking.

yoss22 commented 5 years ago

Let me know if you think this is a good change or not. This is my first experience with rust, so please say if it can be improved.

yeastplume commented 5 years ago

Thanks, we're not actually using extra_data in grin anywhere, but there's no harm including this anyhow (we're branching shortly for permanent testnet)