def decode

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/ed25519.bend:171

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519.bend as Ed25519
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/field.bend as FS
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519.bend as SX

171# bit 255 is x_0; the rest is y, rejected when y >= p
172def decode(+p: Nat, +d: Nat, +bs: List<&2, U32>) -> Maybe<&2, EPt>:
173  +y = FS.value(SX.mask_last(bs))
174  dec_y(p, d, y, SX.kbit(FS.value(bs), 255n), Bool.not(Nat.is_lt(y, p)))

Uses (11)

Used by (5)