def digits
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/field.bend as Fieldimport Base
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as C
60# a constant from its little-endian base-256 digits, each scaled by the
61# symbolic one (so the checker never unfolds it): digits(one, [65n, 219n, 1n])
62# is 121665 for one == 1
63def digits(+one: Nat, ds: List<&2, Nat>) -> Nat:
64 match ds:
65 case Nil{}:
66 0n
67 case Con{d, dt}:
68 Nat.add(Nat.mul(one, d), C.shift(8n, digits(one, dt)))
Uses (5)
Used by (8)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:dconst
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519:a24
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/pcodec:r_d
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/pcodec:c65_valo
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/pcodec:c66_valo
- …