def ladder

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/curve25519/x25519.bend:121

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519.bend as X25519
import Base

121# for t = n - 1 down to 0
122def ladder(+one: Nat, +p: Nat, n: Nat, +k: Nat, +x1: Nat, st: LSt) -> LSt:
123  match n:
124    case 0n:
125      st
126    case 1n+ +t:
127      ladder(one, p, t, k, x1, rung(one, p, x1, st, kbit(k, t)))

Uses (4)

Used by (5)