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

C# Math.BigInteger类代码示例

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

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



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

示例1: RsaBlindingParameters

        public RsaBlindingParameters(
            RsaKeyParameters	publicKey,
            BigInteger			blindingFactor)
        {
            if (publicKey.IsPrivate)
                throw new ArgumentException("RSA parameters should be for a public key");

            this.publicKey = publicKey;
            this.blindingFactor = blindingFactor;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:10,代码来源:RSABlindingParameters.cs


示例2: DHParameters

 public DHParameters(
     BigInteger	p,
     BigInteger	g,
     BigInteger	q)
     : this(p, g, q, 0)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:DHParameters.cs


示例3: DsaParameters

 public DsaParameters(
     BigInteger	p,
     BigInteger	q,
     BigInteger	g)
     : this(p, q, g, null)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:DsaParameters.cs


示例4: ECDomainParameters

 public ECDomainParameters(
     ECCurve     curve,
     ECPoint     g,
     BigInteger  n)
     : this(curve, g, n, BigInteger.One)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:ECDomainParameters.cs


示例5: IssuerAndSerialNumber

 public IssuerAndSerialNumber(
     X509Name	name,
     BigInteger	certSerialNumber)
 {
     this.name = name;
     this.certSerialNumber = new DerInteger(certSerialNumber);
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:IssuerAndSerialNumber.cs


示例6: X9ECParameters

 public X9ECParameters(
     ECCurve		curve,
     ECPoint		g,
     BigInteger	n)
     : this(curve, g, n, BigInteger.One, null)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:X9ECParameters.cs


示例7: RsaPrivateCrtKeyParameters

        public RsaPrivateCrtKeyParameters(
            BigInteger	modulus,
            BigInteger	publicExponent,
            BigInteger	privateExponent,
            BigInteger	p,
            BigInteger	q,
            BigInteger	dP,
            BigInteger	dQ,
            BigInteger	qInv)
            : base(true, modulus, privateExponent)
        {
            ValidateValue(publicExponent, "publicExponent", "exponent");
            ValidateValue(p, "p", "P value");
            ValidateValue(q, "q", "Q value");
            ValidateValue(dP, "dP", "DP value");
            ValidateValue(dQ, "dQ", "DQ value");
            ValidateValue(qInv, "qInv", "InverseQ value");

            this.e = publicExponent;
            this.p = p;
            this.q = q;
            this.dP = dP;
            this.dQ = dQ;
            this.qInv = qInv;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:25,代码来源:RsaPrivateCrtKeyParameters.cs


示例8: NaccacheSternKeyParameters

 /**
  * @param privateKey
  */
 public NaccacheSternKeyParameters(bool privateKey, BigInteger g, BigInteger n, int lowerSigmaBound)
     : base(privateKey)
 {
     this.g = g;
     this.n = n;
     this.lowerSigmaBound = lowerSigmaBound;
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:10,代码来源:NaccacheSternKeyParameters.cs


示例9: ElGamalParameter

 public ElGamalParameter(
     BigInteger	p,
     BigInteger	g)
 {
     this.p = new DerInteger(p);
     this.g = new DerInteger(g);
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:ElGamalParameter.cs


示例10: CreateRandomInRange

        /**
        * Return a random BigInteger not less than 'min' and not greater than 'max'
        *
        * @param min the least value that may be generated
        * @param max the greatest value that may be generated
        * @param random the source of randomness
        * @return a random BigInteger value in the range [min,max]
        */
        public static BigInteger CreateRandomInRange(
            BigInteger		min,
            BigInteger		max,
            // TODO Should have been just Random class
            SecureRandom	random)
        {
            int cmp = min.CompareTo(max);
            if (cmp >= 0)
            {
                if (cmp > 0)
                    throw new ArgumentException("'min' may not be greater than 'max'");

                return min;
            }

            if (min.BitLength > max.BitLength / 2)
            {
                return CreateRandomInRange(BigInteger.Zero, max.Subtract(min), random).Add(min);
            }

            for (int i = 0; i < MaxIterations; ++i)
            {
                BigInteger x = new BigInteger(max.BitLength, random);
                if (x.CompareTo(min) >= 0 && x.CompareTo(max) <= 0)
                {
                    return x;
                }
            }

            // fall back to a faster (restricted) method
            return new BigInteger(max.Subtract(min).BitLength - 1, random).Add(min);
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:40,代码来源:BigIntegers.cs


示例11: DHPrivateKeyParameters

 public DHPrivateKeyParameters(
     BigInteger		x,
     DHParameters	parameters)
     : base(true, parameters)
 {
     this.x = x;
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:DHPrivateKeyParameters.cs


示例12: Gost3410Parameters

 public Gost3410Parameters(
     BigInteger	p,
     BigInteger	q,
     BigInteger	a)
     : this(p, q, a, null)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:GOST3410Parameters.cs


示例13: DerInteger

        public DerInteger(
            BigInteger value)
        {
            if (value == null)
                throw new ArgumentNullException("value");

            bytes = value.ToByteArray();
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:8,代码来源:DerInteger.cs


示例14: MacData

 public MacData(
     DigestInfo	digInfo,
     byte[]		salt,
     int			iterationCount)
 {
     this.digInfo = digInfo;
     this.salt = (byte[]) salt.Clone();
     this.iterationCount = BigInteger.ValueOf(iterationCount);
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:9,代码来源:MacData.cs


示例15: DsaParameter

 public DsaParameter(
     BigInteger	p,
     BigInteger	q,
     BigInteger	g)
 {
     this.p = new DerInteger(p);
     this.q = new DerInteger(q);
     this.g = new DerInteger(g);
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:9,代码来源:DSAParameter.cs


示例16: RsaKeyGenerationParameters

 public RsaKeyGenerationParameters(
     BigInteger		publicExponent,
     SecureRandom	random,
     int				strength,
     int				certainty)
     : base(random, strength)
 {
     this.publicExponent = publicExponent;
     this.certainty = certainty;
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:10,代码来源:RsaKeyGenerationParameters.cs


示例17: CalculateMessage

        /**
         * calculate our initial message.
         */
        public BigInteger CalculateMessage()
        {
            DHKeyPairGenerator dhGen = new DHKeyPairGenerator();
            dhGen.Init(new DHKeyGenerationParameters(random, dhParams));
            AsymmetricCipherKeyPair dhPair = dhGen.GenerateKeyPair();

            this.privateValue = ((DHPrivateKeyParameters)dhPair.Private).X;

            return ((DHPublicKeyParameters)dhPair.Public).Y;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:13,代码来源:DHAgreement.cs


示例18: Gost3410PublicKeyParameters

        public Gost3410PublicKeyParameters(
            BigInteger			y,
            DerObjectIdentifier publicKeyParamSet)
            : base(false, publicKeyParamSet)
        {
            if (y.SignValue < 1 || y.CompareTo(Parameters.P) >= 0)
                throw new ArgumentException("Invalid y for GOST3410 public key", "y");

            this.y = y;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:10,代码来源:GOST3410PublicKeyParameters.cs


示例19: ECPrivateKeyParameters

        public ECPrivateKeyParameters(
            BigInteger			d,
            DerObjectIdentifier publicKeyParamSet)
            : base("ECGOST3410", true, publicKeyParamSet)
        {
            if (d == null)
                throw new ArgumentNullException("d");

            this.d = d;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:10,代码来源:ECPrivateKeyParameters.cs


示例20: ElGamalPublicKeyParameters

        public ElGamalPublicKeyParameters(
            BigInteger			y,
            ElGamalParameters	parameters)
            : base(false, parameters)
        {
            if (y == null)
                throw new ArgumentNullException("y");

            this.y = y;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:10,代码来源:ElGamalPublicKeyParameters.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# BizwareGL.BitmapBuffer类代码示例发布时间:2022-05-24
下一篇:
C# BitSits_Framework.PlayerIndexEventArgs类代码示例发布时间: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