Top Description Fields Constructors Methods
org.bouncycastle.crypto.engines

public Class ChaChaEngine

extends Salsa20Engine
Class Inheritance
Imports
org.bouncycastle.util.Integers, .Pack

Implementation of Daniel J. Bernstein's ChaCha stream cipher.

Field Summary

Inherited from org.bouncycastle.crypto.engines.Salsa20Engine:
DEFAULT_ROUNDSengineStateroundssigmataux

Constructor Summary

AccessConstructor and Description
public
ChaChaEngine()

Creates a 20 rounds ChaCha engine.

public
ChaChaEngine(int
the number of rounds (must be an even number).
rounds
)

Creates a ChaCha engine with a specific number of rounds.

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
public static void
chachaCore(int rounds, int[]
input data
input
,
int[] x)

ChaCha function

protected void
public String
protected long
protected void
protected void
protected void
protected void
setKey(byte[] keyBytes, byte[] ivBytes)

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.setKey.

Inherited from org.bouncycastle.crypto.engines.Salsa20Engine:
getNonceSizegetPositioninitpackTauOrSigmaprocessBytesresetreturnBytesalsaCoreseekToskip

Constructor Detail

ChaChaEngineback to summary
public ChaChaEngine()

Creates a 20 rounds ChaCha engine.

ChaChaEngineback to summary
public ChaChaEngine(int rounds)

Creates a ChaCha engine with a specific number of rounds.

Parameters
rounds:int

the number of rounds (must be an even number).

Method Detail

advanceCounterback to summary
protected void advanceCounter(long diff)

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.advanceCounter.

advanceCounterback to summary
protected void advanceCounter()

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.advanceCounter.

chachaCoreback to summary
public static void chachaCore(int rounds, int[] input, int[] x)

ChaCha function

Parameters
input:int[]

input data

generateKeyStreamback to summary
protected void generateKeyStream(byte[] output)

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.generateKeyStream.

getAlgorithmNameback to summary
public String getAlgorithmName()

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.getAlgorithmName.

Implements org.bouncycastle.crypto.StreamCipher.getAlgorithmName.

Doc from org.bouncycastle.crypto.StreamCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

Returns:String

the name of the algorithm the cipher implements.

getCounterback to summary
protected long getCounter()

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.getCounter.

resetCounterback to summary
protected void resetCounter()

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.resetCounter.

retreatCounterback to summary
protected void retreatCounter(long diff)

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.retreatCounter.

retreatCounterback to summary
protected void retreatCounter()

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.retreatCounter.

setKeyback to summary
protected void setKey(byte[] keyBytes, byte[] ivBytes)

Overrides org.bouncycastle.crypto.engines.Salsa20Engine.setKey.