sam.cipher
Class WarFactory.Key

java.lang.Object
  |
  +--sam.cipher.Key
        |
        +--sam.cipher.WarFactory.Key
Enclosing class:
WarFactory

protected class WarFactory.Key
extends Key

General purpose key class. Keys are parsed from String using specified number of significant bits.


Nested Class Summary
 
Nested classes inherited from class sam.cipher.Key
Key.Mode
 
Field Summary
protected  int numberOfRounds
          The number of rounds issuable through these bits
 
Fields inherited from class sam.cipher.Key
asBooleans, asBytes, ASCII, asInts, asLongs, asShorts, BINARY, bits, bitsPerLong, direction, EMPTY, HEXA, IGNORE, mask, OCTAL, PLAIN, UNICODE
 
Constructor Summary
protected WarFactory.Key(boolean[] bits)
          Builds a new War with specified key material
 
Method Summary
 sam.cipher.Key inverse()
          Inverses this key.
 int numberOfRounds()
          Gets the number of rounds to be processed by this key.
 
Methods inherited from class sam.cipher.Key
equals, expandToBytes, expandToInts, expandToLongs, expandToShorts, get1, get16, get32, get64, get8, getBits, getBooleans, getBytes, getInts, getLongs, getShorts, isEmpty, parse, toBytes, toLongs, toLongs, toLongs, toLongs, toLongs, toPassword, toPassword, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numberOfRounds

protected final int numberOfRounds
The number of rounds issuable through these bits

Constructor Detail

WarFactory.Key

protected WarFactory.Key(boolean[] bits)
Builds a new War with specified key material

Parameters:
bits - the boolean[] array composing the key material. Note that it shall have been resized to a the uppest lower multiple of WarFactory.keyBits
Method Detail

inverse

public sam.cipher.Key inverse()
Inverses this key.

Please note that this calculation is dependant of the cipher algorithm actually used, which is the WAR algorithm here.

Overrides:
inverse in class Key
See Also:
War

numberOfRounds

public int numberOfRounds()
Gets the number of rounds to be processed by this key.

Returns:
the number of rounds issuable through these bits