def cr.vm.mm3
import bend-osdev-crypto@0.1.0.0/vmac.bend as Vmacimport Base
import bend-osdev-word64@0.1.0.0/word64.bend as W
206# the 256-bit number with 64-bit words x3, x2, x1, x0 reduced mod p127:
207# (x >> 127) + (x mod 2^127)
208def cr.vm.mm3(+x3: W.W64, +x2: W.W64, +x1: W.W64, +x0: W.W64) -> CrU128:
209 cr.vm.reduce(cr.vm.fold(cr.vm.add(CrU128{W.W64.or(W.W64.shl(x3, 1n), W.W64.shr(x2, 63n)), W.W64.or(W.W64.shl(x2, 1n), W.W64.shr(x1, 63n))}, CrU128{W.W64.and(x1, cr.vm.m63()), x0})))