def CrVmac.tag

bend-osdev-crypto@0.1.0.0 · vmac.bend:444

import bend-osdev-crypto@0.1.0.0/vmac.bend as Vmac
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr

444# The tag of m under a nonce of 1 to bsize - 1 bytes (CrBadNonceLength
445# otherwise): 8 bytes for a VMAC-64 key, 16 for a VMAC-128 key
446def CrVmac.tag(~K: Data, ~Blk: Data, ~bsize: Nat, ~enc: K -> Blk -> Blk, ~blk_of: B.Octets -> Maybe<&2, Blk>, ~blk_to: Blk -> B.Octets, kk: CrVmacKey<K>, +nonce: B.Octets, m: B.Octets) -> Result<&2, &2, Cr.CrError, B.Octets>:
447  +n = B.Octets.len(nonce)
448  cr.vm.tag.pick(~K, ~Blk, ~bsize, ~enc, ~blk_of, ~blk_to, Bool.and(Nat.is_lt(0n, n), Nat.is_lt(n, bsize)), kk, nonce, m)

Uses (10)

Used by (2)