Class GOST28147Engine
-
- All Implemented Interfaces:
-
io.anyline.nfc.bouncycastle.crypto.BlockCipher
public class GOST28147Engine implements BlockCipher
implementation of GOST 28147-89
-
-
Constructor Summary
Constructors Constructor Description GOST28147Engine()
standard constructor.
-
Method Summary
Modifier and Type Method Description void
init(boolean forEncryption, CipherParameters params)
initialise an GOST28147 cipher. String
getAlgorithmName()
Return the name of the algorithm the cipher implements. int
getBlockSize()
Return the block size for this cipher (in bytes). int
processBlock(Array<byte> in, int inOff, Array<byte> out, int outOff)
Process one block of input from the array in and write it to the out array. void
reset()
Reset the cipher. static Array<byte>
getSBox(String sBoxName)
Return the S-Box associated with SBoxName static String
getSBoxName(Array<byte> sBox)
-
-
Method Detail
-
init
void init(boolean forEncryption, CipherParameters params)
initialise an GOST28147 cipher.
- Parameters:
forEncryption
- whether or not we are for encryption.params
- the parameters required to set up the cipher.
-
getAlgorithmName
String getAlgorithmName()
Return the name of the algorithm the cipher implements.
- Returns:
the name of the algorithm the cipher implements.
-
getBlockSize
int getBlockSize()
Return the block size for this cipher (in bytes).
- Returns:
the block size for this cipher in bytes.
-
processBlock
int processBlock(Array<byte> in, int inOff, Array<byte> out, int outOff)
Process one block of input from the array in and write it to the out array.
- Parameters:
in
- the array containing the input data.inOff
- offset into the in array the data starts at.out
- the array the output data will be copied into.outOff
- the offset into the out array the output will start at.- Returns:
the number of bytes processed and produced.
-
reset
void reset()
Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one).
-
getSBox
static Array<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
-
getSBoxName
static String getSBoxName(Array<byte> sBox)
-
-
-
-