herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

Which curve is used in ecdsa_test.exe? #150

Closed XinwenXiang closed 1 year ago

XinwenXiang commented 1 year ago

Hello, I'm running make ./bin/ecdsa_test.exe & ./bin/ecdsa_test.exe, and i notice that In README.md mcl only support BN_CURVE and BLS12-381. What about others ec? like spce256k1 or NIST-P256 Best Regards

herumi commented 1 year ago

It uses secp256k1 and SHA-256. https://github.com/herumi/mcl/blob/master/test/ecdsa_test.cpp#L122

XinwenXiang commented 1 year ago

Thanks for your answer, i've read "https://github.com/herumi/mcl/blob/master/test/ecdsa_test.cpp#L122" before ask u. But in README part do not say supports secp56k1 so I want to confirm it. Now the mcl supports BN_CURVE, BLS12-381 and secp256k1, and through https://github.com/herumi/ecdsa-wasm can build wasm version of ecdsa?

herumi commented 1 year ago

Yes. mcl supports BN254, BN381, BN461, BLS12_381, BLS12_461 of pairings and secp192k1, ..., secp384r1 of elliptic operations. But there are many ways to serialize data and hash-to-curve functions, and it is very cumbersome to support all of them. So herumi/ecdsa supports only secp256k1 + SHA-256.

XinwenXiang commented 1 year ago

Thanks, your answer hepls me a lot.