This mode currently should only be used w/ AES cipher. Although no checking is done, caller should only pass AES Cipher to the constructor.
Note
Unlike other modes, when used for decryption, this class will buffer all processed outputs internally and won't return them until the tag has been successfully verified.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| public static class | |
| public static class | |
| pack-priv static class | GaloisCounterMode.
This class is for decryption when both GCTR and GHASH can operation in parallel. |
| pack-priv static class | GaloisCounterMode.
This class is for encryption when both GCTR and GHASH can operation in parallel. |
| pack-priv class | GaloisCounterMode.
Decryption Engine object |
| pack-priv class | GaloisCounterMode.
Encryption Engine object |
| pack-priv abstract class | GaloisCounterMode.
Abstract class for GCMEncrypt and GCMDecrypt internal context objects |
| public static interface | GaloisCounterMode.
Interface to organize encryption and decryption operations in the proper order for GHASH and GCTR. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final SymmetricCipher | |
| private static final int | |
| private static final int | |
| pack-priv static final byte[] | |
| private boolean | |
| private GaloisCounterMode. | |
| private boolean | |
| pack-priv byte[] | |
| private final int | |
| pack-priv byte[] | |
| pack-priv byte[] | |
| private static final int | |
| private static final JavaNioAccess | |
| private static final int | |
| pack-priv SecureRandom | |
| pack-priv boolean | |
| private static final int | |
| pack-priv int | |
| private static final int | |
| private static final VarHandle |
| Access | Constructor and Description |
|---|---|
| pack-priv | GaloisCounterMode(int
length of key. keySize, SymmetricCipher Cipher object, such as AES_Crypt. embeddedCipher)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| private static byte[] | Returns: a 16-byte array containing the random nonce.a rand)SecureRandom object. If null is
provided a new SecureRandom object will be instantiated.Create a random 16-byte iv. |
| protected byte[] | engineDoFinal(byte[] input, int inputOffset, int inputLen)
Implements abstract javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
Implements abstract javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | engineDoFinal(ByteBuffer src, ByteBuffer dst)
Overrides javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | engineGetBlockSize()
Implements abstract javax. Returns the block size (in bytes). |
| protected byte[] | engineGetIV()
Implements abstract javax. Returns the initialization vector (IV) in a new buffer. |
| protected int | engineGetKeySize(Key key)
Overrides javax. Returns the key size of the given key object in bits. |
| protected int | engineGetOutputSize(int inputLen)
Implements abstract javax. Returns the length in bytes that an output buffer would
need to be in order to hold the result of the next |
| protected AlgorithmParameters | engineGetParameters()
Implements abstract javax. Returns the parameters used with this cipher. |
| protected void | engineInit(int opmode, Key key, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineSetMode(String mode)
Implements abstract javax. Sets the mode of this cipher. |
| protected void | engineSetPadding(String padding)
Implements abstract javax. Sets the padding mechanism of this cipher. |
| protected Key | engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
Overrides javax. Unwrap a previously wrapped key. |
| protected byte[] | engineUpdate(byte[] input, int inputOffset, int inputLen)
Implements abstract javax. Continues a multiple-part encryption or decryption operation
(depending on how this |
| protected int | engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
Implements abstract javax. Continues a multiple-part encryption or decryption operation
(depending on how this |
| protected int | engineUpdate(ByteBuffer src, ByteBuffer dst)
Overrides javax. Continues a multiple-part encryption or decryption operation
(depending on how this |
| protected void | engineUpdateAAD(byte[] src, int offset, int len)
Overrides javax. Continues a multipart update of the Additional Authentication Data (AAD), using a subset of the provided buffer. |
| protected void | engineUpdateAAD(ByteBuffer src)
Overrides javax. Continues a multipart update of the Additional Authentication Data (AAD). |
| protected byte[] | |
| private static byte[] | |
| private static byte[] | |
| private static byte[] | |
| private static byte[] | |
| private static int | implGCMCrypt(byte[] in, int inOfs, int inLen, byte[] ct, int ctOfs, byte[] out, int outOfs, GCTR gctr, GHASH ghash)
Wrapper function around Combined AES-GCM intrinsic method that splits large chunks of data into 1MB sized chunks. |
| private static int | Returns: number of processed bytesinput buffer in, int input offset inOfs, int input length inLen, byte[] buffer that ghash will read (in for encrypt, out for decrypt) ct, int offset for ct buffer ctOfs, byte[] output buffer out, int output offset outOfs, GCTR object for the GCTR operation gctr, GHASH object for the GHASH operation ghash)Intrinsic for the combined AES Galois Counter Mode implementation. |
| pack-priv static void | |
| pack-priv void | init(int opmode, Key key, GCMParameterSpec spec)
Initializes the cipher in the specified mode with the given key and iv. |