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.
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 thec
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 functionto_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.