Limbs.canon: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as Limbs Lines 146-150 of bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&start_line=146&end_line=150 import Base # t (16 limbs, value below 2^256) mod m: t + c has bit 256 set exactly when # t >= m, and then its low 256 bits are t - m def canon(+c: List<&2, Nat>, +t: List<&2, Nat>) -> List<&2, Nat>: +u = carry(32n, add(t, c), 0n) select(top(u), take(16n, u), t) 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=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=add https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=carry https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=select https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=take https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=top