Top Description Fields Constructors Methods
org.bouncycastle.crypto.general

pack-priv final Class WhirlpoolDigest

extends Object
implements ExtendedDigest, Memoable
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.Memoable, org.bouncycastle.crypto.internal.ExtendedDigest, org.bouncycastle.crypto.internal.Digest
Imports
org.bouncycastle.crypto.internal.ExtendedDigest, org.bouncycastle.util.Arrays, .Memoable

Implementation of WhirlpoolDigest, based on Java source published by Barreto and Rijmen.

Field Summary

Modifier and TypeField and Description
private short[]
private long[]
private byte[]
private int
private long[]
private long[]
private long[]
private final long[]
private long[]
private static final int
private static final int
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final int
private static final short[]
private static final int
private static final int
private static final int[]

Constructor Summary

AccessConstructor and Description
public
public
WhirlpoolDigest(WhirlpoolDigest originalDigest)

Copy constructor.

Method Summary

Modifier and TypeMethod and Description
private long
bytesToLongFromBuffer(byte[] buffer, int startPos)

private void
convertLongToByteArray(long inputLong, byte[] outputArray, int offSet)

public Memoable
copy()

Implements org.bouncycastle.util.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.
private byte[]
public int
doFinal(byte[]
the array the digest is to be copied into.
out
,
int
the offset into the out array the digest is to start at.
outOff
)

Implements org.bouncycastle.crypto.internal.Digest.doFinal.

close the digest, producing the final digest value.
private void
public String
public int
getByteLength()

Implements org.bouncycastle.crypto.internal.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.
public int
getDigestSize()

Implements org.bouncycastle.crypto.internal.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.
private void
private int
private long
packIntoLong(int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0)

protected void
private void
processFilledBuffer(byte[] in, int inOff)

public void
reset()

Implements org.bouncycastle.crypto.internal.Digest.reset.

reset the chaining variables
public void
reset(Memoable
an object originally copied from an object of the same type as this instance.
other
)

Implements org.bouncycastle.util.Memoable.reset.

Restore a copied object state into this object.
public void
update(byte
the input byte to be entered.
in
)

Implements org.bouncycastle.crypto.internal.Digest.update.

update the message digest with a single byte.
public void
update(byte[]
the byte array containing the data.
in
,
int
the offset into the byte array where the data starts.
inOff
,
int
the length of the data.
len
)

Implements org.bouncycastle.crypto.internal.Digest.update.

update the message digest with a block of bytes.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_bitCountback to summary
private short[] _bitCount
_blockback to summary
private long[] _block
_bufferback to summary
private byte[] _buffer
_bufferPosback to summary
private int _bufferPos
_hashback to summary
private long[] _hash
_Kback to summary
private long[] _K
_Lback to summary
private long[] _L
_rcback to summary
private final long[] _rc
_stateback to summary
private long[] _state
BITCOUNT_ARRAY_SIZEback to summary
private static final int BITCOUNT_ARRAY_SIZE
BYTE_LENGTHback to summary
private static final int BYTE_LENGTH
C0back to summary
private static final long[] C0
C1back to summary
private static final long[] C1
C2back to summary
private static final long[] C2
C3back to summary
private static final long[] C3
C4back to summary
private static final long[] C4
C5back to summary
private static final long[] C5
C6back to summary
private static final long[] C6
C7back to summary
private static final long[] C7
DIGEST_LENGTH_BYTESback to summary
private static final int DIGEST_LENGTH_BYTES
EIGHTback to summary
private static final short[] EIGHT
REDUCTION_POLYNOMIALback to summary
private static final int REDUCTION_POLYNOMIAL
ROUNDSback to summary
private static final int ROUNDS
SBOXback to summary
private static final int[] SBOX

Constructor Detail

WhirlpoolDigestback to summary
public WhirlpoolDigest()
WhirlpoolDigestback to summary
public WhirlpoolDigest(WhirlpoolDigest originalDigest)

Copy constructor. This will copy the state of the provided message digest.

Method Detail

bytesToLongFromBufferback to summary
private long bytesToLongFromBuffer(byte[] buffer, int startPos)
convertLongToByteArrayback to summary
private void convertLongToByteArray(long inputLong, byte[] outputArray, int offSet)
copyback to summary
public Memoable copy()

Implements org.bouncycastle.util.Memoable.copy.

Doc from org.bouncycastle.util.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.

The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.

copyBitLengthback to summary
private byte[] copyBitLength()
doFinalback to summary
public int doFinal(byte[] out, int outOff)

Implements org.bouncycastle.crypto.internal.Digest.doFinal.

Doc from org.bouncycastle.crypto.internal.Digest.doFinal.

close the digest, producing the final digest value. The doFinal call leaves the digest reset.

Parameters
out:byte[]

the array the digest is to be copied into.

outOff:int

the offset into the out array the digest is to start at.

finishback to summary
private void finish()
getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.internal.Digest.getAlgorithmName.

Doc from org.bouncycastle.crypto.internal.Digest.getAlgorithmName.

return the algorithm name

Returns:String

the algorithm name

getByteLengthback to summary
public int getByteLength()

Implements org.bouncycastle.crypto.internal.ExtendedDigest.getByteLength.

Doc from org.bouncycastle.crypto.internal.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.

Returns:int

byte length of the digests internal buffer.

getDigestSizeback to summary
public int getDigestSize()

Implements org.bouncycastle.crypto.internal.Digest.getDigestSize.

Doc from org.bouncycastle.crypto.internal.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.

Returns:int

the size, in bytes, of the digest produced by this message digest.

incrementback to summary
private void increment()
maskWithReductionPolynomialback to summary
private int maskWithReductionPolynomial(int input)
packIntoLongback to summary
private long packIntoLong(int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0)
processBlockback to summary
protected void processBlock()
processFilledBufferback to summary
private void processFilledBuffer(byte[] in, int inOff)
resetback to summary
public void reset()

Implements org.bouncycastle.crypto.internal.Digest.reset.

reset the chaining variables

resetback to summary
public void reset(Memoable other)

Implements org.bouncycastle.util.Memoable.reset.

Doc from org.bouncycastle.util.Memoable.reset.

Restore a copied object state into this object.

Implementations of this method should try to avoid or minimise memory allocation to perform the reset.

Parameters
other:Memoable

an object originally copied from an object of the same type as this instance.

updateback to summary
public void update(byte in)

Implements org.bouncycastle.crypto.internal.Digest.update.

Doc from org.bouncycastle.crypto.internal.Digest.update.

update the message digest with a single byte.

Parameters
in:byte

the input byte to be entered.

updateback to summary
public void update(byte[] in, int inOff, int len)

Implements org.bouncycastle.crypto.internal.Digest.update.

Doc from org.bouncycastle.crypto.internal.Digest.update.

update the message digest with a block of bytes.

Parameters
in:byte[]

the byte array containing the data.

inOff:int

the offset into the byte array where the data starts.

len:int

the length of the data.