|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bouncycastle.crypto.engines.XTEAEngine
public class XTEAEngine
An XTEA engine.
| Field Summary | |
|---|---|
private boolean |
_forEncryption
|
private boolean |
_initialised
|
private int[] |
_S
|
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 | |
|---|---|
XTEAEngine()
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[] _S
private boolean _initialised
private boolean _forEncryption
| Constructor Detail |
|---|
public XTEAEngine()
| Method Detail |
|---|
public java.lang.String getAlgorithmName()
BlockCipher
getAlgorithmName in interface BlockCipherpublic int getBlockSize()
BlockCipher
getBlockSize in interface BlockCipherpublic void init(boolean forEncryption,
CipherParameters params)
init in interface BlockCipherforEncryption - 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 BlockCipherin - 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 BlockCipherprivate 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 All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||