def add
import bend-collections@1.0.0.0/src/crypto/blake/blake2b/lane.bend as Laneimport Base
import bend-collections@1.0.0.0/src/crypto/blake/blake2b/types.bend as T
5# 64-bit addition modulo 2^64: the low halves add, their carry-out enters the high half.
6def add(a: T.Lane, b: T.Lane) -> T.Lane:
7 match a b:
8 case T.W{+al,ah} T.W{bl,bh}:
9 +lo = U32.add(al,bl)
10 T.W{lo,U32.add(U32.add(ah,bh),Bool.to_u32(U32.is_lt(lo,al)))}