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.
-
CryptoUtils()
-
-
copyBlock(byte[], byte[])
- Copy one block to another.
-
copyBlock(byte[], int, byte[], int, int)
- Copy one block to another.
-
equalsBlock(byte[], byte[])
- Check two blocks for equality.
-
equalsBlock(byte[], int, byte[], int, int)
- Check two blocks for equality.
-
fillBlock(byte[], byte)
- Fill a block with a given byte.
-
fillBlock(byte[], int, byte, int)
- Fill a block with a given byte.
-
randomBlock(byte[])
- Fills a block with random bytes.
-
randomBlock(byte[], int, int)
- Fills a block with random bytes.
-
resizeArray(byte[], int)
- Resize an array.
-
spreadIntsToBytes(int[], int, byte[], int, int)
- Spread ints into bytes.
-
spreadShortsToBytesBE(int[], int, byte[], int, int)
- Spread shorts into bytes in big-endian.
-
spreadShortsToBytesLE(int[], int, byte[], int, int)
- Spread shorts into bytes in little-endian.
-
squashBytesToInts(byte[], int, int[], int, int)
- Squash bytes down to ints.
-
squashBytesToShortsBE(byte[], int, int[], int, int)
- Squash bytes down to shorts in big-endian.
-
squashBytesToShortsLE(byte[], int, int[], int, int)
- Squash bytes down to shorts in little-endian.
-
xorBlock(byte[], byte[], byte[])
- XOR two blocks.
-
xorBlock(byte[], int, byte[], int, byte[], int, int)
- XOR two blocks.
-
zeroBlock(byte[])
- Fills a block with zeros.
-
zeroBlock(byte[], int, int)
- Fills a block with zeros.
CryptoUtils
public CryptoUtils()
zeroBlock
public static void zeroBlock(byte block[],
int off,
int len)
- Fills a block with zeros.
zeroBlock
public static void zeroBlock(byte block[])
- Fills a block with zeros.
randomBlock
public static void randomBlock(byte block[],
int off,
int len)
- Fills a block with random bytes.
randomBlock
public static void randomBlock(byte block[])
- Fills a block with random bytes.
xorBlock
public static void xorBlock(byte a[],
int aOff,
byte b[],
int bOff,
byte dst[],
int dstOff,
int len)
- XOR two blocks.
xorBlock
public static void xorBlock(byte a[],
byte b[],
byte dst[])
- XOR two blocks.
copyBlock
public static void copyBlock(byte src[],
int srcOff,
byte dst[],
int dstOff,
int len)
- Copy one block to another.
copyBlock
public static void copyBlock(byte src[],
byte dst[])
- Copy one block to another.
equalsBlock
public static boolean equalsBlock(byte a[],
int aOff,
byte b[],
int bOff,
int len)
- Check two blocks for equality.
equalsBlock
public static boolean equalsBlock(byte a[],
byte b[])
- Check two blocks for equality.
fillBlock
public static void fillBlock(byte block[],
int blockOff,
byte b,
int len)
- Fill a block with a given byte.
fillBlock
public static void fillBlock(byte block[],
byte b)
- Fill a block with a given byte.
squashBytesToInts
public static void squashBytesToInts(byte inBytes[],
int inOff,
int outInts[],
int outOff,
int intLen)
- Squash bytes down to ints.
spreadIntsToBytes
public static void spreadIntsToBytes(int inInts[],
int inOff,
byte outBytes[],
int outOff,
int intLen)
- Spread ints into bytes.
squashBytesToShortsBE
public static void squashBytesToShortsBE(byte inBytes[],
int inOff,
int outShorts[],
int outOff,
int shortLen)
- Squash bytes down to shorts in big-endian.
squashBytesToShortsLE
public static void squashBytesToShortsLE(byte inBytes[],
int inOff,
int outShorts[],
int outOff,
int shortLen)
- Squash bytes down to shorts in little-endian.
spreadShortsToBytesBE
public static void spreadShortsToBytesBE(int inShorts[],
int inOff,
byte outBytes[],
int outOff,
int shortLen)
- Spread shorts into bytes in big-endian.
spreadShortsToBytesLE
public static void spreadShortsToBytesLE(int inShorts[],
int inOff,
byte outBytes[],
int outOff,
int shortLen)
- Spread shorts into bytes in little-endian.
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