def mask_last
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519.bend as X25519import Base
40# decodeUCoordinate: the last byte's top bit masked (bits = 255)
41def mask_last(xs: List<&2, U32>) -> List<&2, U32>:
42 match xs:
43 case Nil{}:
44 Nil{}
45 case Con{x, xt}:
46 match xt:
47 case Nil{}:
48 Con{U32.and(x, 127), Nil{}}
49 case Con{y, yt}:
50 Con{x, mask_last(Con{y, yt})}
Uses (3)
Used by (5)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:decode
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519:decode_u
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/xbits:mask_eq
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/pdec:decode_rel
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/ladder:x25519_rel