def subl

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

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

156# a + k - b limbwise
157def subl(xs: List<&2, U32>, ys: List<&2, U32>, ks: List<&2, U32>) -> List<&2, U32>:
158  match xs:
159    case Nil{}:
160      Nil{}
161    case Con{x, xt}:
162      match ys:
163        case Nil{}:
164          Nil{}
165        case Con{y, yt}:
166          match ks:
167            case Nil{}:
168              Nil{}
169            case Con{k, kt}:
170              Con{U32.sub(U32.add(x, k), y), subl(xt, yt, kt)}

Uses (4)

Used by (6)