| Modifier and Type | Field and Description |
|---|---|
| private byte[] | aad
Additional authenticated data. |
| pack-priv byte[] | buf
The byte array containing the bytes written. |
| pack-priv int | bufCount
The number of bytes written. |
| pack-priv static final int | DEFAULT_TAG_SIZE_BITS
The default tag size when one is not specified. |
| private static final boolean | ENABLE_BYTEBUFFER_OPTIMIZATIONS
Controls whether no-copy optimizations for direct ByteBuffers are enabled. |
| pack-priv long | evpAead
AEAD cipher reference. |
| private static int | lastGlobalMessageSize
Keeps track of the last used block size. |
| private boolean | mustInitialize
When set this instance must be initialized before use again. |
| private byte[] | previousIv
The previously used nonce (IV) to prevent key + nonce reuse. |
| private byte[] | previousKey
The previously used key to prevent key + nonce (IV) reuse. |
| pack-priv int | tagLengthInBytes
The length of the AEAD cipher tag in bytes. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | allowsNonceReuse()
Returns whether reusing nonces is allowed (aka, whether this is nonce misuse-resistant). |
| private boolean | |
| private void | |
| pack-priv void | checkSupportedPadding(OpenSSLCipher.
Implements abstract org. padding
and throws NoSuchPaddingException if it doesn't.
|
| pack-priv void | |
| pack-priv int | |
| pack-priv int | doFinalInternal(byte[] output, int outputOffset, int maximumLen)
Implements abstract org. |
| protected int | engineDoFinal(ByteBuffer
the input ByteBuffer input, ByteBuffer the output ByteBuffer output)Overrides javax. |
| protected int | engineDoFinal(byte[]
the input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen, byte[] the buffer for the result output, int the offset in outputOffset)output where the result
is storedOverrides org. |
| pack-priv void | engineInitInternal(byte[] encodedKey, AlgorithmParameterSpec params, SecureRandom random)
Implements abstract org. |
| protected void | engineUpdateAAD(byte[]
the buffer containing the AAD input, int the offset in inputOffset, int src where the AAD input startsthe number of AAD bytes inputLen)Overrides javax. |
| protected void | engineUpdateAAD(ByteBuffer
the buffer containing the AAD buf)Overrides javax. |
| private void | |
| pack-priv abstract long | |
| pack-priv int | getOutputSizeForFinal(int inputLen)
Implements abstract org. doFinal() is called with this
inputLen.
|
| pack-priv int | getOutputSizeForUpdate(int inputLen)
Implements abstract org. |
| private void | |
| private void | |
| pack-priv int | updateInternal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset, int maximumLen)
Implements abstract org. |
| aad | back to summary |
|---|---|
| private byte[] aad Additional authenticated data. | |
| buf | back to summary |
|---|---|
| pack-priv byte[] buf The byte array containing the bytes written. | |
| bufCount | back to summary |
|---|---|
| pack-priv int bufCount The number of bytes written. | |
| DEFAULT_TAG_SIZE_BITS | back to summary |
|---|---|
| pack-priv static final int DEFAULT_TAG_SIZE_BITS The default tag size when one is not specified. Default to full-length tags (128-bits or 16 octets). | |
| ENABLE_BYTEBUFFER_OPTIMIZATIONS | back to summary |
|---|---|
| private static final boolean ENABLE_BYTEBUFFER_OPTIMIZATIONS Controls whether no-copy optimizations for direct ByteBuffers are enabled. | |
| evpAead | back to summary |
|---|---|
| pack-priv long evpAead AEAD cipher reference. | |
| lastGlobalMessageSize | back to summary |
|---|---|
| private static int lastGlobalMessageSize Keeps track of the last used block size. | |
| mustInitialize | back to summary |
|---|---|
| private boolean mustInitialize When set this instance must be initialized before use again. This prevents key and IV reuse. | |
| previousIv | back to summary |
|---|---|
| private byte[] previousIv The previously used nonce (IV) to prevent key + nonce reuse. | |
| previousKey | back to summary |
|---|---|
| private byte[] previousKey The previously used key to prevent key + nonce (IV) reuse. | |
| tagLengthInBytes | back to summary |
|---|---|
| pack-priv int tagLengthInBytes The length of the AEAD cipher tag in bytes. | |
| OpenSSLAeadCipher | back to summary |
|---|---|
| public OpenSSLAeadCipher(OpenSSLCipher. | |
| allowsNonceReuse | back to summary |
|---|---|
| pack-priv boolean allowsNonceReuse() Returns whether reusing nonces is allowed (aka, whether this is nonce misuse-resistant). Most AEAD ciphers are not, but some are specially constructed so that reusing a key/nonce pair is safe. | |
| arraysAreEqual | back to summary |
|---|---|
| private boolean arraysAreEqual(byte[] a, byte[] b) Constant-time array comparison. Since we are using this to compare keys, we want to ensure there's no opportunity for a timing attack. | |
| checkInitialization | back to summary |
|---|---|
| private void checkInitialization() | |
| checkSupportedPadding | back to summary |
|---|---|
| pack-priv void checkSupportedPadding(OpenSSLCipher. Implements abstract org. Doc from org. Checks whether the cipher supports this particular cipher
| |
| checkSupportedTagLength | back to summary |
|---|---|
| pack-priv void checkSupportedTagLength(int tagLenBits) throws InvalidAlgorithmParameterException | |
| doFinalInternal | back to summary |
|---|---|
| pack-priv int doFinalInternal(ByteBuffer input, ByteBuffer output) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException | |
| doFinalInternal | back to summary |
|---|---|
| pack-priv int doFinalInternal(byte[] output, int outputOffset, int maximumLen) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Implements abstract org. Doc from org. API-specific implementation of the final block. The
| |
| engineDoFinal | back to summary |
|---|---|
| protected int engineDoFinal(ByteBuffer input, ByteBuffer output) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Overrides javax. Doc from javax. Encrypts or decrypts data in a single-part operation,
or finishes a multiple-part operation.
The data is encrypted or decrypted, depending on how this
All If Upon finishing, this method resets this Note if any exception is thrown, this Subclasses should consider overriding this method if they can process ByteBuffers more efficiently than byte arrays.
| |
| engineDoFinal | back to summary |
|---|---|
| protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Overrides org. Doc from javax. Encrypts or decrypts data in a single-part operation,
or finishes a multiple-part operation.
The data is encrypted or decrypted, depending on how this
The first If the Upon finishing, this method resets this Note if any exception is thrown, this
| |
| engineInitInternal | back to summary |
|---|---|
| pack-priv void engineInitInternal(byte[] encodedKey, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract org. Doc from org. API-specific implementation of initializing the cipher. The
| |
| engineUpdateAAD | back to summary |
|---|---|
| protected void engineUpdateAAD(byte[] input, int inputOffset, int inputLen) Overrides javax. Doc from javax. Continues a multipart update of the Additional Authentication Data (AAD), using a subset of the provided buffer.
Calls to this method provide AAD to the cipher when operating in
modes such as AEAD (GCM or CCM). If this cipher is operating in
either GCM or CCM mode, all AAD must be supplied before beginning
operations on the ciphertext (via the
| |
| engineUpdateAAD | back to summary |
|---|---|
| protected void engineUpdateAAD(ByteBuffer buf) Overrides javax. Doc from javax. Continues a multipart update of the Additional Authentication Data (AAD).
Calls to this method provide AAD to the cipher when operating in
modes such as AEAD (GCM or CCM). If this cipher is operating in
either GCM or CCM mode, all AAD must be supplied before beginning
operations on the ciphertext (via the
All
| |
| expand | back to summary |
|---|---|
| private void expand(int i) | |
| getEVP_AEAD | back to summary |
|---|---|
| pack-priv abstract long getEVP_AEAD(int keyLength) throws InvalidKeyException | |
| getOutputSizeForFinal | back to summary |
|---|---|
| pack-priv int getOutputSizeForFinal(int inputLen) Implements abstract org. Doc from org. The size of output if
| |
| getOutputSizeForUpdate | back to summary |
|---|---|
| pack-priv int getOutputSizeForUpdate(int inputLen) Implements abstract org. AEAD buffers everything until a final output.
| |
| reset | back to summary |
|---|---|
| private void reset() | |
| throwAEADBadTagExceptionIfAvailable | back to summary |
|---|---|
private void throwAEADBadTagExceptionIfAvailable(String message, Throwable cause) throws BadPaddingException
| |
| updateInternal | back to summary |
|---|---|
| pack-priv int updateInternal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset, int maximumLen) throws ShortBufferException Implements abstract org. Doc from org. API-specific implementation of updating the cipher. The
| |