• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ECCurve类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Create

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


示例17: ECDsaOpenSsl

		public ECDsaOpenSsl (ECCurve curve)
		{
			throw new NotImplementedException ();
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:4,代码来源:ECDsaOpenSsl.cs


示例18: ECDsa

 public ECDsa(ECPoint publicKey)
 {
     this.publicKey = publicKey;
     this.curve = publicKey.Curve;
 }
开发者ID:erikzhang,项目名称:IceWallet,代码行数:5,代码来源:ECDsa.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ECFieldElement类代码示例发布时间:2022-05-24
下一篇:
C# EC2UnmarshallerContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap