org.bouncycastle.crypto.engines
Class XChaCha20Engine
java.lang.Object
org.bouncycastle.crypto.engines.Salsa20Engine
org.bouncycastle.crypto.engines.ChaCha7539Engine
org.bouncycastle.crypto.engines.XChaCha20Engine
- All Implemented Interfaces:
- SkippingCipher, SkippingStreamCipher, StreamCipher
- public class XChaCha20Engine
- extends ChaCha7539Engine
Implementation of the XChaCha20 stream cipher (extended-nonce ChaCha20)
as described in draft-irtf-cfrg-xchacha-03.
XChaCha20 takes a 256 bit key and a 192 bit nonce. The first 128 bits of
the nonce are used together with the key in HChaCha20 to derive a 256 bit
subkey; that subkey, together with the remaining 64 bits of the nonce
(prefixed by four zero bytes to form a 96 bit IETF nonce), then drives a
standard ChaCha20-IETF stream as defined by RFC 7539.
|
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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XChaCha20Engine
public XChaCha20Engine()
getAlgorithmName
public java.lang.String getAlgorithmName()
- Description copied from interface:
StreamCipher
- Return the name of the algorithm the cipher implements.
- Specified by:
getAlgorithmName in interface StreamCipher- Overrides:
getAlgorithmName in class ChaCha7539Engine
getNonceSize
protected int getNonceSize()
- Overrides:
getNonceSize in class ChaCha7539Engine
setKey
protected void setKey(byte[] keyBytes,
byte[] ivBytes)
- Overrides:
setKey in class ChaCha7539Engine