From fe2367290c25f1b9a40cb26c563df2f847280a02 Mon Sep 17 00:00:00 2001 From: kr0 Date: Fri, 19 Jul 2019 11:05:20 +0200 Subject: [PATCH] Enable benchmarkin comparison between mod_inv_impl. Added `pub` visibility mark to `mod_inverse()` fn to be able to benchmark it. --- shamirsecretsharing-rs/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shamirsecretsharing-rs/src/lib.rs b/shamirsecretsharing-rs/src/lib.rs index 3c2bed3..f361ac4 100644 --- a/shamirsecretsharing-rs/src/lib.rs +++ b/shamirsecretsharing-rs/src/lib.rs @@ -75,7 +75,7 @@ fn unpack_shares(s: Vec<[BigInt;2]>) -> (Vec, Vec) { (shares, is) } -fn mod_inverse(a: BigInt, module: BigInt) -> BigInt { +pub fn mod_inverse(a: BigInt, module: BigInt) -> BigInt { // TODO search biguint impl of mod_inv let mut mn = (module.clone(), a); let mut xy: (BigInt, BigInt) = (Zero::zero(), One::one()); @@ -221,6 +221,7 @@ pub fn lagrange_interpolation(p: &BigInt, shares_packed: Vec<[BigInt;2]>) -> Big #[cfg(test)] mod tests { + use super::*; use std::str::FromStr;