#include <stdint.h>
#include <stdlib.h>
#include <limits>
#include <algorithm>
#include <type_traits>
Go to the source code of this file.
|
class | BitWriter |
|
class | BitReader |
|
class | BitsInt< I, BITS > |
|
struct | LFSR< F, MOD > |
| Class which implements a stateless LFSR for generic moduli. More...
|
|
struct | GFMulHelper< I, N, L, F, 0 > |
|
struct | GFMulHelper< I, N, L, F, K > |
| Helper class for carryless multiplications. More...
|
|
|
template<int bits> |
static constexpr uint64_t | Rot (uint64_t x) |
|
static void | SipHashRound (uint64_t &v0, uint64_t &v1, uint64_t &v2, uint64_t &v3) |
|
uint64_t | SipHash (uint64_t k0, uint64_t k1, uint64_t data) |
|
template<int BITS, typename I > |
constexpr I | Mask () |
| Return a value of type I with its bits lowest bits set (bits must be > 0). More...
|
|
template<typename I > |
static int | CountBits (I val, int max) |
| Compute the smallest power of two that is larger than val. More...
|
|
template<typename I , int N, typename L , typename F > |
constexpr I | GFMul (const I &a, const I &b) |
| Compute the carry-less multiplication of a and b, with N bits, using L as LFSR type. More...
|
|
template<typename I , typename F , int BITS, uint32_t MOD> |
I | InvExtGCD (I x) |
| Compute the inverse of x using an extgcd algorithm. More...
|
|
template<typename I , typename F , int BITS, I(*)(I, I) MUL, I(*)(I) SQR, I(*)(I) SQR2, I(*)(I) SQR4, I(*)(I) SQR8, I(*)(I) SQR16> |
I | InvLadder (I x1) |
| Compute the inverse of x1 using an exponentiation ladder. More...
|
|
◆ CountBits()
template<typename I >
static int CountBits |
( |
I |
val, |
|
|
int |
max |
|
) |
| |
|
inlinestatic |
Compute the smallest power of two that is larger than val.
Definition at line 146 of file int_utils.h.
◆ GFMul()
template<typename I , int N, typename L , typename F >
constexpr I GFMul |
( |
const I & |
a, |
|
|
const I & |
b |
|
) |
| |
|
inlineconstexpr |
Compute the carry-less multiplication of a and b, with N bits, using L as LFSR type.
Definition at line 250 of file int_utils.h.
◆ InvExtGCD()
template<typename I , typename F , int BITS, uint32_t MOD>
Compute the inverse of x using an extgcd algorithm.
Definition at line 254 of file int_utils.h.
◆ InvLadder()
template<typename I , typename F , int BITS, I(*)(I, I) MUL, I(*)(I) SQR, I(*)(I) SQR2, I(*)(I) SQR4, I(*)(I) SQR8, I(*)(I) SQR16>
Compute the inverse of x1 using an exponentiation ladder.
The MUL
argument is a multiplication function, SQR
is a squaring function, and the SQRi
arguments compute x**(2**i).
Definition at line 280 of file int_utils.h.
◆ Mask()
template<int BITS, typename I >
Return a value of type I with its bits
lowest bits set (bits must be > 0).
Definition at line 142 of file int_utils.h.
◆ Rot()
template<int bits>
static constexpr uint64_t Rot |
( |
uint64_t |
x | ) |
|
|
inlinestaticconstexpr |
◆ SipHash()
uint64_t SipHash |
( |
uint64_t |
k0, |
|
|
uint64_t |
k1, |
|
|
uint64_t |
data |
|
) |
| |
|
inline |
◆ SipHashRound()
static void SipHashRound |
( |
uint64_t & |
v0, |
|
|
uint64_t & |
v1, |
|
|
uint64_t & |
v2, |
|
|
uint64_t & |
v3 |
|
) |
| |
|
inlinestatic |