MCPcopy Create free account
hub / github.com/ElementsProject/elements / poly_frobeniusmod

Function poly_frobeniusmod

src/minisketch/tests/pyminisketch.py:253–258  ·  view source on GitHub ↗

Compute x^(2^field_size) mod poly.

(poly, gf)

Source from the content-addressed store, hash-verified

251 return out
252
253def poly_frobeniusmod(poly, gf):
254 """Compute x^(2^field_size) mod poly."""
255 out = [0, 1]
256 for _ in range(gf.field_size):
257 _, out = poly_divmod(poly_sqr(out, gf), poly, gf)
258 return out
259
260def poly_find_roots(poly, gf):
261 """Find the roots of poly if fully factorizable with unique roots, [] otherwise."""

Callers 1

poly_find_rootsFunction · 0.85

Calls 2

poly_divmodFunction · 0.85
poly_sqrFunction · 0.85

Tested by

no test coverage detected