MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / find_mod_inverse

Function find_mod_inverse

src/ciphers/affine_cipher.rs:64–93  ·  view source on GitHub ↗

Finds the modular multiplicative inverse of `a` modulo `m`. Uses the Extended Euclidean Algorithm to find x such that: (a * x) mod m = 1 # Arguments `a` - The number to find the inverse of `m` - The modulus # Returns `Some(inverse)` if the inverse exists, `None` otherwise

(a: i64, m: i64)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

affine_decryptFunction · 0.85

Calls 1

gcdFunction · 0.70

Tested by

no test coverage detected