Top Fields Constructors Methods
org.bouncycastle.crypto.engines

public Class DSTU7624Engine

extends Object
implements BlockCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.BlockCipher
Imports
org.bouncycastle.crypto.BlockCipher, .CipherParameters, .CryptoServicesRegistrar, .DataLengthException, .OutputLengthException, org.bouncycastle.crypto.constraints.DefaultServiceProperties, org.bouncycastle.crypto.params.KeyParameter, org.bouncycastle.util.Arrays, .Pack

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
DSTU7624Engine(int blockBitLength)

Method Summary

Modifier and TypeMethod and Description
private void
addRoundKey(int round)

private void
decryptBlock_128(byte[] in, int inOff, byte[] out, int outOff)

private void
encryptBlock_128(byte[] in, int inOff, byte[] out, int outOff)

public String
getAlgorithmName()

Implements org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

public int
getBlockSize()

Implements org.bouncycastle.crypto.BlockCipher.getBlockSize.

Return the block size for this cipher (in bytes).

public void
init(boolean
if true the cipher is initialised for encryption, if false for decryption.
forEncryption
,
CipherParameters
the key and other data required by the cipher.
params
)

Implements org.bouncycastle.crypto.BlockCipher.init.

Initialise the cipher.

private void
private void
private static long
mixColumn(long c)

private static long
mixColumnInv(long c)

private void
private void
private static long
mulX(long n)

private static long
mulX2(long n)

public int
processBlock(byte[]
the array containing the input data.
in
,
int
offset into the in array the data starts at.
inOff
,
byte[]
the array the output data will be copied into.
out
,
int
the offset into the out array the output will start at.
outOff
)

Implements org.bouncycastle.crypto.BlockCipher.processBlock.

Process one block of input from the array in and write it to the out array.

public void
reset()

Implements org.bouncycastle.crypto.BlockCipher.reset.

Reset the cipher.

private static long
rotate(int n, long x)

private void
rotateLeft(long[] x, long[] z)

private void
private void
private void
subRoundKey(int round)

private void
workingKeyExpandEven(long[] workingKey, long[] tempKey)

private void
workingKeyExpandKT(long[] workingKey, long[] tempKeys)

private void
private void
xorRoundKey(int round)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

forEncryptionback to summary
private boolean forEncryption
internalStateback to summary
private long[] internalState
roundKeysback to summary
private long[][] roundKeys
ROUNDS_128back to summary
private static final int ROUNDS_128
ROUNDS_256back to summary
private static final int ROUNDS_256
ROUNDS_512back to summary
private static final int ROUNDS_512
roundsAmountback to summary
private int roundsAmount
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
T0back to summary
private static final byte[] T0
T1back to summary
private static final byte[] T1
T2back to summary
private static final byte[] T2
T3back to summary
private static final byte[] T3
wordsInBlockback to summary
private int wordsInBlock
wordsInKeyback to summary
private int wordsInKey
workingKeyback to summary
private long[] workingKey

Constructor Detail

DSTU7624Engineback to summary
public DSTU7624Engine(int blockBitLength) throws IllegalArgumentException

Method Detail

addRoundKeyback to summary
private void addRoundKey(int round)
decryptBlock_128back to summary
private void decryptBlock_128(byte[] in, int inOff, byte[] out, int outOff)
encryptBlock_128back to summary
private void encryptBlock_128(byte[] in, int inOff, byte[] out, int outOff)
getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Doc from org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

Returns:String

the name of the algorithm the cipher implements.

getBlockSizeback to summary
public int getBlockSize()

Implements org.bouncycastle.crypto.BlockCipher.getBlockSize.

Doc from org.bouncycastle.crypto.BlockCipher.getBlockSize.

Return the block size for this cipher (in bytes).

Returns:int

the block size for this cipher in bytes.

initback to summary
public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException

Implements org.bouncycastle.crypto.BlockCipher.init.

Doc from org.bouncycastle.crypto.BlockCipher.init.

Initialise the cipher.

Parameters
forEncryption:boolean

if true the cipher is initialised for encryption, if false for decryption.

params:CipherParameters

the key and other data required by the cipher.

Exceptions
IllegalArgumentException:
if the params argument is inappropriate.
invShiftRowsback to summary
private void invShiftRows()
invSubBytesback to summary
private void invSubBytes()
mixColumnback to summary
private static long mixColumn(long c)
mixColumnInvback to summary
private static long mixColumnInv(long c)
mixColumnsback to summary
private void mixColumns()
mixColumnsInvback to summary
private void mixColumnsInv()
mulXback to summary
private static long mulX(long n)
mulX2back to summary
private static long mulX2(long n)
processBlockback to summary
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException

Implements org.bouncycastle.crypto.BlockCipher.processBlock.

Doc from org.bouncycastle.crypto.BlockCipher.processBlock.

Process one block of input from the array in and write it to the out array.

Parameters
in:byte[]

the array containing the input data.

inOff:int

offset into the in array the data starts at.

out:byte[]

the array the output data will be copied into.

outOff:int

the offset into the out array the output will start at.

Returns:int

the number of bytes processed and produced.

Exceptions
DataLengthException:
if there isn't enough data in input , or space in out.
IllegalStateException:
if the cipher isn't initialised.
resetback to summary
public void reset()

Implements org.bouncycastle.crypto.BlockCipher.reset.

Doc from org.bouncycastle.crypto.BlockCipher.reset.

Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one).

rotateback to summary
private static long rotate(int n, long x)
rotateLeftback to summary
private void rotateLeft(long[] x, long[] z)
shiftRowsback to summary
private void shiftRows()
subBytesback to summary
private void subBytes()
subRoundKeyback to summary
private void subRoundKey(int round)
workingKeyExpandEvenback to summary
private void workingKeyExpandEven(long[] workingKey, long[] tempKey)
workingKeyExpandKTback to summary
private void workingKeyExpandKT(long[] workingKey, long[] tempKeys)
workingKeyExpandOddback to summary
private void workingKeyExpandOdd()
xorRoundKeyback to summary
private void xorRoundKey(int round)