public static bool PerformEccPublicKeyValidation(IEccCurve curve, EccPoint publicKey, bool shouldThrow = false) { if (!curve.PointExistsOnCurve(publicKey)) { if (shouldThrow) { throw new Exception("public key does not exist on curve"); } return(false); } var n = curve.OrderN; var nQ = curve.Multiply(publicKey, n); if (!nQ.Infinity) { if (shouldThrow) { throw new Exception("public key validation error"); } return(false); } return(true); }
public EccDomainParameters(IEccCurve e, SecretGenerationMode secretMode) { CurveE = e; SecretGeneration = secretMode; }
public EccDomainParameters(IEccCurve e) { CurveE = e; }