Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AEAD

Authenticated Encryption with Associated Data.

Hierarchy

  • AEAD

Index

Properties

Methods

Properties

nonceLength

nonceLength: number

Byte length of nonce that is used with this AEAD.

tagLength

tagLength: number

Byte length of authentication tag in the sealed ciphertext. Result of seal() will be longer than plaintext for this number of bytes.

Methods

clean

  • clean(): this
  • Wipes state from memory. This doesn't wipe the underlying block cipher state.

    Returns this

open

  • open(nonce: Uint8Array, ciphertext: Uint8Array, associatedData?: Uint8Array, dst?: Uint8Array): Uint8Array | null
  • Authenticates ciphertext (which includes authentication tag) and associated data, decrypts ciphertext and returns decrypted plaintext.

    If authentication fails, it returns null.

    If dst is given (it must be of ciphertext length minus tag length), the result will be put into it. Dst and plaintext must not overlap.

    Parameters

    • nonce: Uint8Array
    • ciphertext: Uint8Array
    • Optional associatedData: Uint8Array
    • Optional dst: Uint8Array

    Returns Uint8Array | null

seal

  • seal(nonce: Uint8Array, plaintext: Uint8Array, associatedData?: Uint8Array, dst?: Uint8Array): Uint8Array
  • Encrypts and authenticates plaintext, authenticates associated data, and returns ciphertext, which includes authentication tag.

    If dst is given (it must be the size of plaintext + the size of tag length) the result will be put into it. Dst and plaintext must not overlap.

    Parameters

    • nonce: Uint8Array
    • plaintext: Uint8Array
    • Optional associatedData: Uint8Array
    • Optional dst: Uint8Array

    Returns Uint8Array

Generated using TypeDoc