private void KeccakPermutation(byte[] state) { ulong[] stateAsWords = new ulong[state.Length / 8]; Sha3Digest.FromBytesToWords(stateAsWords, state); this.KeccakPermutationOnWords(stateAsWords); Sha3Digest.FromWordsToBytes(state, stateAsWords); }
private void KeccakPermutationOnWords(ulong[] state) { for (int i = 0; i < 24; i++) { this.Theta(state); this.Rho(state); this.Pi(state); this.Chi(state); Sha3Digest.Iota(state, i); } }
private void CopyIn(Sha3Digest 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; this.bitsAvailableForSqueezing = source.bitsAvailableForSqueezing; this.chunk = Arrays.Clone(source.chunk); this.oneByte = Arrays.Clone(source.oneByte); }
public Sha3Digest(Sha3Digest source) : base(source) { }
private void CopyIn(Sha3Digest 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; this.bitsAvailableForSqueezing = source.bitsAvailableForSqueezing; this.chunk = Arrays.Clone(source.chunk); this.oneByte = Arrays.Clone(source.oneByte); }
public Sha3Digest(Sha3Digest source) { CopyIn(source); }
public void Reset(IMemoable other) { Sha3Digest d = (Sha3Digest)other; CopyIn(d); }
public Sha3Digest(Sha3Digest source) { CopyIn(source); }
public Sha3Digest(Sha3Digest source) : base(source) { }
public void Reset(IMemoable other) { Sha3Digest source = (Sha3Digest)other; this.CopyIn(source); }
public Sha3Digest(Sha3Digest source) { this.CopyIn(source); }