Skip to main content

Module mul

Module mul 

Source
Expand description

Multiplication between boxed integers in Montgomery form (i.e. Montgomery multiplication).

Some parts adapted from monty.rs in num-bigint: https://github.com/rust-num/num-bigint/blob/2cea7f4/src/biguint/monty.rs

Originally (c) 2014 The Rust Project Developers, dual licensed Apache 2.0+MIT.

Structs§

BoxedMontyMultiplier
Montgomery multiplier with a pre-allocated internal buffer to avoid additional allocations.

Functions§

montgomery_mul 🔒
Computes Montgomery multiplication of x and y into out, that is out = x * y * 2^(-n*W) mod m assuming k = -1/m mod 2^W, where W is the bit size of the limb, and n * W is the full bit size of the integer.