public class Skein extends Object implements org.bouncycastle.crypto.ExtendedDigest
| Modifier and Type | Field and Description |
|---|---|
static int |
CHAINED_CONFIG |
static int |
CHAINED_STATE |
static int |
NORMAL |
org.jitsi.bccontrib.digests.Skein.UbiTweak |
ubiParameters |
static int |
ZEROED_STATE |
| Constructor and Description |
|---|
Skein(int stateSize,
int outputSize)
Initializes the Skein hash instance.
|
Skein(int stateSize,
int outputSize,
long treeInfo,
byte[] key)
Initializes the Skein hash instance for use with a key (Skein MAC)
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
doFinal() |
int |
doFinal(byte[] out,
int outOff) |
String |
getAlgorithmName() |
int |
getByteLength() |
int |
getcipherStateBits()
The state size of this Skein instance.
|
int |
getDigestSize() |
int |
getHashSize()
The output hash size in bits of this Skein instance
|
long[] |
getState()
Get the current internal state of this Skein instance.
|
int |
getStateSize() |
void |
initialize(long[] externalState)
Initialize with state variables provided by application.
|
void |
reset() |
void |
update(byte in) |
void |
update(byte[] array,
int start,
int length) |
void |
updateBits(byte[] array,
int start,
int length)
Update the hash with a message bit string.
|
public static final int NORMAL
public static final int ZEROED_STATE
public static final int CHAINED_STATE
public static final int CHAINED_CONFIG
public org.jitsi.bccontrib.digests.Skein.UbiTweak ubiParameters
public Skein(int stateSize,
int outputSize)
throws IllegalArgumentException
stateSize - The internal state size of the hash in bits. Supported values
are 256, 512, and 1024outputSize - The output size of the hash in bits. Output size must greater
than zero.IllegalArgumentExceptionpublic Skein(int stateSize,
int outputSize,
long treeInfo,
byte[] key)
throws IllegalArgumentException
stateSize - The internal state size of the hash in bits. Supported values
are 256, 512, and 1024outputSize - The output size of the hash in bits. Output size must greater
than zero.treeInfo - Not yet supported.key - The key for a message authenication code (MAC)IllegalArgumentExceptionpublic int getStateSize()
public void updateBits(byte[] array,
int start,
int length)
throws IllegalStateException
array - The byte array that holds the bit string. The array must be big
enough to hold all bits.start - Offset into byte array where the data starts, must be a byte number
(not a bit number).length - Number of bits to hash.IllegalStateExceptionpublic void update(byte[] array,
int start,
int length)
update in interface org.bouncycastle.crypto.Digestpublic byte[] doFinal()
public final void initialize(long[] externalState)
update. The
Skein MAC implementation uses this function to restore the state for
a given state size, key, and output size combination.externalState - The state to use.public int getcipherStateBits()
public int getHashSize()
public String getAlgorithmName()
getAlgorithmName in interface org.bouncycastle.crypto.Digestpublic int getDigestSize()
getDigestSize in interface org.bouncycastle.crypto.Digestpublic void update(byte in)
update in interface org.bouncycastle.crypto.Digestpublic int doFinal(byte[] out,
int outOff)
doFinal in interface org.bouncycastle.crypto.Digestpublic void reset()
reset in interface org.bouncycastle.crypto.Digestpublic int getByteLength()
getByteLength in interface org.bouncycastle.crypto.ExtendedDigestpublic long[] getState()
initialize(long[] externalState)Copyright © 2015. All rights reserved.