Class ChaCha20Cipher
java.lang.Object
org.apache.sshd.common.cipher.AbstractChaCha20Cipher
org.apache.sshd.common.cipher.ChaCha20Cipher
- All Implemented Interfaces:
AlgorithmNameProvider, Cipher, CipherInformation, KeySizeIndicator
AEAD cipher based on the
OpenSSH
ChaCha20-Poly1305 cipher extension.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Cipher
Cipher.Mode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChaCha20Cipher.ChaChaEngineprotected final ChaCha20Cipher.ChaChaEngineprotected final Macprotected Cipher.ModeFields inherited from class AbstractChaCha20Cipher
BLOCK_BYTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(Cipher.Mode mode, byte[] key, byte[] iv) Initialize the cipher for encryption or decryption with the given key and initialization vectorvoidupdate(byte[] input, int inputOffset, int inputLen) Performs in-place encryption or decryption on the given data.voidupdateAAD(byte[] data, int offset, int length) Adds the provided input data as additional authenticated data during encryption or decryption.Methods inherited from class AbstractChaCha20Cipher
getAlgorithm, getAuthenticationTagSize, getCipherBlockSize, getIVSize, getKdfSize, getKeySize, getTransformation, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Cipher
update, updateAAD, updateWithAAD
-
Field Details
-
headerEngine
-
bodyEngine
-
mac
-
mode
-
-
Constructor Details
-
ChaCha20Cipher
public ChaCha20Cipher()
-
-
Method Details
-
init
-
updateAAD
Description copied from interface:CipherAdds the provided input data as additional authenticated data during encryption or decryption.- Parameters:
data- The additional data to authenticateoffset- The offset of the additional data in the bufferlength- The number of bytes in the buffer to use for authentication- Throws:
Exception- If failed to execute
-
update
Description copied from interface:CipherPerforms in-place encryption or decryption on the given data.- Parameters:
input- The input/output bytesinputOffset- The offset of the data in the data bufferinputLen- The number of bytes to update, starting at the given offset; must be a multiple of the cipher's block size- Throws:
Exception- If failed to execute
-