def freeze
import bend-collections@1.0.0.0/src/crypto/poly1305/limbs.bend as Limbsimport Base
107# The low 16 limbs of h mod p, for h below 2p: g = h + 5 has bit 130 set
108# exactly when h >= p, and then its low 128 bits are those of h - p.
109def freeze(+h: List<&2, U32>) -> List<&2, U32>:
110 +g = carry(16n, add(h, [5]), 0)
111 +b = U32.shrn(hd0(skip(16n, g)), 2n)
112 select(U32.sub(0, b), take(16n, h), take(16n, g))