def set_top
import bend-collections-laws-crypto@1.0.0.0/src/crypto/ed25519/point.bend as Pointimport Base
113# the last byte with bit 7 set to b (the canonical y has it clear)
114def set_top(xs: List<&2, U32>, +b: U32) -> List<&2, U32>:
115 match xs:
116 case Nil{}:
117 Nil{}
118 case Con{x, xt}:
119 match xt:
120 case Nil{}:
121 Con{U32.or(x, U32.shln(b, 7n)), Nil{}}
122 case Con{y, yt}:
123 Con{x, set_top(Con{y, yt}, b)}