|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.crypto.digests.SkeinEngine
Implementation of the Skein family of parameterised hash functions 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.
This implementation is the basis for SkeinDigest
and SkeinMac
, implementing the
parameter based configuration system that allows Skein to be adapted to multiple applications.
Initialising the engine with SkeinParameters
allows standard and arbitrary parameters to
be applied during the Skein hash function.
Implemented: 256, 512 and 1024 bit internal states. Full 96 bit input length. Parameters defined in the Skein specification, and arbitrary other pre and post message parameters. Arbitrary output size in 1 byte intervals.
Not implemented: Sub-byte length input (bit padding). Tree hashing.
SkeinParameters
Inner Class Summary | |
static class |
SkeinEngine.Parameter
|
Field Summary | |
static int |
SKEIN_1024
1024 bit block size - Skein 1024 |
static int |
SKEIN_256
256 bit block size - Skein 256 |
static int |
SKEIN_512
512 bit block size - Skein 512 |
Constructor Summary | |
SkeinEngine(int blockSizeBits,
int outputSizeBits)
Constructs a Skein engine. |
|
SkeinEngine(SkeinEngine engine)
Creates a SkeinEngine as an exact copy of an existing instance. |
Method Summary | |
Memoable |
copy()
Produce a copy of this object with its configuration and in its current state. |
int |
doFinal(byte[] out,
int outOff)
|
int |
getBlockSize()
|
int |
getOutputSize()
|
void |
init(SkeinParameters params)
Initialises the Skein engine with the provided parameters. |
void |
reset()
Reset the engine to the initial state (with the key and any pre-message parameters , ready to accept message input. |
void |
reset(Memoable other)
Restore a copied object state into this object. |
void |
update(byte in)
|
void |
update(byte[] in,
int inOff,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SKEIN_256
public static final int SKEIN_512
public static final int SKEIN_1024
Constructor Detail |
public SkeinEngine(int blockSizeBits, int outputSizeBits)
blockSizeBits
- the internal state size in bits - one of SKEIN_256
, SKEIN_512
or
SKEIN_1024
.outputSizeBits
- the output/digest size to produce in bits, which must be an integral number of
bytes.public SkeinEngine(SkeinEngine engine)
Method Detail |
public Memoable copy()
Memoable
The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.
copy
in interface Memoable
public void reset(Memoable other)
Memoable
Implementations of this method should try to avoid or minimise memory allocation to perform the reset.
reset
in interface Memoable
org.bouncycastle.util.Memoable
other
- an object originally copied
from an object of the same type as this instance.java.lang.ClassCastException
- if the provided object is not of the correct type.MemoableResetException
- if the other parameter is in some other way invalid.public int getOutputSize()
public int getBlockSize()
public void init(SkeinParameters params)
SkeinParameters
for
details on the parameterisation of the Skein hash function.params
- the parameters to apply to this engine, or null to use no parameters.public void reset()
public void update(byte in)
public void update(byte[] in, int inOff, int len)
public int doFinal(byte[] out, int outOff)
|
Bouncy Castle Cryptography Library 1.79 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |