当前位置: 首页>>代码示例>>C#>>正文


C# ECCurve类代码示例

本文整理汇总了C#中ECCurve的典型用法代码示例。如果您正苦于以下问题:C# ECCurve类的具体用法?C# ECCurve怎么用?C# ECCurve使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ECCurve类属于命名空间,在下文中一共展示了ECCurve类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GlvMultiplier

        public GlvMultiplier(ECCurve curve, GlvEndomorphism glvEndomorphism)
        {
            if (curve == null || curve.Order == null)
                throw new ArgumentException("Need curve with known group order", "curve");

            this.curve = curve;
            this.glvEndomorphism = glvEndomorphism;
        }
开发者ID:ALange,项目名称:OutlookPrivacyPlugin,代码行数:8,代码来源:GlvMultiplier.cs

示例2: ConfigureCurve

        protected virtual ECCurve ConfigureCurve(ECCurve c, int coord)
        {
            if (c.CoordinateSystem == coord)
                return c;

            if (!c.SupportsCoordinateSystem(coord))
                throw new ArgumentException("Coordinate system " + coord + " not supported by this curve", "coord");

            return c.Configure().SetCoordinateSystem(coord).Create();
        }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:10,代码来源:MixedNafR2LMultiplier.cs

示例3: IsCurveTypeEqual

        public bool IsCurveTypeEqual(ECCurve.ECCurveType actual)
        {
            if (CurveType == actual)
                return true;

            // Montgomery and Weierstrass are interchangable depending on the platform 
            if (CurveType == ECCurve.ECCurveType.PrimeMontgomery && actual == ECCurve.ECCurveType.PrimeShortWeierstrass ||
                CurveType == ECCurve.ECCurveType.PrimeShortWeierstrass && actual == ECCurve.ECCurveType.PrimeMontgomery)
            {
                return true;
            }

            return false;
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:14,代码来源:CurveDef.cs

示例4: GlvTypeBEndomorphism

 public GlvTypeBEndomorphism(ECCurve curve, GlvTypeBParameters parameters)
 {
     this.m_curve = curve;
     this.m_parameters = parameters;
     this.m_pointMap = new ScaleXPointMap(curve.FromBigInteger(parameters.Beta));
 }
开发者ID:ALange,项目名称:OutlookPrivacyPlugin,代码行数:6,代码来源:GlvTypeBEndomorphism.cs

示例5: Curve25519Point

 /**
  * Create a point which encodes with point compression.
  *
  * @param curve the curve to use
  * @param x affine x co-ordinate
  * @param y affine y co-ordinate
  *
  * @deprecated Use ECCurve.CreatePoint to construct points
  */
 public Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y)
     : this(curve, x, y, false)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:13,代码来源:Curve25519Point.cs

示例6: Create

 public ECDsa Create(ECCurve curve)
 {
     return new ECDsaOpenSsl(curve);
 }
开发者ID:ESgarbi,项目名称:corefx,代码行数:4,代码来源:EcDsaOpenSslProvider.cs

示例7: GetCombSize

 public static int GetCombSize(ECCurve c)
 {
     BigInteger order = c.Order;
     return order == null ? c.FieldSize + 1 : order.BitLength;
 }
开发者ID:JohnMalmsteen,项目名称:mobile-apps-tower-defense,代码行数:5,代码来源:FixedPointUtilities.cs

示例8: SecP256K1Point

		public SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs,
			bool withCompression)
			: base(curve, x, y, zs, withCompression)
		{
		}
开发者ID:Nethereum,项目名称:Nethereum,代码行数:5,代码来源:SecP256K1Point.cs

示例9: Create

 public static ECDsa Create(ECCurve curve)
 {
     return s_provider.Create(curve);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:ECDsaFactory.cs

示例10: SecT163R2Point

 /**
  * @deprecated Use ECCurve.createPoint to construct points
  */
 public SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y)
     : this(curve, x, y, false)
 {
 }
开发者ID:JohnMalmsteen,项目名称:mobile-apps-tower-defense,代码行数:7,代码来源:SecT163R2Point.cs

