예제 #1
0
 private void CopyIn(KeccakDigest source)
 {
     Array.Copy(source.state, 0, this.state, 0, source.state.Length);
     Array.Copy(source.dataQueue, 0, this.dataQueue, 0, source.dataQueue.Length);
     this.rate              = source.rate;
     this.bitsInQueue       = source.bitsInQueue;
     this.fixedOutputLength = source.fixedOutputLength;
     this.squeezing         = source.squeezing;
 }
예제 #2
0
        public static byte[] CalculateHash(byte[] value)
        {
            var digest = new KeccakDigest(256);
            var output = new byte[digest.GetDigestSize()];

            digest.BlockUpdate(value, 0, value.Length);
            digest.DoFinal(output, 0);
            return(output);
        }
예제 #3
0
 public KeccakDigest(KeccakDigest source)
 {
     CopyIn(source);
 }