def horner

bend-collections@1.0.0.0 · src/crypto/secp256k1/limbs.bend:90

import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as Limbs
import Base

90# the value of the limbs (only ever of an empty list at run time: see carry)
91def horner(xs: List<&2, Nat>) -> Nat:
92  match xs:
93    case Nil{}: 0n
94    case x <> t: Nat.add(Nat.mul(Nat.mul(horner(t), 256n), 256n), x)

Uses (4)

Used by (2)