diff options
Diffstat (limited to 'src/biguint/monty.rs')
-rw-r--r-- | src/biguint/monty.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/biguint/monty.rs b/src/biguint/monty.rs index a5c79aa..abaca50 100644 --- a/src/biguint/monty.rs +++ b/src/biguint/monty.rs @@ -37,7 +37,7 @@ impl MontyReducer { /// Computes z mod m = x * y * 2 ** (-n*_W) mod m /// assuming k = -1/m mod 2**_W /// See Gueron, "Efficient Software Implementations of Modular Exponentiation". -/// https://eprint.iacr.org/2011/239.pdf +/// <https://eprint.iacr.org/2011/239.pdf> /// In the terminology of that paper, this is an "Almost Montgomery Multiplication": /// x and y are required to satisfy 0 <= z < 2**(n*_W) and then the result /// z is guaranteed to satisfy 0 <= z < 2**(n*_W), but it may not be < m. @@ -78,8 +78,8 @@ fn montgomery(x: &BigUint, y: &BigUint, m: &BigUint, k: BigDigit, n: usize) -> B z.data = z.data[n..].to_vec(); } else { { - let (mut first, second) = z.data.split_at_mut(n); - sub_vv(&mut first, &second, &m.data); + let (first, second) = z.data.split_at_mut(n); + sub_vv(first, second, &m.data); } z.data = z.data[..n].to_vec(); } |