public class ChaChaEngine extends Salsa20Engine
DEFAULT_ROUNDS, engineState, rounds, sigma, tau, x
Constructor and Description |
---|
ChaChaEngine()
Creates a 20 rounds ChaCha engine.
|
ChaChaEngine(int rounds)
Creates a ChaCha engine with a specific number of rounds.
|
Modifier and Type | Method and Description |
---|---|
protected void |
advanceCounter() |
protected void |
advanceCounter(long diff) |
static void |
chachaCore(int rounds,
int[] input,
int[] x)
ChaCha function
|
protected void |
generateKeyStream(byte[] output) |
java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements.
|
protected long |
getCounter() |
protected void |
resetCounter() |
protected void |
retreatCounter() |
protected void |
retreatCounter(long diff) |
protected void |
setKey(byte[] keyBytes,
byte[] ivBytes) |
getNonceSize, getPosition, init, packTauOrSigma, processBytes, reset, returnByte, rotl, salsaCore, seekTo, skip
public ChaChaEngine()
public ChaChaEngine(int rounds)
rounds
- the number of rounds (must be an even number).public java.lang.String getAlgorithmName()
StreamCipher
getAlgorithmName
in interface StreamCipher
getAlgorithmName
in class Salsa20Engine
protected void advanceCounter(long diff)
advanceCounter
in class Salsa20Engine
protected void advanceCounter()
advanceCounter
in class Salsa20Engine
protected void retreatCounter(long diff)
retreatCounter
in class Salsa20Engine
protected void retreatCounter()
retreatCounter
in class Salsa20Engine
protected long getCounter()
getCounter
in class Salsa20Engine
protected void resetCounter()
resetCounter
in class Salsa20Engine
protected void setKey(byte[] keyBytes, byte[] ivBytes)
setKey
in class Salsa20Engine
protected void generateKeyStream(byte[] output)
generateKeyStream
in class Salsa20Engine
public static void chachaCore(int rounds, int[] input, int[] x)
input
- input data