All Packages  Class Hierarchy  This Package  Previous  Next  Index


Class Acme.Crypto.CryptoUtils

java.lang.Object
   |
   +----Acme.Crypto.CryptoUtils

public class CryptoUtils
extends Object
Some cryptography utilities.

These are static methods used by a lot of the cryptography classes. Most of them operate on byte arrays, which we call blocks. They could be encapsulated in a "Block" class, but that would mean a big efficiency hit - method calls are a lot more expensive than array accesses.

Fetch the software.
Fetch the entire Acme package.


Constructor Index

 o CryptoUtils()

Method Index

 o copyBlock(byte[], byte[])
Utility routine to copy one block to another.
 o copyBlock(byte[], int, byte[], int, int)
Utility routine to copy one block to another.
 o equalsBlock(byte[], byte[])
Utility routine to check two blocks for equality.
 o equalsBlock(byte[], int, byte[], int, int)
Utility routine to check two blocks for equality.
 o fillBlock(byte[], byte)
Utility routine fill a block with a given byte.
 o fillBlock(byte[], int, byte, int)
Utility routine fill a block with a given byte.
 o randomBlock(byte[])
Utility routine to fill a block with random bytes.
 o randomBlock(byte[], int, int)
Utility routine to fill a block with random bytes.
 o spreadIntsToBytes(int[], int, byte[], int, int)
Spread ints into bytes.
 o spreadIntsToBytesLittle(int[], int, byte[], int, int)
Spread ints into bytes, little-endian.
 o spreadShortsToBytes(int[], int, byte[], int, int)
Spread shorts into bytes.
 o spreadShortsToBytesLittle(int[], int, byte[], int, int)
Spread shorts into bytes, little endian.
 o squashBytesToInts(byte[], int, int[], int, int)
Squash bytes down to ints.
 o squashBytesToIntsLittle(byte[], int, int[], int, int)
Squash bytes down to ints, little-endian.
 o squashBytesToShorts(byte[], int, int[], int, int)
Squash bytes down to shorts.
 o squashBytesToShortsLittle(byte[], int, int[], int, int)
Squash bytes down to shorts, little endian.
 o toStringBlock(byte[])
Convert a block to a String representation.
 o toStringBlock(byte[], int, int)
Convert a block to a String representation.
 o xorBlock(byte[], byte[], byte[])
Utility routine to XOR two blocks.
 o xorBlock(byte[], int, byte[], int, byte[], int, int)
Utility routine to XOR two blocks.
 o zeroBlock(byte[])
Utility routine to fill a block with zeros.
 o zeroBlock(byte[], int, int)
Utility routine to fill a block with zeros.

Constructors

 o CryptoUtils
 public CryptoUtils()

Methods

 o zeroBlock
 public static void zeroBlock(byte block[],
                              int off,
                              int len)
Utility routine to fill a block with zeros.

 o zeroBlock
 public static void zeroBlock(byte block[])
Utility routine to fill a block with zeros.

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

 o randomBlock
 public static void randomBlock(byte block[])
Utility routine to fill 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)
Utility routine to XOR two blocks.

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

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

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

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

 o equalsBlock
 public static boolean equalsBlock(byte a[],
                                   byte b[])
Utility routine to check two blocks for equality.

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

 o fillBlock
 public static void fillBlock(byte block[],
                              byte b)
Utility routine 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 squashBytesToIntsLittle
 public static void squashBytesToIntsLittle(byte inBytes[],
                                            int inOff,
                                            int outInts[],
                                            int outOff,
                                            int intLen)
Squash bytes down to ints, little-endian.

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

 o squashBytesToShorts
 public static void squashBytesToShorts(byte inBytes[],
                                        int inOff,
                                        int outShorts[],
                                        int outOff,
                                        int shortLen)
Squash bytes down to shorts.

 o spreadShortsToBytes
 public static void spreadShortsToBytes(int inShorts[],
                                        int inOff,
                                        byte outBytes[],
                                        int outOff,
                                        int shortLen)
Spread shorts into bytes.

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

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

 o toStringBlock
 public static String toStringBlock(byte block[],
                                    int off,
                                    int len)
Convert a block to a String representation.

 o toStringBlock
 public static String toStringBlock(byte block[])
Convert a block to a String representation.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs