Fix division; we were computing n wrong.

This commit is contained in:
2018-06-09 17:08:13 -07:00
parent 72a5c4568e
commit 11c951d29b

View File

@@ -1,4 +1,3 @@
use cryptonum::addition::raw_addition;
use cryptonum::comparison::{bignum_cmp,bignum_ge};
use cryptonum::multiplication::raw_multiplication;
use cryptonum::subtraction::raw_subtraction;
@@ -13,7 +12,7 @@ pub fn divmod(inx: &[u64], iny: &[u64], q: &mut [u64], r: &mut [u64])
assert!(q.len() >= (inx.len() - 1));
assert!(r.len() >= iny.len());
// compute the basic number sizes
let mut n = match get_number_size(iny) {
let mut n = match get_number_size(inx) {
None => 0,
Some(v) => v
};