def carry
import bend-collections-laws-crypto@1.0.0.0/src/crypto/curve25519/field.bend as Fieldimport Base
97# one carry pass: limbs below 2^8 and the carry out of the top limb
98def carry(xs: List<&2, U32>, c: U32) -> Cr:
99 match xs:
100 case Nil{}:
101 Cr{Nil{}, c}
102 case Con{h, t}:
103 +s = U32.add(h, c)
104 carry_con(U32.mod(s, 256), carry(t, U32.div(s, 256)))
Uses (7)
Used by (45)
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/fold:cr_okb
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/freeze:csg
- bend-collections-laws-crypto@1.0.0.0/src/crypto/curve25519/field:pass
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/scalar:addg
- bend-collections-laws-crypto@1.0.0.0/src/crypto/curve25519/field:csub
- …