def cr.vm.mm3

bend-osdev-crypto@0.1.0.0 · vmac.bend:206

import bend-osdev-crypto@0.1.0.0/vmac.bend as Vmac
import 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})))

Uses (10)

Used by (1)