def hs.stb.add.go

bend-osdev-hashes@0.1.0.0 · streebog.bend:740

import bend-osdev-hashes@0.1.0.0/streebog.bend as Streebog
import Base

740# the words of x + y + c (c a carry, 0 or 1), least significant first,
741# modulo 2^(32 n)
742def hs.stb.add.go(xs: List<&2, U32>, ys: List<&2, U32>, +c: U32) -> List<&2, U32>:
743  match xs ys:
744    case Con{+x, xt} Con{y, yt}:
745      +t = U32.add(x, y)
746      +s = U32.add(t, c)
747      Con{s, hs.stb.add.go(xt, yt, U32.or(hs.stb.bit(U32.is_lt(t, x)), hs.stb.bit(U32.is_lt(s, t))))}
748    case _ _:
749      Nil{}

Uses (6)

Used by (1)