private void CopyIn(SkeinEngine engine) { this.ubi.Reset(engine.ubi); this.chain = Arrays.Clone(engine.chain, this.chain); this.initialState = Arrays.Clone(engine.initialState, this.initialState); this.key = Arrays.Clone(engine.key, this.key); this.preMessageParameters = Clone(engine.preMessageParameters, this.preMessageParameters); this.postMessageParameters = Clone(engine.postMessageParameters, this.postMessageParameters); }
public void Reset(IMemoable other) { SkeinEngine s = (SkeinEngine)other; if ((BlockSize != s.BlockSize) || (outputSizeBytes != s.outputSizeBytes)) { throw new MemoableResetException("Incompatible parameters in provided SkeinEngine."); } CopyIn(s); }
/// <summary> /// Creates a SkeinEngine as an exact copy of an existing instance. /// </summary> public SkeinEngine(SkeinEngine engine) : this(engine.BlockSize * 8, engine.OutputSize * 8) { CopyIn(engine); }
public UBI(SkeinEngine engine, int blockSize) { this.engine = engine; currentBlock = new byte[blockSize]; message = new ulong[currentBlock.Length / 8]; }
public SkeinDigest(SkeinDigest digest) { this.engine = new SkeinEngine(digest.engine); }
/// <summary> /// Constructs a Skein digest with an internal state size and output size. /// </summary> /// <param name="stateSizeBits">the internal state size in bits - one of <see cref="SKEIN_256"/> <see cref="SKEIN_512"/> or /// <see cref="SKEIN_1024"/>.</param> /// <param name="digestSizeBits">the output/digest size to produce in bits, which must be an integral number of /// bytes.</param> public SkeinDigest(int stateSizeBits, int digestSizeBits) { this.engine = new SkeinEngine(stateSizeBits, digestSizeBits); Init(null); }