public class AEAD
extends java.lang.Object
HPKEContext.seal(byte[], byte[])/HPKEContext.open(byte[], byte[]).
Holds the key and base nonce derived during context setup and applies the
RFC 9180 §5.2 nonce-XOR-counter construction per call. Supports the four
AEAD suite IDs registered by RFC 9180 (AES-128-GCM, AES-256-GCM,
ChaCha20-Poly1305, and the export-only sentinel 0xFFFF).
Typical callers don't construct AEAD directly — obtain a context
via HPKE.setupBaseS(org.bouncycastle.crypto.params.AsymmetricKeyParameter, byte[])/etc. and use the seal/open methods on the
returned HPKEContext.
| Constructor and Description |
|---|
AEAD(short aeadId,
byte[] key,
byte[] baseNonce) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
open(byte[] aad,
byte[] ct) |
byte[] |
open(byte[] aad,
byte[] ct,
int ctOffset,
int ctLength) |
byte[] |
seal(byte[] aad,
byte[] pt) |
byte[] |
seal(byte[] aad,
byte[] pt,
int ptOffset,
int ptLength) |
public byte[] seal(byte[] aad,
byte[] pt)
throws InvalidCipherTextException
InvalidCipherTextExceptionpublic byte[] seal(byte[] aad,
byte[] pt,
int ptOffset,
int ptLength)
throws InvalidCipherTextException
InvalidCipherTextExceptionpublic byte[] open(byte[] aad,
byte[] ct)
throws InvalidCipherTextException
InvalidCipherTextExceptionpublic byte[] open(byte[] aad,
byte[] ct,
int ctOffset,
int ctLength)
throws InvalidCipherTextException
InvalidCipherTextException