Package org.apache.sshd.common.cipher
Class BaseGCMCipher
java.lang.Object
org.apache.sshd.common.cipher.BaseCipher
org.apache.sshd.common.cipher.BaseGCMCipher
- All Implemented Interfaces:
AlgorithmNameProvider,Cipher,CipherInformation,KeySizeIndicator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAlgorithm parameters for AES/GCM that assumes the IV uses an 8-byte counter field as its least significant bytes.Nested classes/interfaces inherited from interface org.apache.sshd.common.cipher.Cipher
Cipher.Mode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Cipher.Modeprotected BaseGCMCipher.CounterGCMParameterSpecprotected SecretKey -
Constructor Summary
ConstructorsConstructorDescriptionBaseGCMCipher(int ivsize, int authSize, int kdfSize, String algorithm, int keySize, String transformation, int blkSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected CiphercreateCipherInstance(Cipher.Mode mode, byte[] key, byte[] iv) protected Ciphervoidupdate(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 org.apache.sshd.common.cipher.BaseCipher
getAlgorithm, getAuthenticationTagSize, getCipherBlockSize, getCipherInstance, getIVSize, getKdfSize, getKeySize, getTransformation, init, initializeIVData, initializeKeyData, resize, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.cipher.Cipher
update, updateAAD, updateWithAAD
-
Field Details
-
mode
-
initialized
protected boolean initialized -
parameters
-
secretKey
-
-
Constructor Details
-
BaseGCMCipher
-
-
Method Details
-
createCipherInstance
- Overrides:
createCipherInstancein classBaseCipher- Throws:
Exception
-
getInitializedCipherInstance
- Throws:
Exception
-
updateAAD
Description copied from interface:CipherAdds the provided input data as additional authenticated data during encryption or decryption.- Specified by:
updateAADin interfaceCipher- Overrides:
updateAADin classBaseCipher- 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.- Specified by:
updatein interfaceCipher- Overrides:
updatein classBaseCipher- 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- Throws:
Exception- If failed to execute
-