| java.lang.Object org.bouncycastle.crypto.engines.CAST5Engine
All known Subclasses: org.bouncycastle.crypto.engines.CAST6Engine,
CAST5Engine | public class CAST5Engine implements BlockCipher(Code) | | A class that provides CAST key encryption operations,
such as encoding data and generating keys.
All the algorithms herein are from the Internet RFC's
RFC2144 - CAST5 (64bit block, 40-128bit key)
RFC2612 - CAST6 (128bit block, 128-256bit key)
and implement a simplified cryptography interface.
|
Method Summary | |
final protected void | Bits32ToBytes(int in, byte[] b, int offset) | final protected void | Bits32ToInts(int in, int[] b, int offset) | final protected int | BytesTo32bits(byte[] b, int i) | final protected void | CAST_Decipher(int L16, int R16, int result) | final protected void | CAST_Encipher(int L0, int R0, int result) Does the 16 rounds to encrypt the block. | final protected int | F1(int D, int Kmi, int Kri) The first of the three processing functions for the
encryption and decryption. | final protected int | F2(int D, int Kmi, int Kri) The second of the three processing functions for the
encryption and decryption. | final protected int | F3(int D, int Kmi, int Kri) The third of the three processing functions for the
encryption and decryption. | final protected int | IntsTo32bits(int[] b, int i) | 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. | public String | getAlgorithmName() | public int | getBlockSize() | public void | init(boolean encrypting, CipherParameters params) initialise a CAST cipher. | public int | processBlock(byte[] in, int inOff, byte[] out, int outOff) | public void | reset() | protected void | setKey(byte[] key) |
BLOCK_SIZE | final protected static int BLOCK_SIZE(Code) | | |
M32 | final protected static int M32(Code) | | |
MAX_ROUNDS | final protected static int MAX_ROUNDS(Code) | | |
RED_ROUNDS | final protected static int RED_ROUNDS(Code) | | |
S1S2S3S4S5S6S7S8 | final protected static int[] S1S2S3S4S5S6S7S8(Code) | | |
CAST5Engine | public CAST5Engine()(Code) | | |
Bits32ToBytes | final protected void Bits32ToBytes(int in, byte[] b, int offset)(Code) | | |
Bits32ToInts | final protected void Bits32ToInts(int in, int[] b, int offset)(Code) | | |
BytesTo32bits | final protected int BytesTo32bits(byte[] b, int i)(Code) | | |
CAST_Decipher | final protected void CAST_Decipher(int L16, int R16, int result)(Code) | | |
CAST_Encipher | final protected void CAST_Encipher(int L0, int R0, int result)(Code) | | Does the 16 rounds to encrypt the block.
Parameters: L0 - the LH-32bits of the plaintext block Parameters: R0 - the RH-32bits of the plaintext block |
F1 | final protected int F1(int D, int Kmi, int Kri)(Code) | | The first of the three processing functions for the
encryption and decryption.
Parameters: D - the input to be processed Parameters: Kmi - the mask to be used from Km[n] Parameters: Kri - the rotation value to be used |
F2 | final protected int F2(int D, int Kmi, int Kri)(Code) | | The second of the three processing functions for the
encryption and decryption.
Parameters: D - the input to be processed Parameters: Kmi - the mask to be used from Km[n] Parameters: Kri - the rotation value to be used |
F3 | final protected int F3(int D, int Kmi, int Kri)(Code) | | The third of the three processing functions for the
encryption and decryption.
Parameters: D - the input to be processed Parameters: Kmi - the mask to be used from Km[n] Parameters: Kri - the rotation value to be used |
IntsTo32bits | final protected int IntsTo32bits(int[] b, int i)(Code) | | |
decryptBlock | protected int decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)(Code) | | Decrypt the given input starting at the given offset and place
the result in the provided buffer starting at the given offset.
Parameters: src - The plaintext buffer Parameters: srcIndex - An offset into src Parameters: dst - The ciphertext buffer Parameters: dstIndex - An offset into dst |
encryptBlock | protected int encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)(Code) | | Encrypt the given input starting at the given offset and place
the result in the provided buffer starting at the given offset.
Parameters: src - The plaintext buffer Parameters: srcIndex - An offset into src Parameters: dst - The ciphertext buffer Parameters: dstIndex - An offset into dst |
getBlockSize | public int getBlockSize()(Code) | | |
init | public void init(boolean encrypting, CipherParameters params)(Code) | | initialise a CAST cipher.
Parameters: encrypting - whether or not we are for encryption. Parameters: params - the parameters required to set up the cipher. exception: IllegalArgumentException - if the params argument isinappropriate. |
processBlock | public int processBlock(byte[] in, int inOff, byte[] out, int outOff)(Code) | | |
reset | public void reset()(Code) | | |
setKey | protected void setKey(byte[] key)(Code) | | |
|
|