Browse Source

Enable benchmarkin comparison between mod_inv_impl.

Added `pub` visibility mark to `mod_inverse()`
fn to be able to benchmark it.
pull/2/head
kr0 4 years ago
parent
commit
fe2367290c
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      shamirsecretsharing-rs/src/lib.rs

+ 2
- 1
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;

Loading…
Cancel
Save