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

Function Sqr

src/minisketch/src/sketch_impl.h:92–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90/** Square a polynomial. */
91template<typename F>
92void Sqr(std::vector<typename F::Elem>& poly, const F& field) {
93 if (poly.size() == 0) return;
94 poly.resize(poly.size() * 2 - 1);
95 for (int x = poly.size() - 1; x >= 0; --x) {
96 poly[x] = (x & 1) ? 0 : field.Sqr(poly[x / 2]);
97 }
98}
99
100/** Compute the trace map of (param*x) modulo mod, putting the result in out. */
101template<typename F>

Callers 2

TraceModFunction · 0.85
RecFindRootsFunction · 0.85

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
SqrMethod · 0.45

Tested by

no test coverage detected