public class Zuc128CoreEngine extends java.lang.Object implements StreamCipher, Memoable
Modifier | Constructor and Description |
---|---|
protected |
Zuc128CoreEngine()
Constructor.
|
protected |
Zuc128CoreEngine(Zuc128CoreEngine pSource)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Memoable |
copy()
Create a copy of the engine.
|
static void |
encode32be(int val,
byte[] buf,
int off)
Encode a 32-bit value into a buffer (little-endian).
|
java.lang.String |
getAlgorithmName()
Obtain Algorithm Name.
|
protected int |
getMaxIterations()
Obtain Max iterations.
|
void |
init(boolean forEncryption,
CipherParameters params)
initialise a Snow3G cipher.
|
protected int |
makeKeyStreamWord()
Create the next keyStream word.
|
int |
processBytes(byte[] in,
int inOff,
int len,
byte[] out,
int outOff)
Process bytes.
|
void |
reset()
Reset the engine.
|
void |
reset(Memoable pState)
Reset from saved engine state.
|
byte |
returnByte(byte in)
Process single byte.
|
protected void |
setKeyAndIV(int[] pLFSR,
byte[] k,
byte[] iv)
Process key and IV into LFSR.
|
protected Zuc128CoreEngine()
protected Zuc128CoreEngine(Zuc128CoreEngine pSource)
pSource
- the source enginepublic void init(boolean forEncryption, CipherParameters params)
init
in interface StreamCipher
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.protected int getMaxIterations()
public java.lang.String getAlgorithmName()
getAlgorithmName
in interface StreamCipher
public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff)
processBytes
in interface StreamCipher
in
- the input bufferinOff
- the starting offset in the input bufferlen
- the length of data in the input bufferout
- the output bufferoutOff
- the starting offset in the output bufferpublic void reset()
reset
in interface StreamCipher
public byte returnByte(byte in)
returnByte
in interface StreamCipher
in
- the input bytepublic static void encode32be(int val, byte[] buf, int off)
val
- the value to encodebuf
- the output bufferoff
- the output offsetprotected void setKeyAndIV(int[] pLFSR, byte[] k, byte[] iv)
pLFSR
- the LFSRk
- the keyiv
- the ivprotected int makeKeyStreamWord()
public Memoable copy()