Interface Aead


public interface Aead
Authenticated encryption with associated data (AEAD)
Author:
vekterli
  • Method Summary

    Modifier and Type
    Method
    Description
    short
    Predefined AEAD ID, as given in RFC 9180 section 7.3
    static Aead
     
    short
    nK()
    The length in bytes of a key for this algorithm.
    short
    nN()
    The length in bytes of a nonce for this algorithm.
    short
    nT()
    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 encryption
      nonce - Nonce to use for the encryption
      aad - Associated authenticated data that will not be encrypted
      pt - Plaintext to seal
      Returns:
      resulting ciphertext
    • open

      byte[] open(byte[] key, byte[] nonce, byte[] aad, byte[] ct)
      Parameters:
      key - Symmetric key bytes for decryption
      nonce - Nonce to use for the decryption
      aad - Associated authenticated data to verify
      ct - 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

      static Aead aes128Gcm()