AesCcm

class AesCcm(block: AesBlockCipher, val tagLength: Int, val nonceLength: Int) : Aead(source)

AES-CCM (RFC 3610 / NIST SP 800-38C) on top of a raw AES block cipher.

Written in common code because no Apple framework and neither the stock JDK nor Android providers offer CCM, yet it is the default AEAD of OSCORE and of EDHOC cipher suites 0-3.

Parameters

tagLength

M in RFC 3610: 4, 6, 8, 10, 12, 14 or 16 bytes.

nonceLength

15 - L: 7..13 bytes (13 for AES-CCM-16-, 7 for AES-CCM-64-).

Constructors

Link copied to clipboard
constructor(block: AesBlockCipher, tagLength: Int, nonceLength: Int)

Properties

Link copied to clipboard
open override val nonceLength: Int
Link copied to clipboard
open override val tagLength: Int

Functions

Link copied to clipboard
open suspend override fun decrypt(nonce: ByteArray, ciphertext: ByteArray, associatedData: ByteArray): ByteArray
Link copied to clipboard
open suspend override fun encrypt(nonce: ByteArray, plaintext: ByteArray, associatedData: ByteArray): ByteArray