public class SkipjackEngine extends java.lang.Object implements BlockCipher
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BLOCK_SIZE |
private boolean |
encrypting |
(package private) static short[] |
ftable |
private int[] |
key0 |
private int[] |
key1 |
private int[] |
key2 |
private int[] |
key3 |
Constructor and Description |
---|
SkipjackEngine() |
Modifier and Type | Method and Description |
---|---|
int |
decryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff) |
int |
encryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff) |
private int |
g(int k,
int w)
The G permutation
|
java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements.
|
int |
getBlockSize()
Return the block size for this cipher (in bytes).
|
private int |
h(int k,
int w)
the inverse of the G permutation.
|
void |
init(boolean encrypting,
CipherParameters params)
initialise a SKIPJACK cipher.
|
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.
|
static final int BLOCK_SIZE
static short[] ftable
private int[] key0
private int[] key1
private int[] key2
private int[] key3
private boolean encrypting
public void init(boolean encrypting, CipherParameters params)
init
in interface BlockCipher
encrypting
- 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 java.lang.String getAlgorithmName()
BlockCipher
getAlgorithmName
in interface BlockCipher
public int getBlockSize()
BlockCipher
getBlockSize
in interface BlockCipher
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 int g(int k, int w)
public int encryptBlock(byte[] in, int inOff, byte[] out, int outOff)
private int h(int k, int w)
public int decryptBlock(byte[] in, int inOff, byte[] out, int outOff)