|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bouncycastle.crypto.engines.TEAEngine
public class TEAEngine
An TEA engine.
Field Summary | |
---|---|
private int |
_a
|
private int |
_b
|
private int |
_c
|
private int |
_d
|
private boolean |
_forEncryption
|
private boolean |
_initialised
|
private static int |
block_size
|
private static int |
d_sum
|
private static int |
delta
|
private static int |
key_size
|
private static int |
rounds
|
Constructor Summary | |
---|---|
TEAEngine()
Create an instance of the TEA encryption algorithm and set some defaults |
Method Summary | |
---|---|
private int |
bytesToInt(byte[] in,
int inOff)
|
private int |
decryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
|
private int |
encryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
|
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 |
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 void |
setKey(byte[] key)
Re-key the cipher. |
private void |
unpackInt(int v,
byte[] out,
int outOff)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int rounds
private static final int block_size
private static final int key_size
private static final int delta
private static final int d_sum
private int _a
private int _b
private int _c
private int _d
private boolean _initialised
private boolean _forEncryption
Constructor Detail |
---|
public TEAEngine()
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 int bytesToInt(byte[] in, int inOff)
private void unpackInt(int v, byte[] out, int outOff)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |