modulo-n-tools

Crates.iomodulo-n-tools
lib.rsmodulo-n-tools
version0.2.0
sourcesrc
created_at2021-03-27 13:40:34.546842
updated_at2021-08-04 15:22:05.911582
descriptionmodulo tools
homepage
repositoryhttps://gitlab.com/Toru3/modulo-n-tools
max_upload_size
id374203
size18,985
(Toru3)

documentation

https://docs.rs/modulo-n-tools/

README

modulo_tools

add, sub, mul, pow in modulo, Montgomery multiplication.

use modulo_n_tools::*;
use modulo_n_tools::montgomery::*;
let a = add_mod(&3, &4, &5);
assert_eq!(a, 2);
let b = mul_mod(&3, &a, &5);
assert_eq!(b, 1);
let c = pow_mod(2, 6, &7);
assert_eq!(c, 1);
let m = Montgomery64::new(57);
let d = m.powmod(5, 42);
assert_eq!(d, 7);

Licence

AGPL-3.0-or-later

Commit count: 9

cargo fmt