private void CopyIn(SkeinEngine engine) { this.ubi.Reset(engine.ubi); this.chain = engine.chain.DeepCopy(); this.initialState = engine.initialState.DeepCopy(); this.key = engine.key.DeepCopy(); 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); }
public SkeinMac(SkeinMac mac) { this.engine = new SkeinEngine(mac.engine); }
/// <summary> /// Constructs a Skein MAC 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/MAC size to produce in bits, which must be an integral number of /// bytes.</param> public SkeinMac(int stateSizeBits, int digestSizeBits) { this.engine = new SkeinEngine(stateSizeBits, digestSizeBits); }
/// <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); }