public final class CAST6Engine extends CAST5Engine
Modifier and Type | Field and Description |
---|---|
protected int[] |
_Km |
protected int[] |
_Kr |
protected int[] |
_Tm |
protected int[] |
_Tr |
protected static int |
BLOCK_SIZE |
protected static int |
ROUNDS |
M32, MAX_ROUNDS, RED_ROUNDS, S1, S2, S3, S4, S5, S6, S7, S8
Constructor and Description |
---|
CAST6Engine() |
Modifier and Type | Method and Description |
---|---|
protected void |
CAST_Decipher(int A,
int B,
int C,
int D,
int[] result)
Does the 12 quad rounds rounds to decrypt the block.
|
protected void |
CAST_Encipher(int A,
int B,
int C,
int D,
int[] result)
Does the 12 quad rounds rounds to encrypt the block.
|
protected int |
decryptBlock(byte[] src,
int srcIndex,
byte[] dst,
int dstIndex)
Decrypt the given input starting at the given offset and place
the result in the provided buffer starting at the given offset.
|
protected int |
encryptBlock(byte[] src,
int srcIndex,
byte[] dst,
int dstIndex)
Encrypt the given input starting at the given offset and place
the result in the provided buffer starting at the given offset.
|
java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements.
|
int |
getBlockSize()
Return the block size for this cipher (in bytes).
|
void |
reset()
Reset the cipher.
|
protected void |
setKey(byte[] key) |
Bits32ToBytes, Bits32ToInts, BytesTo32bits, CAST_Decipher, CAST_Encipher, F1, F2, F3, init, IntsTo32bits, processBlock
protected static final int ROUNDS
protected static final int BLOCK_SIZE
protected int[] _Kr
protected int[] _Km
protected int[] _Tr
protected int[] _Tm
public java.lang.String getAlgorithmName()
BlockCipher
getAlgorithmName
in interface BlockCipher
getAlgorithmName
in class CAST5Engine
public void reset()
BlockCipher
reset
in interface BlockCipher
reset
in class CAST5Engine
public int getBlockSize()
BlockCipher
getBlockSize
in interface BlockCipher
getBlockSize
in class CAST5Engine
protected void setKey(byte[] key)
setKey
in class CAST5Engine
protected int encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
encryptBlock
in class CAST5Engine
src
- The plaintext buffersrcIndex
- An offset into srcdst
- The ciphertext bufferdstIndex
- An offset into dstprotected int decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
decryptBlock
in class CAST5Engine
src
- The plaintext buffersrcIndex
- An offset into srcdst
- The ciphertext bufferdstIndex
- An offset into dstprotected final void CAST_Encipher(int A, int B, int C, int D, int[] result)
A
- the 00-31 bits of the plaintext blockB
- the 32-63 bits of the plaintext blockC
- the 64-95 bits of the plaintext blockD
- the 96-127 bits of the plaintext blockresult
- the resulting ciphertextprotected final void CAST_Decipher(int A, int B, int C, int D, int[] result)
A
- the 00-31 bits of the ciphertext blockB
- the 32-63 bits of the ciphertext blockC
- the 64-95 bits of the ciphertext blockD
- the 96-127 bits of the ciphertext blockresult
- the resulting plaintext