Scalar.mac: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/ed25519/scalar.bend as Scalar Lines 36-43 of bend-collections@1.0.0.0/src/crypto/ed25519/scalar.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/ed25519/scalar.bend&start_line=36&end_line=43 import Base import bend-collections@1.0.0.0/src/crypto/curve25519/field.bend as F import bend-collections@1.0.0.0/src/crypto/curve25519/x25519.bend as X # bits t = n - 1 down to 0 of bs: acc = 2 acc + bit s (mod L) def mac(n: Nat, +bs: List<&2, U32>, +s: List<&2, U32>, +acc: List<&2, U32>) -> List<&2, U32>: match n: case 0n: acc case 1n+ +t: +a2 = addm(acc, acc) mac(t, bs, s, addm(a2, F.select(X.kbit(bs, t), F.zero(), s))) Uses (7): 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/field.bend&name=select https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&name=zero 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/scalar.bend&name=addm