|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines methods for block ciphers.
Details: An IBlockCipher64
is a fixed-width block cipher. This interface exists primarily to support the interchangability of DesEngine
and TripleDesEngine
, both of which are 64-bit block ciphers, but it may be used to represent other 64-bit block ciphers as well.
IBlockCipher64
defines two methods for processing blocks of data: encrypt
and decrypt
. In both methods, there is a source array and a destination array. 64-bit blocks are read from the source array, processed, and then written into the destination array as 64-bit blocks. The two arrays may be different types, and need not necessarily be long
arrays, but symbols will always be consumed and produced in 64-bit blocks. If the source and destination arrays are the same object, then the input symbols will be overwritten with output symbols.
Both source and destination arrays must be arrays of primitive integer types (byte
, short
, int
, or long
). If byte
s are used, then they are processed 8 at a time; if short
s are used, then they are processed 4 at a time; and if int
s are used, then they are processed in pairs. When byte
s, short
s, or int
s are used to represent 64-bit blocks, they are arranged in big endian order.
The length parameter for methods in this interface does not count 64-bit blocks, but rather the number of array elements in the source array to process, in multiples that define whole blocks. For example, if two 64-bit blocks are to be read from an int array, then the length parameter should be set to 4.
Method Summary | |
void |
decrypt(java.lang.Object src,
java.lang.Object dest,
int length)
Decrypts blocks. |
void |
encrypt(java.lang.Object src,
java.lang.Object dest,
int length)
Encrypts blocks. |
Method Detail |
public void encrypt(java.lang.Object src, java.lang.Object dest, int length)
Details: This method encrypts a vector of blocks. Refer to the interface introduction for details.
src
- the source arraydest
- the destination arraylength
- number of elements in src to processpublic void decrypt(java.lang.Object src, java.lang.Object dest, int length)
Details: This method decrypts a vector of blocks. Refer to the interface introduction for details.
src
- the source arraydest
- the destination arraylength
- number of elements in src to process
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |