plume-sig / zk-nullifier-sig

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

Encode points as in compressed SEC1 format to compute c #2

Closed weijiekoh closed 1 year ago

weijiekoh commented 1 year ago

Previously, I implemented a pt_to_64_bytes() function which encodes a secp256k1 point as 64 bytes. This was needed to generate the preimage bytestring to compute the c value - a hash of g, pk, h, nul, g^r, and z in a way that matched the arkworks implementation, which didn't yet support SEC1 encoding.

Now, I have implemented SEC1 point encoding in the arkworks implementation. As such, pt_to_64_bytes() is no longer needed and k256's built-in SEC1 encoding function to_encoded_point() is used.

Points are encoded in compressed form. As such, the length of the preimage to c is almost halved.

This PR brings this k256 implementation back to equivalence with the arkworks implementation.