def select

bend-collections@1.0.0.0 · src/crypto/curve25519/field.bend:197

import bend-collections@1.0.0.0/src/crypto/curve25519/field.bend as Field
import Base

197# s == 0: a; s == 1: b; limbwise a * (1 - s) + b * s
198def select(+s: U32, xs: List<&2, U32>, ys: List<&2, U32>) -> List<&2, U32>:
199  match xs:
200    case Nil{}:
201      Nil{}
202    case Con{x, xt}:
203      match ys:
204        case Nil{}:
205          Nil{}
206        case Con{y, yt}:
207          Con{U32.add(U32.mul(x, U32.sub(1, s)), U32.mul(y, s)), select(s, xt, yt)}

Uses (5)

Used by (6)