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

public Class CSHAKEDigest

extends SHAKEDigest
Class Inheritance
Imports
org.bouncycastle.crypto.CryptoServicePurpose, org.bouncycastle.util.Arrays

Customizable SHAKE function.

Field Summary

Modifier and TypeField and Description
private final byte[]
private static final byte[]

Constructor Summary

AccessConstructor and Description
public
CSHAKEDigest(int
security strength (in bits) of the underlying SHAKE function, 128 or 256.
bitLength
,
byte[]
the function name string, note this is reserved for use by NIST. Avoid using it if not required.
N
,
byte[]
the customization string - available for local use.
S
)

Base constructor.

public
CSHAKEDigest(int
security strength (in bits) of the underlying SHAKE function, 128 or 256.
bitLength
,
CryptoServicePurpose
the purpose for constructing the CSHAKEDigest
purpose
,
byte[]
the function name string, note this is reserved for use by NIST. Avoid using it if not required.
N
,
byte[]
the customization string - available for local use.
S
)

Base constructor.

public

Method Summary

Modifier and TypeMethod and Description
private void
public int
doOutput(byte[]
output array to write the output bytes to.
out
,
int
offset to start writing the bytes at.
outOff
,
int
the number of output bytes requested.
outLen
)

Overrides org.bouncycastle.crypto.digests.SHAKEDigest.doOutput.

Implements org.bouncycastle.crypto.Xof.doOutput.

Start outputting the results of the final calculation for this digest.

private byte[]
encodeString(byte[] str)

public String
public void
reset()

Overrides org.bouncycastle.crypto.digests.KeccakDigest.reset.

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

Inherited from org.bouncycastle.crypto.digests.SHAKEDigest:
cryptoServicePropertiesdoFinaldoFinaldoFinaldoFinalgetDigestSize

Field Detail

diffback to summary
private final byte[] diff
paddingback to summary
private static final byte[] padding

Constructor Detail

CSHAKEDigestback to summary
public CSHAKEDigest(int bitLength, byte[] N, byte[] S)

Base constructor.

Parameters
bitLength:int

security strength (in bits) of the underlying SHAKE function, 128 or 256.

N:byte[]

the function name string, note this is reserved for use by NIST. Avoid using it if not required.

S:byte[]

the customization string - available for local use.

CSHAKEDigestback to summary
public CSHAKEDigest(int bitLength, CryptoServicePurpose purpose, byte[] N, byte[] S)

Base constructor.

Parameters
bitLength:int

security strength (in bits) of the underlying SHAKE function, 128 or 256.

purpose:CryptoServicePurpose

the purpose for constructing the CSHAKEDigest

N:byte[]

the function name string, note this is reserved for use by NIST. Avoid using it if not required.

S:byte[]

the customization string - available for local use.

CSHAKEDigestback to summary
public CSHAKEDigest(CSHAKEDigest source)

Method Detail

diffPadAndAbsorbback to summary
private void diffPadAndAbsorb()
doOutputback to summary
public int doOutput(byte[] out, int outOff, int outLen)

Overrides org.bouncycastle.crypto.digests.SHAKEDigest.doOutput.

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
out:byte[]

output array to write the output bytes to.

outOff:int

offset to start writing the bytes at.

outLen:int

the number of output bytes requested.

Returns:int

the number of bytes written

encodeStringback to summary
private byte[] encodeString(byte[] str)
getAlgorithmNameback to summary
public String getAlgorithmName()

Overrides org.bouncycastle.crypto.digests.SHAKEDigest.getAlgorithmName.

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

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

return the algorithm name

Returns:String

the algorithm name

resetback to summary
public void reset()

Overrides org.bouncycastle.crypto.digests.KeccakDigest.reset.

Implements org.bouncycastle.crypto.Digest.reset.

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

reset the digest back to it's initial state.