Package com.google.crypto.tink.subtle
Class AesSiv
- java.lang.Object
-
- com.google.crypto.tink.subtle.AesSiv
-
- All Implemented Interfaces:
DeterministicAead
public final class AesSiv extends java.lang.Object implements DeterministicAead
AES-SIV, as described in RFC 5297.Each AES-SIV key consists of two sub keys. To meet the security requirements of
DeterministicAead, each sub key must be 256 bits. The total size of ASE-SIV keys is then 512 bits.- Since:
- 1.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static TinkFipsUtil.AlgorithmFipsCompatibilityFIPS
-
Constructor Summary
Constructors Constructor Description AesSiv(byte[] key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DeterministicAeadcreate(AesSivKey key)byte[]decryptDeterministically(byte[] ciphertext, byte[] associatedData)Deterministically decryptsciphertextwithassociatedDataas associated authenticated data.byte[]encryptDeterministically(byte[] plaintext, byte[] associatedData)Deterministically encryptsplaintextwithassociatedDataas associated authenticated data.
-
-
-
Field Detail
-
FIPS
public static final TinkFipsUtil.AlgorithmFipsCompatibility FIPS
-
-
Method Detail
-
create
public static DeterministicAead create(AesSivKey key) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
encryptDeterministically
public byte[] encryptDeterministically(byte[] plaintext, byte[] associatedData) throws java.security.GeneralSecurityExceptionDescription copied from interface:DeterministicAeadDeterministically encryptsplaintextwithassociatedDataas associated authenticated data.Warning
Encrypting the same
plaintextmultiple times protects the integrity of that plaintext, but confidentiality is compromised to the extent that an attacker can determine that the same plaintext was encrypted.The resulting ciphertext allows for checking authenticity and integrity of associated data (
associatedData), but does not guarantee its secrecy.- Specified by:
encryptDeterministicallyin interfaceDeterministicAead- Returns:
- resulting ciphertext
- Throws:
java.security.GeneralSecurityException
-
decryptDeterministically
public byte[] decryptDeterministically(byte[] ciphertext, byte[] associatedData) throws java.security.GeneralSecurityExceptionDescription copied from interface:DeterministicAeadDeterministically decryptsciphertextwithassociatedDataas associated authenticated data.The decryption verifies the authenticity and integrity of the associated data, but there are no guarantees wrt. secrecy of that data.
- Specified by:
decryptDeterministicallyin interfaceDeterministicAead- Returns:
- resulting plaintext
- Throws:
java.security.GeneralSecurityException
-
-