Crate discrete_logarithm

Source
Expand description

§Discrete Logarithm Solver

Build Crate.io codecov

Fast discrete logarithm solver in Rust.

The code is based on the sympy implementation and translated to Rust.

§License

Licensed under either of

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Enums§

Error
Discrete logarithm error

Functions§

discrete_log
Compute the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
discrete_log_pohlig_hellman
Pohlig-Hellman algorithm for computing the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
discrete_log_pollard_rho
Pollard’s Rho algorithm for computing the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
discrete_log_shanks_steps
Baby-step giant-step algorithm for computing the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
discrete_log_trial_mul
Trial multiplication algorithm for computing the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
discrete_log_with_factors
Compute the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
discrete_log_with_order
Compute the discrete logarithm of a in base b modulo n (smallest non-negative integer x where b**x = a (mod n)).
n_order
Returns the order of a modulo n.