Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.digests

public final Class Kangaroo

extends Object
Class Inheritance
Imports
org.bouncycastle.crypto.*, org.bouncycastle.util.Arrays, .Bytes, .Pack

Kangaroo.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv abstract static class
Kangaroo.KangarooBase

The Kangaroo Base.

public static class
Kangaroo.KangarooParameters

Kangaroo Parameters.

private static class
Kangaroo.KangarooSponge

The Kangaroo Sponge.

public static class
Kangaroo.KangarooTwelve

KangarooTwelve.

public static class
Kangaroo.MarsupilamiFourteen

MarsupilamiFourteen.

Field Summary

Modifier and TypeField and Description
private static final int
DIGESTLEN

Default digest length.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DIGESTLENback to summary
private static final int DIGESTLEN

Default digest length.

Constructor Detail

Kangarooback to summary
public Kangaroo()
org.bouncycastle.crypto.digests back to summary

pack-priv abstract Class Kangaroo.KangarooBase

extends Object
implements ExtendedDigest, Xof
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.Xof, org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.Digest
Known Direct Subclasses
org.bouncycastle.crypto.digests.Kangaroo.KangarooTwelve, org.bouncycastle.crypto.digests.Kangaroo.MarsupilamiFourteen

The Kangaroo Base.

Field Summary

Modifier and TypeField and Description
private static final int
BLKSIZE

Block Size.

private static final byte[]
FINAL

Final marker.

private static final byte[]
FIRST

First marker.

private static final byte[]
INTERMEDIATE

Intermediate marker.

private final CryptoServicePurpose
private static final byte[]
SINGLE

Single marker.

private final byte[]
singleByte

The single byte buffer.

private boolean
squeezing

Are we squeezing?.

private final int
theChainLen

The chain length.

private int
theCurrNode

The current node.

private final Kangaroo.KangarooSponge
theLeaf

The Leaf Sponge.

private byte[]
thePersonal

The personalisation.

private int
theProcessed

The data processed in the current node.

private final Kangaroo.KangarooSponge
theTree

The Tree Sponge.

Constructor Summary

AccessConstructor and Description
pack-priv
KangarooBase(final int
the strength
pStrength
,
final int
the rounds.
pRounds
,
final int
the digest length
pLength
,
CryptoServicePurpose purpose)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private void
buildPersonal(final byte[]
the personalisation
pPersonal
)

Constructor.

public int
doFinal(final byte[]
the array the digest is to be copied into.
pOut
,
final int
the offset into the out array the digest is to start at.
pOutOffset
)

Implements org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value.
public int
doFinal(final byte[]
output array to write the output bytes to.
pOut
,
final int
offset to start writing the bytes at.
pOutOffset
,
final int
the number of output bytes requested.
pOutLen
)

Implements org.bouncycastle.crypto.Xof.doFinal.

Output the results of the final calculation for this digest to outLen number of bytes.
public int
doOutput(final byte[]
output array to write the output bytes to.
pOut
,
final int
offset to start writing the bytes at.
pOutOffset
,
final int
the number of output bytes requested.
pOutLen
)

Implements org.bouncycastle.crypto.Xof.doOutput.

Start outputting the results of the final calculation for this digest.
public int
getByteLength()

Implements org.bouncycastle.crypto.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.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.
public void
init(final Kangaroo.KangarooParameters
the parameters
pParams
)

Initialise the digest.

private static byte[]

Returns:

the encoded length
lengthEncode
(final long
the length to encode
strLen
)

right Encode a length.

private void
processData(final byte[]
the input buffer
pIn
,
final int
the starting offset in the input buffer
pInOffSet
,
final int
the length of data to process
pLen
)

Process data.

public void
reset()

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.
private void
switchFinal()

Switch multiple node to squeezing.

private void
switchLeaf(final boolean
is there more data to come? true/false
pMoreToCome
)

Complete Leaf.

private void
switchSingle()

Switch single node to squeezing.

private void
switchToSqueezing()

