Class InsecureNonceAesGcmJce
- java.lang.Object
-
- com.google.crypto.tink.aead.internal.InsecureNonceAesGcmJce
-
public final class InsecureNonceAesGcmJce extends java.lang.ObjectInsecure version ofAesGcmJcethat allows the caller to set the IV.
-
-
Field Summary
Fields Modifier and Type Field Description static TinkFipsUtil.AlgorithmFipsCompatibilityFIPSstatic intIV_SIZE_IN_BYTESstatic intTAG_SIZE_IN_BYTES
-
Constructor Summary
Constructors Constructor Description InsecureNonceAesGcmJce(byte[] key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] iv, byte[] ciphertext, byte[] associatedData)DecryptsciphertextwithivandassociatedData.byte[]decrypt(byte[] iv, byte[] ciphertextWithPrefix, int ciphertextOffset, byte[] associatedData)DecryptsciphertextWithPrefixwithivandassociatedData.byte[]encrypt(byte[] iv, byte[] plaintext, byte[] associatedData)EncryptsplaintextwithivandassociatedData.byte[]encrypt(byte[] iv, byte[] plaintext, int ciphertextOffset, byte[] associatedData)EncryptsplaintextwithivandassociatedData.
-
-
-
Field Detail
-
FIPS
public static final TinkFipsUtil.AlgorithmFipsCompatibility FIPS
-
IV_SIZE_IN_BYTES
public static final int IV_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
TAG_SIZE_IN_BYTES
public static final int TAG_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
encrypt
public byte[] encrypt(byte[] iv, byte[] plaintext, byte[] associatedData) throws java.security.GeneralSecurityExceptionEncryptsplaintextwithivandassociatedData.- Throws:
java.security.GeneralSecurityException
-
encrypt
public byte[] encrypt(byte[] iv, byte[] plaintext, int ciphertextOffset, byte[] associatedData) throws java.security.GeneralSecurityExceptionEncryptsplaintextwithivandassociatedData.The
ciphertextOffsetis the offset at which the ciphertext should start in the returned byte array.- Throws:
java.security.GeneralSecurityException
-
decrypt
public byte[] decrypt(byte[] iv, byte[] ciphertext, byte[] associatedData) throws java.security.GeneralSecurityExceptionDecryptsciphertextwithivandassociatedData.- Throws:
java.security.GeneralSecurityException
-
decrypt
public byte[] decrypt(byte[] iv, byte[] ciphertextWithPrefix, int ciphertextOffset, byte[] associatedData) throws java.security.GeneralSecurityExceptionDecryptsciphertextWithPrefixwithivandassociatedData.The
ciphertextOffsetis the offset at which the ciphertext starts withinciphertextWithPrefix.- Throws:
java.security.GeneralSecurityException
-
-