public class BaseGCMCipher extends BaseCipher
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BaseGCMCipher.CounterGCMParameterSpec
Algorithm parameters for AES/GCM that assumes the IV uses an 8-byte counter field as its least significant bytes.
|
Cipher.Mode| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized |
protected Cipher.Mode |
mode |
protected BaseGCMCipher.CounterGCMParameterSpec |
parameters |
protected javax.crypto.SecretKey |
secretKey |
| Constructor and Description |
|---|
BaseGCMCipher(int ivsize,
int authSize,
int kdfSize,
java.lang.String algorithm,
int keySize,
java.lang.String transformation,
int blkSize) |
| Modifier and Type | Method and Description |
|---|---|
protected javax.crypto.Cipher |
createCipherInstance(Cipher.Mode mode,
byte[] key,
byte[] iv) |
protected javax.crypto.Cipher |
getInitializedCipherInstance() |
void |
update(byte[] input,
int inputOffset,
int inputLen)
Performs in-place encryption or decryption on the given data.
|
void |
updateAAD(byte[] data,
int offset,
int length)
Adds the provided input data as additional authenticated data during encryption or decryption.
|
getAlgorithm, getAuthenticationTagSize, getCipherBlockSize, getCipherInstance, getIVSize, getKdfSize, getKeySize, getTransformation, init, initializeIVData, initializeKeyData, resize, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckSupported, update, updateAAD, updateWithAADprotected Cipher.Mode mode
protected boolean initialized
protected BaseGCMCipher.CounterGCMParameterSpec parameters
protected javax.crypto.SecretKey secretKey
public BaseGCMCipher(int ivsize,
int authSize,
int kdfSize,
java.lang.String algorithm,
int keySize,
java.lang.String transformation,
int blkSize)
protected javax.crypto.Cipher createCipherInstance(Cipher.Mode mode, byte[] key, byte[] iv) throws java.lang.Exception
createCipherInstance in class BaseCipherjava.lang.Exceptionprotected javax.crypto.Cipher getInitializedCipherInstance()
throws java.lang.Exception
java.lang.Exceptionpublic void updateAAD(byte[] data,
int offset,
int length)
throws java.lang.Exception
CipherupdateAAD in interface CipherupdateAAD in class BaseCipherdata - The additional data to authenticateoffset - The offset of the additional data in the bufferlength - The number of bytes in the buffer to use for authenticationjava.lang.Exception - If failed to executepublic void update(byte[] input,
int inputOffset,
int inputLen)
throws java.lang.Exception
Cipherupdate in interface Cipherupdate in class BaseCipherinput - The input/output bytesinputOffset - The offset of the data in the data bufferinputLen - The number of bytes to update - starting at the given offsetjava.lang.Exception - If failed to execute