Function aoc::year2020::day25::discrete_logarithm
source · fn discrete_logarithm(public_key: u64) -> u64
Expand description
Baby-step giant-step algorithm to compute discrete logarithm. Constants are hardcoded to this specific problem.
- 4495 is the ceiling of √20201227
- 680915 is 7⁻⁴⁴⁹⁵, or the multiplicative modular inverse of 7 to modular exponent 4495.