|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.me.utils.CryptoUtils
Method Summary | |
static void |
copyBlock(byte[] src,
byte[] dst)
Copies one byte block to another. |
static void |
copyBlock(byte[] src,
int srcOff,
byte[] dst,
int dstOff,
int len)
Copies the specified byte sequence of the given source array to the specified destination array. |
static void |
copyBlock(int[] src,
int[] dst)
Copies one int block to another. |
static void |
copyBlock(int[] src,
int srcOff,
int[] dst,
int dstOff,
int len)
Copies the specified int sequence of the given source array to the specified destination array. |
static boolean |
equalsBlock(byte[] a,
byte[] b)
Checks two byte blocks for equality. |
static boolean |
equalsBlock(byte[] a,
int aOff,
byte[] b,
int bOff,
int len)
Check the specified sub-sequences of the given byte arrays for equality. |
static void |
spreadIntsToBytes(int[] inInts,
int inOff,
byte[] outBytes,
int outOff,
int intLen)
|
static void |
spreadIntsToBytesLE(int[] inInts,
int inOff,
byte[] outBytes,
int outOff,
int intLen)
Spreads ints into bytes in little endian bytes ordering. |
static void |
spreadShortsToBytesBE(int[] inShorts,
int inOff,
byte[] outBytes,
int outOff,
int shortLen)
|
static void |
spreadShortsToBytesLE(int[] inShorts,
int inOff,
byte[] outBytes,
int outOff,
int shortLen)
Spreads shorts ints into bytes in little endian bytes ordering. |
static void |
squashBytesToInts(byte[] inBytes,
int inOff,
int[] outInts,
int outOff,
int intLen)
|
static void |
squashBytesToIntsLE(byte[] inBytes,
int inOff,
int[] outInts,
int outOff,
int intLen)
|
static void |
squashBytesToShortsBE(byte[] inBytes,
int inOff,
int[] outShorts,
int outOff,
int shortLen)
|
static void |
squashBytesToShortsLE(byte[] inBytes,
int inOff,
int[] outShorts,
int outOff,
int shortLen)
|
static void |
zeroBlock(byte[] block)
Fills the given byte array with zeros. |
static void |
zeroBlock(byte[] block,
int off,
int len)
Fills the specified sub-array of the given byte array with zeros. |
static void |
zeroBlock(int[] block)
Fill an integer array with zeros. |
static void |
zeroBlock(int[] block,
int off,
int len)
Fill part of an integer array with zeros. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void zeroBlock(byte[] block, int off, int len)
Starting at the given off
position, len
bytes
of the given array are set to zero. To, for instance, set three bytes
to zero, starting at position 2, use:
byte[] block = ...; CryptoUtils.zeroBlock(block, 2, 3);
block
- the byte array of which some bytes have to be set to zerooff
- the offset indicating the start position within the byte array; the
following len
bytes are set to zerolen
- the number of bytes to be set to zero, starting at off
public static void zeroBlock(int[] block, int off, int len)
int
- arrayoffset
- within the blocklength
- how far to fill with zerospublic static void zeroBlock(byte[] block)
block
- the byte array to be filled with zerospublic static void zeroBlock(int[] block)
block
- the int array to be filled with zerospublic static void copyBlock(byte[] src, int srcOff, byte[] dst, int dstOff, int len)
Beginning at the specified srcOff
position, len
bytes
of the source array are copied to the given destination array, starting at
dstOff
.
src
- the source byte arraysrcOff
- the offset indicating the start position within the first byte array; the
following len
bytes will be copied to the destination arraydst
- the destination array to which to copy the bytesdstOff
- the offset indicating the start position within the destination byte
array, to which the bytes shall be copiedlen
- the number of bytes to be copiedpublic static void copyBlock(byte[] src, byte[] dst)
src
- the source byte arraydst
- the destination array to which to copy the bytespublic static void copyBlock(int[] src, int srcOff, int[] dst, int dstOff, int len)
Beginning at the specified srcOff
position, len
ints
of the source array are copied to the given destination array, starting at
dstOff
.
src
- the source int arraysrcOff
- the offset indicating the start position within the first int array; the
following len
ints will be copied to the destination arraydst
- the destination array to which to copy the intsdstOff
- the offset indicating the start position within the destination int
array, to which the ints shall be copiedlen
- the number of ints to be copiedpublic static void copyBlock(int[] src, int[] dst)
src
- the source int arraydst
- the destination array to which to copy the intspublic static boolean equalsBlock(byte[] a, int aOff, byte[] b, int bOff, int len)
a
- the first byte arrayaOff
- the offset indicating the start position within the first byte array; the
following len
bytes are compared with the corresponding number
of bytes of the second byte arrayb
- the second byte arraybOff
- the offset indicating the start position within the second byte array; the
following len
bytes are compared with the corresponding number
of bytes of the first byte arraylen
- the number of bytes to be comparedtrue
if the two sub-arrays have the same contents,
false
if notpublic static boolean equalsBlock(byte[] a, byte[] b)
a
- the first byte array to be compared with the second byte arrayb
- the second byte array to be compared with the first byte arraytrue
if the two blocks have the same contents,
false
if notpublic static void squashBytesToInts(byte[] inBytes, int inOff, int[] outInts, int outOff, int intLen)
inBytes
- inOff
- outInts
- outOff
- intLen
- public static void spreadIntsToBytes(int[] inInts, int inOff, byte[] outBytes, int outOff, int intLen)
public static void squashBytesToIntsLE(byte[] inBytes, int inOff, int[] outInts, int outOff, int intLen)
public static void spreadIntsToBytesLE(int[] inInts, int inOff, byte[] outBytes, int outOff, int intLen)
spreadIntsToBytes(int[], int, byte[], int, int)
public static void squashBytesToShortsBE(byte[] inBytes, int inOff, int[] outShorts, int outOff, int shortLen)
public static void spreadShortsToBytesBE(int[] inShorts, int inOff, byte[] outBytes, int outOff, int shortLen)
public static void squashBytesToShortsLE(byte[] inBytes, int inOff, int[] outShorts, int outOff, int shortLen)
public static void spreadShortsToBytesLE(int[] inShorts, int inOff, byte[] outBytes, int outOff, int shortLen)
spreadIntsToBytes(int[], int, byte[], int, int)
|
This Javadoc may contain text parts from IETF Internet Standard specifications, see copyright note) and RSA Data Security Public-Key Cryptography Standards (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |