Package org.bouncycastle.crypto.engines
Class ChaCha7539Engine
java.lang.Object
org.bouncycastle.crypto.engines.Salsa20Engine
org.bouncycastle.crypto.engines.ChaCha7539Engine
- All Implemented Interfaces:
SkippingCipher
,SkippingStreamCipher
,StreamCipher
Implementation of Daniel J. Bernstein's ChaCha stream cipher.
-
Field Summary
Fields inherited from class org.bouncycastle.crypto.engines.Salsa20Engine
DEFAULT_ROUNDS, engineState, rounds, sigma, tau, x
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
advanceCounter
(long diff) protected void
generateKeyStream
(byte[] output) Return the name of the algorithm the cipher implements.protected long
protected int
protected void
protected void
protected void
retreatCounter
(long diff) protected void
setKey
(byte[] keyBytes, byte[] ivBytes) Methods inherited from class org.bouncycastle.crypto.engines.Salsa20Engine
getPosition, init, packTauOrSigma, processBytes, reset, returnByte, salsaCore, seekTo, skip
-
Constructor Details
-
ChaCha7539Engine
public ChaCha7539Engine()Creates a 20 rounds ChaCha engine.
-
-
Method Details
-
getAlgorithmName
Description copied from interface:StreamCipher
Return the name of the algorithm the cipher implements.- Specified by:
getAlgorithmName
in interfaceStreamCipher
- Overrides:
getAlgorithmName
in classSalsa20Engine
- Returns:
- the name of the algorithm the cipher implements.
-
getNonceSize
protected int getNonceSize()- Overrides:
getNonceSize
in classSalsa20Engine
-
advanceCounter
protected void advanceCounter(long diff) - Overrides:
advanceCounter
in classSalsa20Engine
-
advanceCounter
protected void advanceCounter()- Overrides:
advanceCounter
in classSalsa20Engine
-
retreatCounter
protected void retreatCounter(long diff) - Overrides:
retreatCounter
in classSalsa20Engine
-
retreatCounter
protected void retreatCounter()- Overrides:
retreatCounter
in classSalsa20Engine
-
getCounter
protected long getCounter()- Overrides:
getCounter
in classSalsa20Engine
-
resetCounter
protected void resetCounter()- Overrides:
resetCounter
in classSalsa20Engine
-
setKey
protected void setKey(byte[] keyBytes, byte[] ivBytes) - Overrides:
setKey
in classSalsa20Engine
-
generateKeyStream
protected void generateKeyStream(byte[] output) - Overrides:
generateKeyStream
in classSalsa20Engine
-