/// <summary> /// Creates a new <see cref="EllipticCurveAlgebra" /> instance /// for the curve identified by <paramref name="curveId"/>. /// </summary> /// <param name="curveId">Identifier of the elliptic curve.</param> public EllipticCurveAlgebra(EllipticCurveID curveId) { Handle = ECGroupHandle.CreateByCurveNID((int)curveId); using (var ctx = BigNumberContextHandle.Create()) { ECGroupHandle.PrecomputeGeneratorMultiples(Handle, ctx); } }
/// <summary> /// Creates a <see cref="CryptoGroup{SecureBigNumber, ECPoint}" /> instance using a <see cref="EllipticCurveAlgebra" /> /// for the given curve identifier. /// </summary> /// <param name="curveId">Identifier of the elliptic curve.</param> public static CryptoGroup <SecureBigNumber, ECPoint> CreateCryptoGroup(EllipticCurveID curveId) { return(new CryptoGroup <SecureBigNumber, ECPoint>(new EllipticCurveAlgebra(curveId))); }