Closed levyfan closed 1 year ago
secp256k1 is a 256-bit curve, requiring 32 bytes for x and one byte for a signed bit of y. bn.h is mainly developed for BN254 and BLS12-381, so I don't consider other curves. I'll fix the return size later.
Hi @herumi , how is it going on?
Could you use the magic number 33 until mclBn_getG1ByteSize() returns 33 for secp256k1?
Could you use the magic number 33 until mclBn_getG1ByteSize() returns 33 for secp256k1?
I also use go api, there would be some error when mclBn_getG1ByteSize()=32 such as here https://github.com/herumi/mcl/blob/611d1cc7eedd890ed1fc023aef18b58c238ae444/ffi/go/mcl/mcl.go#L743-L751
I've fixed getG1ByteSize(). https://github.com/herumi/mcl/commit/fe28741fdba01893303efa1908bd043a7ff197f6 mcl.go does not support G1only, but I modified it.
@herumi another question, does MCL_MAP_TO_MODE_HASH_TO_CURVE_07
support NIST P256 here https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-16.html#name-nist-p-256 and https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-16.html#name-suites-for-nist-p-256
The current mcl does not support it.
Hi, I get
mclBn_getG1ByteSize=32
for secp256k1 curve, but the actual serialized length is 33. Serialize 32 bytes will fail with return size=0.The code will output:
What is the expected byte size of G1 for secp256k1?