FLINT3.7.0-dev

nmod_discrete_log_pohlig_hellman_run

Synopsis#include <flint/nmod.h>
ulong nmod_discrete_log_pohlig_hellman_run(const nmod_discrete_log_pohlig_hellman_t L, ulong y)source

Returns the x \in [0, p - 1) with g^x \equiv y \pmod p. Requires 0 < y < p.

L is not modified, so several threads can call nmod_discrete_log_pohlig_hellman_run with the same L at the same time. For y = 0, which has no logarithm, the function throws an exception when p is odd.

Guides#

Cite this page

The FLINT team, “nmod_discrete_log_pohlig_hellman_run (nmod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod/nmod_discrete_log_pohlig_hellman_run.html (generated 2026-10-20).