| 90 | /** Square a polynomial. */ |
| 91 | template<typename F> |
| 92 | void 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. */ |
| 101 | template<typename F> |
no test coverage detected