def kbkdf_counter
import bend-osdev-crypto@0.1.0.0/check.bend as Checkimport 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))