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


C# IDigest.Reset方法代码示例

本文整理汇总了C#中IDigest.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# IDigest.Reset方法的具体用法?C# IDigest.Reset怎么用?C# IDigest.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDigest的用法示例。


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

示例1: CalculateHashForZeroKnowledgeProof

        private static BigInteger CalculateHashForZeroKnowledgeProof(BigInteger g, BigInteger gr, BigInteger gx,
            string participantId, IDigest digest)
        {
            digest.Reset();

            UpdateDigestIncludingSize(digest, g);

            UpdateDigestIncludingSize(digest, gr);

            UpdateDigestIncludingSize(digest, gx);

            UpdateDigestIncludingSize(digest, participantId);

            byte[] output = DigestUtilities.DoFinal(digest);

            return new BigInteger(output);
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:17,代码来源:JPakeUtilities.cs

示例2: CalculateMacKey

        /// <summary>
        /// Calculates the MacKey (i.e. the key to use when calculating the MagTag for key confirmation).
        /// 
        /// MacKey = H(K || "JPAKE_KC")
        /// </summary>
        private static byte[] CalculateMacKey(BigInteger keyingMaterial, IDigest digest)
        {
            digest.Reset();

            UpdateDigest(digest, keyingMaterial);
            /*
             * This constant is used to ensure that the macKey is NOT the same as the derived key.
             */
            UpdateDigest(digest, "JPAKE_KC");

            return DigestUtilities.DoFinal(digest);
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:17,代码来源:JPakeUtilities.cs

示例3: ComputeDigest

        /// <summary>
        /// Computes hash of the data
        /// </summary>
        /// <param name="digest">Hash algorithm implementation</param>
        /// <param name="data">Data that should be processed</param>
        /// <returns>Hash of data</returns>
        private static byte[] ComputeDigest(IDigest digest, byte[] data)
        {
            if (digest == null)
                throw new ArgumentNullException("digest");

            if (data == null)
                throw new ArgumentNullException("data");

            byte[] hash = new byte[digest.GetDigestSize()];

            digest.Reset();
            digest.BlockUpdate(data, 0, data.Length);
            digest.DoFinal(hash, 0);

            return hash;
        }
开发者ID:Gianluigi,项目名称:Pkcs7SignatureGenerator,代码行数:22,代码来源:Pkcs7SignatureGenerator.cs


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