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
public class ChaCha7539Engine extends Salsa20Engine
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
Constructors Constructor Description ChaCha7539Engine()Creates a 20 rounds ChaCha engine.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadvanceCounter()protected voidadvanceCounter(long diff)protected voidgenerateKeyStream(byte[] output)java.lang.StringgetAlgorithmName()Return the name of the algorithm the cipher implements.protected longgetCounter()protected intgetNonceSize()protected voidresetCounter()protected voidretreatCounter()protected voidretreatCounter(long diff)protected voidsetKey(byte[] keyBytes, byte[] ivBytes)-
Methods inherited from class org.bouncycastle.crypto.engines.Salsa20Engine
getPosition, init, packTauOrSigma, processBytes, reset, returnByte, salsaCore, seekTo, skip
-
-
-
-
Method Detail
-
getAlgorithmName
public java.lang.String getAlgorithmName()
Description copied from interface:StreamCipherReturn the name of the algorithm the cipher implements.- Specified by:
getAlgorithmNamein interfaceStreamCipher- Overrides:
getAlgorithmNamein classSalsa20Engine- Returns:
- the name of the algorithm the cipher implements.
-
getNonceSize
protected int getNonceSize()
- Overrides:
getNonceSizein classSalsa20Engine
-
advanceCounter
protected void advanceCounter(long diff)
- Overrides:
advanceCounterin classSalsa20Engine
-
advanceCounter
protected void advanceCounter()
- Overrides:
advanceCounterin classSalsa20Engine
-
retreatCounter
protected void retreatCounter(long diff)
- Overrides:
retreatCounterin classSalsa20Engine
-
retreatCounter
protected void retreatCounter()
- Overrides:
retreatCounterin classSalsa20Engine
-
getCounter
protected long getCounter()
- Overrides:
getCounterin classSalsa20Engine
-
resetCounter
protected void resetCounter()
- Overrides:
resetCounterin classSalsa20Engine
-
setKey
protected void setKey(byte[] keyBytes, byte[] ivBytes)- Overrides:
setKeyin classSalsa20Engine
-
generateKeyStream
protected void generateKeyStream(byte[] output)
- Overrides:
generateKeyStreamin classSalsa20Engine
-
-