示例11: SecP192K1Point

 /**
  * Create a point that encodes with or without point compresion.
  * 
  * @param curve
  *            the curve to use
  * @param x
  *            affine x co-ordinate
  * @param y
  *            affine y co-ordinate
  * @param withCompression
  *            if true encode with point compression
  * 
  * @deprecated per-point compression property will be removed, refer
  *             {@link #getEncoded(bool)}
  */
 public SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression)
     : base(curve, x, y, withCompression)
 {
     if ((x == null) != (y == null))
         throw new ArgumentException("Exactly one of the field elements is null");
 }
开发者ID:jesusgarza,项目名称:bc-csharp,代码行数:21,代码来源:SecP192K1Point.cs

示例12: CompareCurve

        internal static void CompareCurve(ECCurve c1, ECCurve c2)
        {
            if (c1.IsNamed)
            {
                Assert.True(c2.IsNamed);
                Assert.Equal(c1.Oid.FriendlyName, c2.Oid.FriendlyName);
            }
            else if (c1.IsExplicit)
            {
                Assert.True(c2.IsExplicit);
                Assert.Equal(c1.A, c2.A);
                Assert.Equal(c1.B, c2.B);
                Assert.Equal(c1.CurveType, c2.CurveType);
                Assert.Equal(c1.G.X, c2.G.X);
                Assert.Equal(c1.G.Y, c2.G.Y);
                Assert.Equal(c1.Cofactor, c2.Cofactor);
                Assert.Equal(c1.Order, c2.Order);
                Assert.Equal(c1.Seed, c2.Seed);
                Assert.Equal(c1.Hash, c2.Hash);

                if (c1.IsPrime)
                {
                    Assert.True(c2.IsPrime);
                    Assert.Equal(c1.Prime, c2.Prime);
                }
                else if (c1.IsCharacteristic2)
                {
                    Assert.True(c2.IsCharacteristic2);
                    Assert.Equal(c1.Polynomial, c2.Polynomial);
                }
            }
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:32,代码来源:ECDsaTestsBase.cs

示例13: Create

 /// <summary>
 /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm.
 /// </summary>
 /// <param name="curve">
 /// The <see cref="ECCurve"/> representing the elliptic curve.
 /// </param>
 public static ECDsa Create(ECCurve curve)
 {
     return new ECDsaImplementation.ECDsaOpenSsl(curve);
 }
开发者ID:dotnet,项目名称:corefx,代码行数:10,代码来源:ECDsaOpenSsl.cs

示例14: Validate

        private static void Validate(
            ECParameters parameters,
            ECCurve explicitCurve,
            byte[] msg,
            byte[] signature,
            HashAlgorithmName hashAlgorithm)
        {
            byte[] tamperedSignature = (byte[])signature.Clone();
            tamperedSignature[0] ^= 0xFF;

            using (ECDsa ecdsa = ECDsaFactory.Create())
            {
                ecdsa.ImportParameters(parameters);

                Assert.True(
                    ecdsa.VerifyData(msg, signature, hashAlgorithm),
                    "named verifies signature");

                Assert.False(
                    ecdsa.VerifyData(msg, tamperedSignature, hashAlgorithm),
                    "named verifies tampered");
            }

            if (ECDsaFactory.ExplicitCurvesSupported)
            {
                using (ECDsa ecdsa = ECDsaFactory.Create())
                {
                    parameters.Curve = explicitCurve;
                    ecdsa.ImportParameters(parameters);

                    Assert.True(
                        ecdsa.VerifyData(msg, signature, hashAlgorithm),
                        "explicit verifies signature");

                    Assert.False(
                        ecdsa.VerifyData(msg, tamperedSignature, hashAlgorithm),
                        "explicit verifies tampered");
                }
            }
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:40,代码来源:ECDsaTests.NistValidation.cs

示例15: Create

 public ECDsa Create(ECCurve curve)
 {
     return new ECDsaCng(curve);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:ECDsaCngProvider.cs


注:本文中的ECCurve类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。