java.lang.Object | |
↳ | org.bouncycastle.crypto.engines.CAST5Engine |
Known Direct Subclasses |
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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | BLOCK_SIZE | ||||||||||
int | M32 | ||||||||||
int | MAX_ROUNDS | ||||||||||
int | RED_ROUNDS |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
S1 | |||||||||||
S2 | |||||||||||
S3 | |||||||||||
S4 | |||||||||||
S5 | |||||||||||
S6 | |||||||||||
S7 | |||||||||||
S8 | |||||||||||
_Km | |||||||||||
_Kr |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the name of the algorithm the cipher implements.
| |||||||||||
Return the block size for this cipher (in bytes).
| |||||||||||
initialise a CAST cipher.
| |||||||||||
Process one block of input from the array in and write it to
the out array.
| |||||||||||
Reset the cipher.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Does the 16 rounds to encrypt the block.
| |||||||||||
The first of the three processing functions for the
encryption and decryption.
| |||||||||||
The second of the three processing functions for the
encryption and decryption.
| |||||||||||
The third of the three processing functions for the
encryption and decryption.
| |||||||||||
Decrypt the given input starting at the given offset and place
the result in the provided buffer starting at the given offset.
| |||||||||||
Encrypt the given input starting at the given offset and place
the result in the provided buffer starting at the given offset.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.bouncycastle.crypto.BlockCipher
|
Return the name of the algorithm the cipher implements.
Return the block size for this cipher (in bytes).
initialise a CAST cipher.
encrypting | whether or not we are for encryption. |
---|---|
params | the parameters required to set up the cipher. |
IllegalArgumentException | if the params argument is inappropriate. |
---|
Process one block of input from the array in and write it to the out array.
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. |
Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one).
Does the 16 rounds to encrypt the block.
L0 | the LH-32bits of the plaintext block |
---|---|
R0 | the RH-32bits of the plaintext block |
The first of the three processing functions for the encryption and decryption.
D | the input to be processed |
---|---|
Kmi | the mask to be used from Km[n] |
Kri | the rotation value to be used |
The second of the three processing functions for the encryption and decryption.
D | the input to be processed |
---|---|
Kmi | the mask to be used from Km[n] |
Kri | the rotation value to be used |
The third of the three processing functions for the encryption and decryption.
D | the input to be processed |
---|---|
Kmi | the mask to be used from Km[n] |
Kri | the rotation value to be used |
Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
src | The plaintext buffer |
---|---|
srcIndex | An offset into src |
dst | The ciphertext buffer |
dstIndex | An offset into dst |
Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
src | The plaintext buffer |
---|---|
srcIndex | An offset into src |
dst | The ciphertext buffer |
dstIndex | An offset into dst |