org.bouncycastle.crypto.engines
Class XSalsa20Engine
java.lang.Object
|
+--org.bouncycastle.crypto.engines.Salsa20Engine
|
+--org.bouncycastle.crypto.engines.XSalsa20Engine
- All Implemented Interfaces:
- SkippingCipher, SkippingStreamCipher, StreamCipher
- public class XSalsa20Engine
- extends Salsa20Engine
Implementation of Daniel J. Bernstein's XSalsa20 stream cipher - Salsa20 with an extended nonce.
XSalsa20 requires a 256 bit key, and a 192 bit nonce.
Method Summary |
java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements. |
protected int |
getNonceSize()
|
protected void |
setKey(byte[] keyBytes,
byte[] ivBytes)
XSalsa20 key generation: process 256 bit input key and 128 bits of the input nonce
using a core Salsa20 function without input addition to produce 256 bit working key
and use that with the remaining 64 bits of nonce to initialize a standard Salsa20 engine state. |
Methods inherited from class org.bouncycastle.crypto.engines.Salsa20Engine |
advanceCounter, advanceCounter, generateKeyStream, getCounter, getPosition, init, packTauOrSigma, processBytes, reset, resetCounter, retreatCounter, retreatCounter, returnByte, salsaCore, seekTo, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XSalsa20Engine
public XSalsa20Engine()
getAlgorithmName
public java.lang.String getAlgorithmName()
- Description copied from interface:
StreamCipher
- Return the name of the algorithm the cipher implements.
- Overrides:
getAlgorithmName
in class Salsa20Engine
- Following copied from interface:
org.bouncycastle.crypto.StreamCipher
- Returns:
- the name of the algorithm the cipher implements.
getNonceSize
protected int getNonceSize()
- Overrides:
getNonceSize
in class Salsa20Engine
setKey
protected void setKey(byte[] keyBytes,
byte[] ivBytes)
- XSalsa20 key generation: process 256 bit input key and 128 bits of the input nonce
using a core Salsa20 function without input addition to produce 256 bit working key
and use that with the remaining 64 bits of nonce to initialize a standard Salsa20 engine state.
- Overrides:
setKey
in class Salsa20Engine