FLINT3.7.0-dev

dlog_bsgs_init

Synopsis#include <flint/dlog.h>
ulong dlog_bsgs_init(dlog_bsgs_t t, ulong a, ulong mod, ulong n, ulong m)source

Initialises t with the m baby steps a^0, \ldots, a^{m-1} (or n if m > n), sorted by value, for a base of order n. Returns the number of giant steps \lfloor n/m \rfloor + 1, the worst-case cost of one logarithm. For k logarithms, m \approx \sqrt{kn} minimises the total cost.

Cite this page

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