def kbkdf_counter

bend-osdev-crypto@0.1.0.0 · check.bend:388

import bend-osdev-crypto@0.1.0.0/check.bend as Check
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-crypto@0.1.0.0/inst_kbkdf.bend as KbI

388# SP 800-108 over HMAC-SHA-256: counter mode (cryptography's KBKDFHMAC
389# gives the value), feedback mode (ref/gen.py's SP 800-108), and an output
390# too long for a one-byte counter refused
391def kbkdf_counter(n: Nat) -> String:
392  show(KbI.CrKbkdf.hmac_sha256_counter(B.Octets.of_string("secret key bytes"), B.Octets.of_string("label"), B.Octets.of_string("context"), n))

Uses (5)

Used by (1)