def ccm.checks.tag

bend-osdev-cipher-modes@0.1.0.0 · ccm.bend:120

import bend-osdev-cipher-modes@0.1.0.0/ccm.bend as Ccm
import Base
import bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend as M

120def ccm.checks.tag(ok: Bool, +m: Nat, +nl: Nat, +n: Nat) -> Result<&2, &2, M.CmError, Unit>:
121  match ok:
122    case True{}:
123      ccm.checks.nonce(Bool.and(Nat.is_le(7n, nl), Nat.is_le(nl, 13n)), nl, n)
124    case False{}:
125      Fail{M.CmBadTagLength{m}}

Uses (8)

Used by (2)