Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
 public UBI(SkeinEngine engine, int blockSize)
 {
     this.engine  = engine;
     currentBlock = new byte[blockSize];
     message      = new ulong[currentBlock.Length / 8];
 }
Ejemplo n.º 5
0
 public SkeinDigest(SkeinDigest digest)
 {
     this.engine = new SkeinEngine(digest.engine);
 }
Ejemplo n.º 6
0
 /// <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);
 }