Expand description
The module for cryptographic operations, including polynomial generation, evaluation, prime number generation, hashing, modular arithmetic, and Lagrange interpolation.
Structs§
- Polynomial
- Represents a polynomial with coefficients in
BigUint
. This struct is used for operations such as Shamir’s Secret Sharing.
Functions§
- egcd
- Extended Euclidean algorithm for computing the greatest common divisor (gcd) and Bezout coefficients.
- gen_
rand - Generates a random
BigUint
number within the range[1, modulus)
. - generate_
prime - Generates a prime number of a specified bit size.
- hash_
data - Hashes input data using SHA-256.
- lagrange_
interpolation_ zero - Performs Lagrange interpolation at zero for a given set of points modulo a given modulus.
- mod_exp
- Calculates the modular exponentiation of a base raised to an exponent modulo a modulus.
- mod_inv
- Computes the modular multiplicative inverse of
a
modulom
.