Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.crypto.digests;
  
Implementation of the Skein parameterised hash function in 256, 512 and 1024 bit block sizes, based on the Threefish tweakable block cipher.

This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 competition in October 2010.

Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker.

 
 public class SkeinDigest
     implements ExtendedDigestMemoable
 {
    
256 bit block size - Skein-256
 
     public static final int SKEIN_256 = .;
    
512 bit block size - Skein-512
 
     public static final int SKEIN_512 = .;
    
1024 bit block size - Skein-1024
 
     public static final int SKEIN_1024 = .;
 
     private SkeinEngine engine;

    
Constructs a Skein digest with an internal state size and output size.

Parameters:
stateSizeBits the internal state size in bits - one of SKEIN_256, SKEIN_512 or SKEIN_1024.
digestSizeBits the output/digest size to produce in bits, which must be an integral number of bytes.
 
     public SkeinDigest(int stateSizeBitsint digestSizeBits)
     {
         this. = new SkeinEngine(stateSizeBitsdigestSizeBits);
         init(null);
     }
 
     public SkeinDigest(SkeinDigest digest)
     {
         this. = new SkeinEngine(digest.engine);
     }
 
     public void reset(Memoable other)
     {
         SkeinDigest d = (SkeinDigest)other;
         .reset(d.engine);
     }
 
     public Memoable copy()
     {
         return new SkeinDigest(this);
     }
 
     public String getAlgorithmName()
     {
         return "Skein-" + (.getBlockSize() * 8) + "-" + (.getOutputSize() * 8);
     }
 
     public int getDigestSize()
     {
         return .getOutputSize();
     }
 
     public int getByteLength()
     {
         return .getBlockSize();
     }

    
Optionally initialises the Skein digest with the provided parameters.
See org.bouncycastle.crypto.params.SkeinParameters for details on the parameterisation of the Skein hash function.

Parameters:
params the parameters to apply to this engine, or null to use no parameters.
 
     public void init(SkeinParameters params)
     {
         .init(params);
     }
 
     public void reset()
     {
         .reset();
     }
 
    public void update(byte in)
    {
        .update(in);
    }
    public void update(byte[] inint inOffint len)
    {
        .update(ininOfflen);
    }
    public int doFinal(byte[] outint outOff)
    {
        return .doFinal(outoutOff);
    }
New to GrepCode? Check out our FAQ X