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

public abstract Class GOST3411_2012Digest

extends Object
implements ExtendedDigest, Memoable
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.Memoable, org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.Digest
Known Direct Subclasses
org.bouncycastle.crypto.digests.GOST3411_2012_256Digest, org.bouncycastle.crypto.digests.GOST3411_2012_512Digest
Imports
org.bouncycastle.crypto.CryptoServicePurpose, .CryptoServicesRegistrar, .ExtendedDigest, org.bouncycastle.util.Arrays, .Bytes, .Memoable

Base class for GOST3411-2012 256-bit and GOST3411-2012 512-bit digests.

Field Summary

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

private final byte[]
h

private final byte[]
private final byte[]
private final byte[]
m

private final byte[]
N

protected final CryptoServicePurpose
private final byte[]
private static final long[][]
T

private final byte[]
private static final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addMod512(byte[] A, int num)

private void
addMod512(byte[] A, byte[] B)

public abstract Memoable
copy()

Redeclares org.bouncycastle.util.Memoable.copy.

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

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.

private void
E(byte[] K, byte[] m)

private void
F(byte[] V)

private void
g_N(byte[] h, byte[] N, byte[] m)

public abstract 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 abstract int
getDigestSize()

Redeclares org.bouncycastle.crypto.Digest.getDigestSize.

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

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 void
reverse(byte[] src, byte[] dst)

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.

private static void
xor512(byte[] A, byte[] B)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockback to summary
private final byte[] block
bOffback to summary
private int bOff
Cback to summary
private static final byte[][] C
hback to summary
private final byte[] h
IVback to summary
private final byte[] IV
Kiback to summary
private final byte[] Ki
mback to summary
private final byte[] m
Nback to summary
private final byte[] N
purposeback to summary
protected final CryptoServicePurpose purpose
Sigmaback to summary
private final byte[] Sigma
Tback to summary
private static final long[][] T
tmpback to summary
private final byte[] tmp
Zeroback to summary
private static final byte[] Zero

Constructor Detail

GOST3411_2012Digestback to summary
public GOST3411_2012Digest(byte[] IV, CryptoServicePurpose purpose)

Method Detail

addMod512back to summary
private void addMod512(byte[] A, int num)
addMod512back to summary
private void addMod512(byte[] A, byte[] B)
copyback to summary
public abstract Memoable copy()

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

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.

Eback to summary
private void E(byte[] K, byte[] m)
Fback to summary
private void F(byte[] V)
g_Nback to summary
private void g_N(byte[] h, byte[] N, byte[] m)
getAlgorithmNameback to summary
public abstract String getAlgorithmName()

Redeclares 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 abstract int getDigestSize()

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

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.

reverseback to summary
private void reverse(byte[] src, byte[] dst)
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.

xor512back to summary
private static void xor512(byte[] A, byte[] B)