All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.utils.CryptoUtils

java.lang.Object
   |
   +----iaik.utils.CryptoUtils

public class CryptoUtils
extends Object
Some useful cryptography utilities.


Constructor Index

 o CryptoUtils()

Method Index

 o copyBlock(byte[], byte[])
Copy one block to another.
 o copyBlock(byte[], int, byte[], int, int)
Copy one block to another.
 o equalsBlock(byte[], byte[])
Check two blocks for equality.
 o equalsBlock(byte[], int, byte[], int, int)
Check two blocks for equality.
 o fillBlock(byte[], byte)
Fill a block with a given byte.
 o fillBlock(byte[], int, byte, int)
Fill a block with a given byte.
 o randomBlock(byte[])
Fills a block with random bytes.
 o randomBlock(byte[], int, int)
Fills a block with random bytes.
 o resizeArray(byte[], int)
Resize an array.
 o spreadIntsToBytes(int[], int, byte[], int, int)
Spread ints into bytes.
 o spreadShortsToBytesBE(int[], int, byte[], int, int)
Spread shorts into bytes in big-endian.
 o spreadShortsToBytesLE(int[], int, byte[], int, int)
Spread shorts into bytes in little-endian.
 o squashBytesToInts(byte[], int, int[], int, int)
Squash bytes down to ints.
 o squashBytesToShortsBE(byte[], int, int[], int, int)
Squash bytes down to shorts in big-endian.
 o squashBytesToShortsLE(byte[], int, int[], int, int)
Squash bytes down to shorts in little-endian.
 o xorBlock(byte[], byte[], byte[])
XOR two blocks.
 o xorBlock(byte[], int, byte[], int, byte[], int, int)
XOR two blocks.
 o zeroBlock(byte[])
Fills a block with zeros.
 o zeroBlock(byte[], int, int)
Fills a block with zeros.

Constructors

 o CryptoUtils
 public CryptoUtils()

Methods

 o zeroBlock
 public static void zeroBlock(byte block[],
                              int off,
                              int len)
Fills a block with zeros.

 o zeroBlock
 public static void zeroBlock(byte block[])
Fills a block with zeros.

 o randomBlock
 public static void randomBlock(byte block[],
                                int off,
                                int len)
Fills a block with random bytes.

 o randomBlock
 public static void randomBlock(byte block[])
Fills a block with random bytes.

 o xorBlock
 public static void xorBlock(byte a[],
                             int aOff,
                             byte b[],
                             int bOff,
                             byte dst[],
                             int dstOff,
                             int len)
XOR two blocks.

 o xorBlock
 public static void xorBlock(byte a[],
                             byte b[],
                             byte dst[])
XOR two blocks.

 o copyBlock
 public static void copyBlock(byte src[],
                              int srcOff,
                              byte dst[],
                              int dstOff,
                              int len)
Copy one block to another.

 o copyBlock
 public static void copyBlock(byte src[],
                              byte dst[])
Copy one block to another.

 o equalsBlock
 public static boolean equalsBlock(byte a[],
                                   int aOff,
                                   byte b[],
                                   int bOff,
                                   int len)
Check two blocks for equality.

 o equalsBlock
 public static boolean equalsBlock(byte a[],
                                   byte b[])
Check two blocks for equality.

 o fillBlock
 public static void fillBlock(byte block[],
                              int blockOff,
                              byte b,
                              int len)
Fill a block with a given byte.

 o fillBlock
 public static void fillBlock(byte block[],
                              byte b)
Fill a block with a given byte.

 o squashBytesToInts
 public static void squashBytesToInts(byte inBytes[],
                                      int inOff,
                                      int outInts[],
                                      int outOff,
                                      int intLen)
Squash bytes down to ints.

 o spreadIntsToBytes
 public static void spreadIntsToBytes(int inInts[],
                                      int inOff,
                                      byte outBytes[],
                                      int outOff,
                                      int intLen)
Spread ints into bytes.

 o squashBytesToShortsBE
 public static void squashBytesToShortsBE(byte inBytes[],
                                          int inOff,
                                          int outShorts[],
                                          int outOff,
                                          int shortLen)
Squash bytes down to shorts in big-endian.

 o squashBytesToShortsLE
 public static void squashBytesToShortsLE(byte inBytes[],
                                          int inOff,
                                          int outShorts[],
                                          int outOff,
                                          int shortLen)
Squash bytes down to shorts in little-endian.

 o spreadShortsToBytesBE
 public static void spreadShortsToBytesBE(int inShorts[],
                                          int inOff,
                                          byte outBytes[],
                                          int outOff,
                                          int shortLen)
Spread shorts into bytes in big-endian.

 o spreadShortsToBytesLE
 public static void spreadShortsToBytesLE(int inShorts[],
                                          int inOff,
                                          byte outBytes[],
                                          int outOff,
                                          int shortLen)
Spread shorts into bytes in little-endian.

 o resizeArray
 public static byte[] resizeArray(byte array[],
                                  int len)
Resize an array. If len is smaller than the array size some bytes are lost.

Parameters:
array - the array to resize
len - the new length of the array
Returns:
the resized array

All Packages  Class Hierarchy  This Package  Previous  Next  Index