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∈[0,p−1)x \in [0, p - 1) with gx≡y(modp)g^x \equiv y \pmod p. Requires 0<y<p0 < 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=0y = 0, which has no logarithm, the function throws an exception when pp 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-11-02).