We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aea5f85 commit 4d35815Copy full SHA for 4d35815
bigint/src/monty.rs
@@ -1,4 +1,3 @@
1
-use std::iter::repeat;
2
use integer::Integer;
3
use traits::{Zero, One};
4
@@ -62,11 +61,9 @@ fn monty_redc(a: BigUint, mr: &MontyReducer) -> BigUint {
62
61
let mut c = a.data;
63
let n = &mr.n;
64
let n_size = n.len();
65
- let old_size = c.len();
66
67
// Allocate sufficient work space
68
- c.reserve(2*n_size+2-old_size);
69
- c.extend(repeat(0).take(2*n_size+2-old_size));
+ c.resize(2 * n_size + 2, 0);
70
71
// β is the size of a word, in this case 32 bits. So "a mod β" is
72
// equivalent to masking a to 32 bits.
0 commit comments