com.mindbright.security.cipher
Class Twofish
java.lang.Object
com.mindbright.jce.crypto.CipherSpi
com.mindbright.security.cipher.BlockCipher
com.mindbright.security.cipher.Twofish
public final class Twofish
- extends BlockCipher
Method Summary |
void |
blockDecrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
Decrypt exactly one block of ciphertext. |
void |
blockEncrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
Encrypt exactly one block of plaintext. |
int |
getBlockSize()
|
void |
initializeKey(byte[] key)
Expand a user-supplied key material into a session key. |
Methods inherited from class com.mindbright.security.cipher.BlockCipher |
engineDoFinal, engineGetBlockSize, engineGetIV, engineGetOutputSize, engineInit, engineInit, engineSetMode, engineSetPadding, getIntLSBO, getIntMSBO, nboIncr, putIntLSBO, putIntMSBO |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Twofish
public Twofish()
getBlockSize
public int getBlockSize()
- Specified by:
getBlockSize
in class BlockCipher
initializeKey
public void initializeKey(byte[] key)
throws InvalidKeyException
- Expand a user-supplied key material into a session key.
- Specified by:
initializeKey
in class BlockCipher
- Parameters:
key
- The 64/128/192/256-bit user-key to use.
- Throws:
InvalidKeyException
- If the key is invalid.
blockEncrypt
public void blockEncrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
- Encrypt exactly one block of plaintext.
- Specified by:
blockEncrypt
in class BlockCipher
- Parameters:
in
- The plaintext.inOffset
- Index of in from which to start considering data.out
- The ciphertext generated from a plaintext.outOffset
- Index of out into which to start putting data.
blockDecrypt
public void blockDecrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset)
- Decrypt exactly one block of ciphertext.
- Specified by:
blockDecrypt
in class BlockCipher
- Parameters:
in
- The ciphertext.inOffset
- Index of in from which to start considering data.out
- The plaintext generated from a ciphertext.outOffset
- Index of out into which to start putting data.