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

public Class DSTU7564Digest

extends Object
implements ExtendedDigest, Memoable
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.Memoable, org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.Digest
Imports
org.bouncycastle.crypto.CryptoServiceProperties, .CryptoServicePurpose, .CryptoServicesRegistrar, .ExtendedDigest, org.bouncycastle.util.Arrays, .Memoable, .Pack

Reference implementation of national ukrainian standard of hashing transformation DSTU7564. Thanks to Roman Oliynykov' native C implementation: https://github.com/Roman-Oliynykov/Kupyna-reference

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
DSTU7564Digest(int hashSizeBits)

public
DSTU7564Digest(int hashSizeBits, CryptoServicePurpose purpose)

Method Summary

Modifier and TypeMethod and Description
public Memoable
copy()

Implements org.bouncycastle.util.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.
private void
protected CryptoServiceProperties
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.Digest.doFinal.

close the digest, producing the final digest value.
public String
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.
private static long
mixColumn(long c)

private void
mixColumns(long[] s)

private void
P(long[] s)

private void
processBlock(byte[] input, int inOff)

private void
Q(long[] s)

public void
reset()

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.
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.
private static long
rotate(int n, long x)

private void
shiftRows(long[] s)

private void
subBytes(long[] s)

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

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

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

Field Detail

blockSizeback to summary
private int blockSize
bufback to summary
private byte[] buf
bufOffback to summary
private int bufOff
columnsback to summary
private int columns
hashSizeback to summary
private int hashSize
inputBlocksback to summary
private long inputBlocks
NB_1024back to summary
private static final int NB_1024
NB_512back to summary
private static final int NB_512
NR_1024back to summary
private static final int NR_1024
NR_512back to summary
private static final int NR_512
purposeback to summary
private final CryptoServicePurpose purpose
roundsback to summary
private int rounds
S0back to summary
private static final byte[] S0
S1back to summary
private static final byte[] S1
S2back to summary
private static final byte[] S2
S3back to summary
private static final byte[] S3
stateback to summary
private long[] state
tempState1back to summary
private long[] tempState1
tempState2back to summary
private long[] tempState2

Constructor Detail

DSTU7564Digestback to summary
public DSTU7564Digest(DSTU7564Digest digest)
DSTU7564Digestback to summary
public DSTU7564Digest(int hashSizeBits)
DSTU7564Digestback to summary
public DSTU7564Digest(int hashSizeBits, CryptoServicePurpose purpose)

Method Detail

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.

copyInback to summary
private void copyIn(DSTU7564Digest digest)
cryptoServicePropertiesback to summary
protected CryptoServiceProperties cryptoServiceProperties()
doFinalback to summary
public int doFinal(byte[] out, int outOff)

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
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.

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

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.

mixColumnback to summary
private static long mixColumn(long c)
mixColumnsback to summary
private void mixColumns(long[] s)
Pback to summary
private void P(long[] s)
processBlockback to summary
private void processBlock(byte[] input, int inOff)
Qback to summary
private void Q(long[] s)
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.

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.

rotateback to summary
private static long rotate(int n, long x)
shiftRowsback to summary
private void shiftRows(long[] s)
subBytesback to summary
private void subBytes(long[] s)
updateback to summary
public void update(byte in)

Implements org.bouncycastle.crypto.Digest.update.

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

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