x25519

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