Org.BouncyCastle.Crypto.Digests.Sha512Digest.Reset C# (CSharp) Method

Reset() public method

public Reset ( ) : void
return void
        public override void Reset()
        {
            base.Reset();

            /* SHA-512 initial hash value
             * The first 64 bits of the fractional parts of the square roots
             * of the first eight prime numbers
             */
            H1 = 0x6a09e667f3bcc908;
            H2 = 0xbb67ae8584caa73b;
            H3 = 0x3c6ef372fe94f82b;
            H4 = 0xa54ff53a5f1d36f1;
            H5 = 0x510e527fade682d1;
            H6 = 0x9b05688c2b3e6c1f;
            H7 = 0x1f83d9abfb41bd6b;
            H8 = 0x5be0cd19137e2179;
        }
    }

Usage Example

コード例 #1
0
 /// <summary>
 /// Computes the hash of all of the supplied parameters.
 /// </summary>
 /// <param name="words"></param>
 /// <returns></returns>
 private static byte[] ComputeHash(params byte[][] words)
 {
     Sha512Digest hash = new Sha512Digest();
     hash.Reset();
     foreach (var w in words)
     {
         hash.BlockUpdate(w, 0, w.Length);
     }
     byte[] rv = new byte[hash.GetDigestSize()];
     hash.DoFinal(rv, 0);
     return rv;
 }