Package org.apache.sshd.common.cipher
Class BaseCTRCipher
- java.lang.Object
-
- org.apache.sshd.common.cipher.BaseCipher
-
- org.apache.sshd.common.cipher.BaseCTRCipher
-
- All Implemented Interfaces:
AlgorithmNameProvider
,Cipher
,CipherInformation
,KeySizeIndicator
public class BaseCTRCipher extends BaseCipher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.sshd.common.cipher.BaseCipher
BaseCipher.CipherFactory
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.cipher.Cipher
Cipher.Mode
-
-
Field Summary
Fields Modifier and Type Field Description private long
blocksProcessed
-
Fields inherited from class org.apache.sshd.common.cipher.BaseCipher
alwaysReInit, factory, mode
-
-
Constructor Summary
Constructors Constructor Description BaseCTRCipher(int ivsize, int authSize, int kdfSize, java.lang.String algorithm, int keySize, java.lang.String transformation, int blkSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addCarry(byte[] iv, int length, int carry)
protected java.security.spec.AlgorithmParameterSpec
determineNewParameters(byte[] processed, int offset, int length)
protected void
reInit(byte[] processed, int offset, int length)
void
update(byte[] input, int inputOffset, int inputLen)
Performs in-place encryption or decryption on the given data.-
Methods inherited from class org.apache.sshd.common.cipher.BaseCipher
createCipherInstance, getAlgorithm, getAuthenticationTagSize, getCipherBlockSize, getCipherInstance, getIVSize, getKdfSize, getKeySize, getTransformation, init, initializeIVData, initializeKeyData, resize, toString, updateAAD
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.cipher.Cipher
update, updateAAD, updateWithAAD
-
-
-
-
Method Detail
-
update
public void update(byte[] input, int inputOffset, int inputLen) throws java.lang.Exception
Description copied from interface:Cipher
Performs in-place encryption or decryption on the given data.- Specified by:
update
in interfaceCipher
- Overrides:
update
in 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; must be a multiple of the cipher's block size- Throws:
java.lang.Exception
- If failed to execute
-
reInit
protected void reInit(byte[] processed, int offset, int length) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
- Overrides:
reInit
in classBaseCipher
- Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
-
determineNewParameters
protected java.security.spec.AlgorithmParameterSpec determineNewParameters(byte[] processed, int offset, int length)
- Overrides:
determineNewParameters
in classBaseCipher
-
addCarry
private void addCarry(byte[] iv, int length, int carry)
-
-