Field.carry: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/curve25519/field.bend as Field Lines 97-104 of bend-collections@1.0.0.0/src/crypto/curve25519/field.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&start_line=97&end_line=104 import Base # one carry pass: limbs below 2^8 and the carry out of the top limb def carry(xs: List<&2, U32>, c: U32) -> Cr: match xs: case Nil{}: Cr{Nil{}, c} case Con{h, t}: +s = U32.add(h, c) carry_con(U32.mod(s, 256), carry(t, U32.div(s, 256))) 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mod https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&name=Cr https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/curve25519/field.bend&name=carry_con