Realm

oa::crypto::bigint::montgomery_multiply

Compute batched unsigned limb montgomery multiply. Operands are public U32 [batch, words] rows of little-endian limbs, with 1..=128 words (32..=4096 bits). Records device work without host reads or a host wait. This public-data route does not accept cryptographic secrets and makes no constant-time or performance claim. Returns (output, status) with U32 [batch] status flags. modulus is U32 [1, words] or [batch, words], with matching Engine ownership. A zero modulus returns status 0 and zero output; valid rows return status 1. Montgomery operations require an odd modulus; even moduli return status 0 and zero output. R = 2^(32words). Conversion multiplies by R or R^-1; multiplication computes ab*R^-1 modulo m. Errors Rejects rank, dtype, shape, ownership, address limits, allocation or recording failures.

FnRust public API

Function Documentation

pub fn montgomery_multiply( left: &Matrix, right: &Matrix, modulus: &Matrix, ) -> Result<( Matrix, Matrix )>
Compute batched unsigned limb montgomery multiply. Operands are public U32 [batch, words] rows of little-endian limbs, with 1..=128 words (32..=4096 bits). Records device work without host reads or a host wait. This public-data route does not accept cryptographic secrets and makes no constant-time or performance claim. Returns (output, status) with U32 [batch] status flags. modulus is U32 [1, words] or [batch, words], with matching Engine ownership. A zero modulus returns status 0 and zero output; valid rows return status 1. Montgomery operations require an odd modulus; even moduli return status 0 and zero output. R = 2^(32words). Conversion multiplies by R or R^-1; multiplication computes ab*R^-1 modulo m. Errors Rejects rank, dtype, shape, ownership, address limits, allocation or recording failures.