def clamp

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/curve25519/x25519.bend:30

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519.bend as X25519
import Base

30def clamp(bs: List<&2, U32>) -> List<&2, U32>:
31  match bs:
32    case Nil{}:
33      Nil{}
34    case Con{b, bt}:
35      clamp_last(Con{U32.and(b, 248), bt})

Uses (4)

Used by (5)