org.bouncycastle.crypto.engines

Class GOST28147Engine

Implemented Interfaces:
BlockCipher

public class GOST28147Engine
extends java.lang.Object
implements BlockCipher

implementation of GOST 28147-89

Field Summary

protected static int
BLOCK_SIZE

Constructor Summary

GOST28147Engine()
standard constructor.

Method Summary

String
getAlgorithmName()
int
getBlockSize()
static byte[]
getSBox(String sBoxName)
Return the S-Box associated with SBoxName
void
init(boolean forEncryption, CipherParameters params)
initialise an GOST28147 cipher.
int
processBlock(byte[] in, int inOff, byte[] out, int outOff)
void
reset()

Field Details

BLOCK_SIZE

protected static final int BLOCK_SIZE
Field Value:
8

Constructor Details

GOST28147Engine

public GOST28147Engine()
standard constructor.

Method Details

getAlgorithmName

public String getAlgorithmName()
Specified by:
getAlgorithmName in interface BlockCipher

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface BlockCipher

getSBox

public static byte[] getSBox(String sBoxName)
Return the S-Box associated with SBoxName
Parameters:
sBoxName - name of the S-Box
Returns:
byte array representing the S-Box

init

public void init(boolean forEncryption,
                 CipherParameters params)
initialise an GOST28147 cipher.
Specified by:
init in interface BlockCipher
Parameters:
forEncryption - whether or not we are for encryption.
params - the parameters required to set up the cipher.

processBlock

public int processBlock(byte[] in,
                        int inOff,
                        byte[] out,
                        int outOff)
Specified by:
processBlock in interface BlockCipher

reset

public void reset()
Specified by:
reset in interface BlockCipher