curve-25519

CryptoPP::ed25519::Verifier shows different result from libsignal

杀马特。学长 韩版系。学妹 提交于 2021-01-28 11:32:15
问题 I'm trying to implement curve25519 verification with CryptoPP. I tried the libsignal library first, witch shows correct result. Then I tried the same data with CryptoPP, but shows wrong result. Here is the code using libsignal to verify a signature: string pub = str2hex("0504f05568cc7a16fa9b4bc1c9d9294a80b7727e349365f855031a180bf0f80910"); ec_public_key* pub_key; curve_decode_point(&pub_key, (uint8_t*)pub.data(), pub.size(), 0); string message = str2hex(

Why does Curve25519 calculate key pair correctly even though its parameters are wrong?

半腔热情 提交于 2021-01-28 06:16:00
问题 It seems that .NET (Core 3.1) supports custom curves in ECC. So I've defined the Curve25519, and generated key pair by below code: using System; using System.Security.Cryptography; namespace Curve25519 { class Program { static void Main(string[] args) { ECCurve ecCurve = new ECCurve() // Curve25519, 32 bytes, 256 bit { CurveType = ECCurve.ECCurveType.PrimeMontgomery, B = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, A = new byte