Sharkysoft home

lava.security
Interface IBlockCipher64

All Known Implementing Classes:
TripleDesEngine, DesEngine

public interface IBlockCipher64

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 bytes are used, then they are processed 8 at a time; if shorts are used, then they are processed 4 at a time; and if ints are used, then they are processed in pairs. When bytes, shorts, or ints 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.

Clip-source:

Since:
1999.08.08
Version:
1999.08.18

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

encrypt

public void encrypt(java.lang.Object src,
                    java.lang.Object dest,
                    int length)
Encrypts blocks.

Details: This method encrypts a vector of blocks. Refer to the interface introduction for details.

Parameters:
src - the source array
dest - the destination array
length - number of elements in src to process

decrypt

public void decrypt(java.lang.Object src,
                    java.lang.Object dest,
                    int length)
Decrypts blocks.

Details: This method decrypts a vector of blocks. Refer to the interface introduction for details.

Parameters:
src - the source array
dest - the destination array
length - number of elements in src to process

Sharkysoft home