Point.smul: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/ed25519/point.bend as Point Lines 100-107 of bend-collections@1.0.0.0/src/crypto/ed25519/point.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&start_line=100&end_line=107 import Base import bend-collections@1.0.0.0/src/crypto/curve25519/x25519.bend as X # [bits t = n - 1 .. 0 of bs] p added to 2^n q: double, add, select def smul(n: Nat, +c: Cs, +bs: List<&2, U32>, +p: Pt, q: Pt) -> Pt: match n: case 0n: q case 1n+ +t: +q2 = double(q) smul(t, c, bs, p, select(X.kbit(bs, t), q2, add(c, q2, p))) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/x25519.bend&name=kbit https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=Cs https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=Pt https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=add https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=double https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/point.bend&name=select