org.bouncycastle.crypto.engines
Class CAST6Engine
- BlockCipher
public final class CAST6Engine
A class that provides CAST6 key encryption operations,
such as encoding data and generating keys.
All the algorithms herein are from the Internet RFC
RFC2612 - CAST6 (128bit block, 128-256bit key)
and implement a simplified cryptography interface.
BLOCK_SIZE, M32, MAX_ROUNDS, RED_ROUNDS, S1, S2, S3, S4, S5, S6, S7, S8, _Km, _Kr |
protected void | CAST_Decipher(int A, int B, int C, int D, result[] )- Does the 12 quad rounds rounds to decrypt the block.
|
protected void | CAST_Encipher(int A, int B, int C, int D, 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.
|
String | getAlgorithmName()
|
int | getBlockSize()
|
void | reset()
|
protected void | setKey(byte[] key)
|
Bits32ToBytes, Bits32ToInts, BytesTo32bits, CAST_Decipher, CAST_Encipher, F1, F2, F3, IntsTo32bits, decryptBlock, encryptBlock, getAlgorithmName, getBlockSize, init, processBlock, reset, setKey |
BLOCK_SIZE
protected static final int BLOCK_SIZE
ROUNDS
protected static final int ROUNDS
CAST6Engine
public CAST6Engine()
CAST_Decipher
protected final void CAST_Decipher(int A,
int B,
int C,
int D,
result[] ) Does the 12 quad rounds rounds to decrypt the block.
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 block
CAST_Encipher
protected final void CAST_Encipher(int A,
int B,
int C,
int D,
result[] ) Does the 12 quad rounds rounds to encrypt the block.
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 block
decryptBlock
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.
- decryptBlock in interface CAST5Engine
src - The plaintext buffersrcIndex - An offset into srcdst - The ciphertext bufferdstIndex - An offset into dst
encryptBlock
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.
- encryptBlock in interface CAST5Engine
src - The plaintext buffersrcIndex - An offset into srcdst - The ciphertext bufferdstIndex - An offset into dst