Sha512.add: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend as Sha512 Lines 16-23 of bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend&start_line=16&end_line=23 import Base import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha512/types.bend as T # FIPS 180-4 section 3.2: x + y mod 2^64. The low halves add modulo 2^32; the # high halves add the carry out of the low half, which is 1 exactly when the # low sum wrapped below either addend. def add(a: T.Lane, b: T.Lane) -> T.Lane: match a b: case T.W{ah, +al} T.W{bh, bl}: +lo = U32.add(al, bl) T.W{U32.add(U32.add(ah, bh), Bool.to_u32(U32.is_lt(lo, al))), lo} Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.to_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.is_lt https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/sha512/types.bend&name=Lane