Switch to squeezing.

public void
update(final byte
the input byte to be entered.
pIn
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.
public void
update(final byte[]
the byte array containing the data.
pIn
,
final int
the offset into the byte array where the data starts.
pInOff
,
final int
the length of the data.
pLen
)

Implements org.bouncycastle.crypto.Digest.update.

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

Field Detail

BLKSIZEback to summary
private static final int BLKSIZE

Block Size.

FINALback to summary
private static final byte[] FINAL

Final marker.

FIRSTback to summary
private static final byte[] FIRST

First marker.

INTERMEDIATEback to summary
private static final byte[] INTERMEDIATE

Intermediate marker.

purposeback to summary
private final CryptoServicePurpose purpose
SINGLEback to summary
private static final byte[] SINGLE

Single marker.

singleByteback to summary
private final byte[] singleByte

The single byte buffer.

squeezingback to summary
private boolean squeezing

Are we squeezing?.

theChainLenback to summary
private final int theChainLen

The chain length.

theCurrNodeback to summary
private int theCurrNode

The current node.

theLeafback to summary
private final Kangaroo.KangarooSponge theLeaf

The Leaf Sponge.

thePersonalback to summary
private byte[] thePersonal

The personalisation.

theProcessedback to summary
private int theProcessed

The data processed in the current node.

theTreeback to summary
private final Kangaroo.KangarooSponge theTree

The Tree Sponge.

Constructor Detail

KangarooBaseback to summary
pack-priv KangarooBase(final int pStrength, final int pRounds, final int pLength, CryptoServicePurpose purpose)

Constructor.

Parameters
pStrength:int

the strength

pRounds:int

the rounds.

pLength:int

the digest length

Method Detail

buildPersonalback to summary
private void buildPersonal(final byte[] pPersonal)

Constructor.

Parameters
pPersonal:byte[]

the personalisation

doFinalback to summary
public int doFinal(final byte[] pOut, final int pOutOffset)

Implements org.bouncycastle.crypto.Digest.doFinal.

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

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

Parameters
pOut:byte[]

the array the digest is to be copied into.

pOutOffset:int

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

doFinalback to summary
public int doFinal(final byte[] pOut, final int pOutOffset, final int pOutLen)

Implements org.bouncycastle.crypto.Xof.doFinal.

Doc from org.bouncycastle.crypto.Xof.doFinal.

Output the results of the final calculation for this digest to outLen number of bytes.

Parameters
pOut:byte[]

output array to write the output bytes to.

pOutOffset:int

offset to start writing the bytes at.

pOutLen:int

the number of output bytes requested.

Returns:int

the number of bytes written

doOutputback to summary
public int doOutput(final byte[] pOut, final int pOutOffset, final int pOutLen)

Implements org.bouncycastle.crypto.Xof.doOutput.

Doc from org.bouncycastle.crypto.Xof.doOutput.

Start outputting the results of the final calculation for this digest. Unlike doFinal, this method will continue producing output until the Xof is explicitly reset, or signals otherwise.

Parameters
pOut:byte[]

output array to write the output bytes to.

pOutOffset:int

offset to start writing the bytes at.

pOutLen:int

the number of output bytes requested.

Returns:int

the number of bytes written

getByteLengthback to summary
public int getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Doc from org.bouncycastle.crypto.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.Digest.getDigestSize.

Doc from org.bouncycastle.crypto.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.

initback to summary
public void init(final Kangaroo.KangarooParameters pParams)

Initialise the digest.

Parameters
pParams:Kangaroo.KangarooParameters

the parameters

lengthEncodeback to summary
private static byte[] lengthEncode(final long strLen)

right Encode a length.

Parameters
strLen:long

the length to encode

Returns:byte[]

the encoded length

processDataback to summary
private void processData(final byte[] pIn, final int pInOffSet, final int pLen)

Process data.

Parameters
pIn:byte[]

the input buffer

pInOffSet:int

the starting offset in the input buffer

pLen:int

the length of data to process

resetback to summary
public void reset()

Implements org.bouncycastle.crypto.Digest.reset.

Doc from org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

switchFinalback to summary
private void switchFinal()

Switch multiple node to squeezing.

switchLeafback to summary
private void switchLeaf(final boolean pMoreToCome)

Complete Leaf.

Parameters
pMoreToCome:boolean

is there more data to come? true/false

switchSingleback to summary
private void switchSingle()

Switch single node to squeezing.

switchToSqueezingback to summary
private void switchToSqueezing()

Switch to squeezing.

updateback to summary
public void update(final byte pIn)

Implements org.bouncycastle.crypto.Digest.update.

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

update the message digest with a single byte.

Parameters
pIn:byte

the input byte to be entered.

updateback to summary
public void update(final byte[] pIn, final int pInOff, final int pLen)

Implements org.bouncycastle.crypto.Digest.update.

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

update the message digest with a block of bytes.

Parameters
pIn:byte[]

the byte array containing the data.

pInOff:int

the offset into the byte array where the data starts.

pLen:int

the length of the data.

org.bouncycastle.crypto.digests back to summary

public Class Kangaroo.KangarooParameters

extends Object
implements CipherParameters
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.CipherParameters

Kangaroo Parameters.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private byte[]
thePersonal

The personalisation.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the personalisation
getPersonalisation
()

Obtain the personalisation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

thePersonalback to summary
private byte[] thePersonal

The personalisation.

Constructor Detail

KangarooParametersback to summary
public KangarooParameters()

Method Detail

getPersonalisationback to summary
public byte[] getPersonalisation()

Obtain the personalisation.

Returns:byte[]

the personalisation

org.bouncycastle.crypto.digests back to summary

public Class Kangaroo.KangarooParameters.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.crypto.digests.Kangaroo.KangarooParameters.Builder

Parameter Builder.

Field Summary

Modifier and TypeField and Description
private byte[]
thePersonal

The personalisation.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Kangaroo.KangarooParameters

Returns:

the parameters
build
()

Build the parameters.

public Kangaroo.KangarooParameters.Builder

Returns:

the Builder
setPersonalisation
(final byte[]
the personalisation
pPersonal
)

Set the personalisation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

thePersonalback to summary
private byte[] thePersonal

The personalisation.

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public Kangaroo.KangarooParameters build()

Build the parameters.

Returns:Kangaroo.KangarooParameters

the parameters

setPersonalisationback to summary
public Kangaroo.KangarooParameters.Builder setPersonalisation(final byte[] pPersonal)

Set the personalisation.

Parameters
pPersonal:byte[]

the personalisation

Returns:Kangaroo.KangarooParameters.Builder

the Builder

org.bouncycastle.crypto.digests back to summary

private Class Kangaroo.KangarooSponge

extends Object
Class Inheritance

The Kangaroo Sponge.

Field Summary

Modifier and TypeField and Description
private int
bytesInQueue

The numnber of bytes in the queue.

private static long[]
KeccakRoundConstants

The round constants.

private boolean
squeezing

Are we squeezing?

private final byte[]
theQueue

The queue.

private final int
theRateBytes

The rateBytes.

private final int
theRounds

The number of rounds.

private final long[]
theState

The state.

Constructor Summary

AccessConstructor and Description
pack-priv
KangarooSponge(final int
the strength
pStrength
,
final int
the rounds.
pRounds
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private void
absorb(final byte[]
the data buffer
data
,
final int
the starting offset in the buffer.
off
,
final int
the length of data to absorb
len
)

Absorb data into sponge.

private void
initSponge()

Initialise the sponge.

private void
KangarooAbsorb(final byte[]
the data to absorb
data
,
final int
the starting offset in the data
off
)

Absorb a block of data.

private void
KangarooExtract()

Extract a block of data to the queue.

private void
KangarooPermutation()

Permutation (KP).

private void
private void
squeeze(final byte[]
the output buffer
output
,
final int
the offset in the output buffer
offset
,
final int
the output length
outputLength
)

Squeeze data out.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesInQueueback to summary
private int bytesInQueue

The numnber of bytes in the queue.

KeccakRoundConstantsback to summary
private static long[] KeccakRoundConstants

The round constants.

squeezingback to summary
private boolean squeezing

Are we squeezing?

theQueueback to summary
private final byte[] theQueue

The queue.

theRateBytesback to summary
private final int theRateBytes

The rateBytes.

theRoundsback to summary
private final int theRounds

The number of rounds.

theStateback to summary
private final long[] theState

The state.

Constructor Detail

KangarooSpongeback to summary
pack-priv KangarooSponge(final int pStrength, final int pRounds)

Constructor.

Parameters
pStrength:int

the strength

pRounds:int

the rounds.

Method Detail

absorbback to summary
private void absorb(final byte[] data, final int off, final int len)

Absorb data into sponge.

Parameters
data:byte[]

the data buffer

off:int

the starting offset in the buffer.

len:int

the length of data to absorb

initSpongeback to summary
private void initSponge()

Initialise the sponge.

KangarooAbsorbback to summary
private void KangarooAbsorb(final byte[] data, final int off)

Absorb a block of data.

Parameters
data:byte[]

the data to absorb

off:int

the starting offset in the data

KangarooExtractback to summary
private void KangarooExtract()

Extract a block of data to the queue.

KangarooPermutationback to summary
private void KangarooPermutation()

Permutation (KP).

padAndSwitchToSqueezingPhaseback to summary
private void padAndSwitchToSqueezingPhase()

Handle padding.

squeezeback to summary
private void squeeze(final byte[] output, final int offset, final int outputLength)

Squeeze data out.

Parameters
output:byte[]

the output buffer

offset:int

the offset in the output buffer

outputLength:int

the output length

org.bouncycastle.crypto.digests back to summary

public Class Kangaroo.KangarooTwelve

extends KangarooBase
Class Inheritance

KangarooTwelve.

Constructor Summary

AccessConstructor and Description
public
KangarooTwelve()

Constructor.

public
KangarooTwelve(final int
the digest length
pLength
,
CryptoServicePurpose purpose)

Constructor.

public

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from org.bouncycastle.crypto.digests.Kangaroo.KangarooBase:
doFinaldoFinaldoOutputgetByteLengthgetDigestSizeinitresetupdateupdate

Constructor Detail

KangarooTwelveback to summary
public KangarooTwelve()

Constructor.

KangarooTwelveback to summary
public KangarooTwelve(final int pLength, CryptoServicePurpose purpose)

Constructor.

Parameters
pLength:int

the digest length

KangarooTwelveback to summary
public KangarooTwelve(CryptoServicePurpose purpose)

Method Detail

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

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

return the algorithm name

Returns:String

the algorithm name

org.bouncycastle.crypto.digests back to summary

public Class Kangaroo.MarsupilamiFourteen

extends KangarooBase
Class Inheritance

MarsupilamiFourteen.

Constructor Summary

AccessConstructor and Description
public
MarsupilamiFourteen()

Constructor.

public
MarsupilamiFourteen(final int
the digest length
pLength
,
CryptoServicePurpose purpose)

Constructor.

public

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from org.bouncycastle.crypto.digests.Kangaroo.KangarooBase:
doFinaldoFinaldoOutputgetByteLengthgetDigestSizeinitresetupdateupdate

Constructor Detail

MarsupilamiFourteenback to summary
public MarsupilamiFourteen()

Constructor.

MarsupilamiFourteenback to summary
public MarsupilamiFourteen(final int pLength, CryptoServicePurpose purpose)

Constructor.

Parameters
pLength:int

the digest length

MarsupilamiFourteenback to summary
public MarsupilamiFourteen(CryptoServicePurpose purpose)

Method Detail

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

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

return the algorithm name

Returns:String

the algorithm name