7#ifndef _MINISKETCH_FIELDS_GENERIC_COMMON_IMPL_H_
8#define _MINISKETCH_FIELDS_GENERIC_COMMON_IMPL_H_ 1
18template<
typename I,
int B, u
int32_t MOD,
typename F,
typename T, const F* SQR, const F* QRT>
class Field
25 constexpr int Bits()
const {
return B; }
27 constexpr inline Elem
Mul2(Elem val)
const {
return L::Call(val); }
33 explicit Multiplier(
const Field&, Elem
a) { table.template
Build<L::Call>(
a); }
34 constexpr inline Elem operator()(Elem
a)
const {
return table.template
Map<O>(
a); }
40 inline constexpr Elem
Sqr(Elem
a)
const {
return SQR->template
Map<O>(
a); }
43 inline constexpr Elem
Qrt(Elem
a)
const {
return QRT->template
Map<O>(
a); }
static constexpr I Mask(I val)
#define T(expected, seed, data)
uint64_t SipHash(uint64_t k0, uint64_t k1, uint64_t data)
void Serialize(Stream &, V)=delete
void Sqr(std::vector< typename F::Elem > &poly, const F &field)
Square a polynomial.
Class which implements a stateless LFSR for generic moduli.
static constexpr I Call(const I &a)
Shift a value a up once, treating it as an N-bit LFSR, with pattern MOD.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.