ase/randomhash.hh file


Namespaces

namespace Ase
The Anklang C++ API namespace.
namespace Ase::Lib
Namespace for implementation internals.

Classes

template <size_t SIZE>
struct Ase::AlignedPOD
class Ase::Mwc256
Marsaglia multiply-with-carry generator, period ca 2^255.
struct Ase::SHA3_224
struct Ase::SHA3_256
struct Ase::SHA3_384
struct Ase::SHA3_512
struct Ase::SHAKE128
struct Ase::SHAKE256
class Ase::AutoSeeder
AutoSeeder provides non-deterministic seeding entropy.
class Ase::KeccakRng
class Ase::KeccakCryptoRng
class Ase::KeccakGoodRng
class Ase::KeccakFastRng
class Ase::Pcg32Rng

Functions

template <class Num>
static auto byte_hash64(const Num* data, size_t length) →  ASE_CONST uint64_t
Fast byte hashing with good dispersion and runtime randomization.
template <class Num>
static auto fnv1a_consthash64(const Num* ztdata) →  uint64_t constexpr
template <class Num>
static auto fnv1a_consthash64(const Num*const data, size_t length) →  uint64_t constexpr
Variant of fnv1a_consthash64() for memory blocks of arbitrary size.
static auto hash_secret() →  ASE_PURE uint64_t
Provide hashing nonce for reseeding hashes at program start to avoid collision attacks.
template <class Num>
static auto pcg_hash32(const Num* data, size_t length, uint64_t seed) →  ASE_CONST uint32_t
template <class Num>
static auto pcg_hash64(const Num* data, size_t length, uint64_t seed) →  ASE_CONST uint64_t
static auto pcg_hash64(const char* ztdata, uint64_t seed) →  ASE_CONST uint64_t
pcg_hash64() variant for zero-terminated strings.
static auto string_hash64(const std::string& string) →  ASE_CONST uint64_t
Fast string hashing with good dispersion for std::string and runtime randomization.
static auto string_hash64(const char* ztdata) →  ASE_CONST uint64_t
pcg_hash64() variant for zero-terminated strings.
auto random_float() →  double
auto random_frange(double begin, double end) →  double
auto random_int64() →  uint64_t
auto random_irange(int64_t begin, int64_t end) →  int64_t
auto random_nonce() →  uint64_t
Provide a unique 64 bit identifier that is not 0, see also random_int64().
void random_secret(uint64_t* secret_var)
Generate a secret non-zero nonce in secret_var, unless it has already been assigned.
void sha3_224_hash(const void* data, size_t data_length, uint8_t hashvalue[28])
Calculate 224 bit SHA3 digest from data, see also class SHA3_224.
void sha3_256_hash(const void* data, size_t data_length, uint8_t hashvalue[32])
Calculate 256 bit SHA3 digest from data, see also class SHA3_256.
void sha3_384_hash(const void* data, size_t data_length, uint8_t hashvalue[48])
Calculate 384 bit SHA3 digest from data, see also class SHA3_384.
void sha3_512_hash(const void* data, size_t data_length, uint8_t hashvalue[64])
Calculate 512 bit SHA3 digest from data, see also class SHA3_512.
void shake128_hash(const void* data, size_t data_length, uint8_t* hashvalues, size_t n)
Calculate SHA3 extendable output digest for 128 bit security strength, see also class SHAKE128.
void shake256_hash(const void* data, size_t data_length, uint8_t* hashvalues, size_t n)
Calculate SHA3 extendable output digest for 256 bit security strength, see also class SHAKE256.