def set_msb

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

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519.bend as Ed25519
import Base

108# the most significant bit of the final octet set to b
109def set_msb(xs: List<&2, U32>, +b: U32) -> List<&2, U32>:
110  match xs:
111    case Nil{}:
112      Nil{}
113    case Con{x, xt}:
114      match xt:
115        case Nil{}:
116          Con{U32.or(x, U32.shln(b, 7n)), Nil{}}
117        case Con{y, yt}:
118          Con{x, set_msb(Con{y, yt}, b)}

Uses (4)

Used by (3)