Package com.yahoo.security.hpke
Interface Aead
public interface Aead
Authenticated encryption with associated data (AEAD)
- Author:
- vekterli
-
Method Summary
Modifier and TypeMethodDescriptionshortaeadId()Predefined AEAD ID, as given in RFC 9180 section 7.3static AeadshortnK()The length in bytes of a key for this algorithm.shortnN()The length in bytes of a nonce for this algorithm.shortnT()The length in bytes of the authentication tag for this algorithm.byte[]open(byte[] key, byte[] nonce, byte[] aad, byte[] ct) byte[]seal(byte[] key, byte[] nonce, byte[] aad, byte[] pt)
-
Method Details
-
seal
byte[] seal(byte[] key, byte[] nonce, byte[] aad, byte[] pt) - Parameters:
key- Symmetric key bytes for encryptionnonce- Nonce to use for the encryptionaad- Associated authenticated data that will not be encryptedpt- Plaintext to seal- Returns:
- resulting ciphertext
-
open
byte[] open(byte[] key, byte[] nonce, byte[] aad, byte[] ct) - Parameters:
key- Symmetric key bytes for decryptionnonce- Nonce to use for the decryptionaad- Associated authenticated data to verifyct- ciphertext to decrypt- Returns:
- resulting plaintext
-
nK
short nK()The length in bytes of a key for this algorithm. -
nN
short nN()The length in bytes of a nonce for this algorithm. -
nT
short nT()The length in bytes of the authentication tag for this algorithm. -
aeadId
short aeadId()Predefined AEAD ID, as given in RFC 9180 section 7.3 -
aes128Gcm
-