Module math_common

Source
Expand description

Common mathematical operations for cryptographic algorithms

Functionsยง

gcd
Compute the greatest common divisor of two numbers
mod_add
Perform modular addition: (a + b) mod m
mod_exp
Perform modular exponentiation (a^b mod m)
mod_inv
Extended Euclidean algorithm to compute a^(-1) mod m
mod_mul
Perform modular multiplication: (a * b) mod m
mod_sub
Perform modular subtraction: (a - b) mod m