def le8

bend-collections@1.0.0.0 · src/crypto/aead/chacha20poly1305.bend:28

import bend-collections@1.0.0.0/src/crypto/aead/chacha20poly1305.bend as Chacha20poly1305
import Base

28# The eight little-endian bytes of a length.
29def le8(n: Nat, +x: Nat) -> List<&2, U32>:
30  match n:
31    case 0n: Nil{}
32    case 1n+k: U32.from_nat(Nat.mod(x, 256n)) <> le8(k, Nat.div(x, 256n))

Uses (6)

Used by (1)