def ccm.checks.nonce

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

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

113def ccm.checks.nonce(ok: Bool, +nl: Nat, +n: Nat) -> Result<&2, &2, M.CmError, Unit>:
114  match ok:
115    case True{}:
116      ccm.checks.len(ccm.len_ok(Nat.sub(15n, nl), n), n)
117    case False{}:
118      Fail{M.CmBadNonceLength{nl}}

Uses (8)

Used by (1)