|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bouncycastle.crypto.engines.NoekeonEngine
public class NoekeonEngine
A Noekeon engine, using direct-key mode.
Field Summary | |
---|---|
private boolean |
_forEncryption
|
private boolean |
_initialised
|
private int[] |
decryptKeys
|
private static int |
genericSize
|
private static int[] |
nullVector
|
private static int[] |
roundConstants
|
private int[] |
state
|
private int[] |
subKeys
|
Constructor Summary | |
---|---|
NoekeonEngine()
Create an instance of the Noekeon encryption algorithm and set some defaults |
Method Summary | |
---|---|
private int |
bytesToIntBig(byte[] in,
int off)
|
private int |
decryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
|
private int |
encryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
|
private void |
gamma(int[] a)
|
java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements. |
int |
getBlockSize()
Return the block size for this cipher (in bytes). |
void |
init(boolean forEncryption,
CipherParameters params)
initialise |
private void |
intToBytesBig(int x,
byte[] out,
int off)
|
private void |
pi1(int[] a)
|
private void |
pi2(int[] a)
|
int |
processBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
Process one block of input from the array in and write it to the out array. |
void |
reset()
Reset the cipher. |
private int |
rotl(int x,
int y)
|
private void |
setKey(byte[] key)
Re-key the cipher. |
private void |
theta(int[] a,
int[] k)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int genericSize
private static final int[] nullVector
private static final int[] roundConstants
private int[] state
private int[] subKeys
private int[] decryptKeys
private boolean _initialised
private boolean _forEncryption
Constructor Detail |
---|
public NoekeonEngine()
Method Detail |
---|
public java.lang.String getAlgorithmName()
BlockCipher
getAlgorithmName
in interface BlockCipher
public int getBlockSize()
BlockCipher
getBlockSize
in interface BlockCipher
public void init(boolean forEncryption, CipherParameters params)
init
in interface BlockCipher
forEncryption
- whether or not we are for encryption.params
- the parameters required to set up the cipher.
java.lang.IllegalArgumentException
- if the params argument is
inappropriate.public int processBlock(byte[] in, int inOff, byte[] out, int outOff)
BlockCipher
processBlock
in interface BlockCipher
in
- the array containing the input data.inOff
- offset into the in array the data starts at.out
- the array the output data will be copied into.outOff
- the offset into the out array the output will start at.
public void reset()
BlockCipher
reset
in interface BlockCipher
private void setKey(byte[] key)
key
- the key to be usedprivate int encryptBlock(byte[] in, int inOff, byte[] out, int outOff)
private int decryptBlock(byte[] in, int inOff, byte[] out, int outOff)
private void gamma(int[] a)
private void theta(int[] a, int[] k)
private void pi1(int[] a)
private void pi2(int[] a)
private int bytesToIntBig(byte[] in, int off)
private void intToBytesBig(int x, byte[] out, int off)
private int rotl(int x, int y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |