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 UBI(SkeinEngine engine, int blockSize)
 {
     this.engine = engine;
     currentBlock = new byte[blockSize];
     message = new ulong[currentBlock.Length / 8];
 }
 /// <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);
 }
Esempio n. 4
0
 public SkeinMac(SkeinMac mac)
 {
     this.engine = new SkeinEngine(mac.engine);
 }
Esempio n. 5
0
 /// <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);
 }
 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);
 }