org.logi.crypto.test
Class TestMode

java.lang.Object
  extended byorg.logi.crypto.Crypto
      extended byorg.logi.crypto.test.TestMode

public class TestMode
extends Crypto

This application tests the various encryption-mode classes.

See Also:
EncryptMode

Field Summary
 
Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Method Summary
static byte[] ensureArrayLength(byte[] a, int i, int l)
          Either returns a or a new array contianing the first i bytes from a.
static void main(java.lang.String[] arg)
           
static boolean test(java.lang.String keyType, java.lang.String mode, java.io.PrintWriter details, java.io.PrintWriter summary)
           
static byte[] trimArrayLength(byte[] a, int i)
          Either returns a or a new array contianing the first i bytes from a.
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureArrayLength

public static final byte[] ensureArrayLength(byte[] a,
                                             int i,
                                             int l)
Either returns a or a new array contianing the first i bytes from a. The returned array is ensured to be at least l bytes long.


trimArrayLength

public static final byte[] trimArrayLength(byte[] a,
                                           int i)
Either returns a or a new array contianing the first i bytes from a. The returned array will be i bytes long.


test

public static boolean test(java.lang.String keyType,
                           java.lang.String mode,
                           java.io.PrintWriter details,
                           java.io.PrintWriter summary)
                    throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] arg)
                 throws java.lang.Exception
Throws:
java.lang.Exception