def le8

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/chacha20poly1305.bend:23

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305.bend as Chacha20poly1305
import Base

23# num_to_8_le_bytes
24def le8(n: Nat, +x: Nat) -> List<&2, U32>:
25  match n:
26    case 0n: Nil{}
27    case 1n+k: U32.from_nat(Nat.mod(x, 256n)) <> le8(k, Nat.div(x, 256n))

Uses (6)

Used by (1)