min!
Static element-wise minimum of canonical integer values. Integer and field arithmetic
min! lhs, rhs
Returns the element-wise minimum of two static vectors, comparing the canonical integers in [0, p). Mostly used for the size of a last partial block, e.g. min! 10, n - 10 * s.
Arguments
lhs- Static scalar or vector.
rhs- Static scalar or vector of the same length.
Returns
A static vector of minima. Expression form only.
Constraints
None, both inputs must be static.
Example
(let x) static n = 13 static take = min! 10, n - 10 x * take
Notes
Errors: inputs must be static, arguments are of mismatched dimension. Vector literals such as [1 2] are stored as static references, which min! does not handle: passing one directly hits an internal unreachable! panic. Scalars and values computed by arithmetic work. Values are compared as integers, so 0 - 1 is the largest value, not a negative one.
Used in the standard library
keccak/keccak_sponge_shake, milli/mldsa/mldsa_reduce, mldsa/mldsa_limbs