#include <cstddef>
#include <cstring>
#include <functional>
#include <memory>
#include <sodium/crypto_verify_32.h>
Go to the source code of this file.
◆ CRYPTO_DEFINE_HASH_FUNCTIONS
| #define CRYPTO_DEFINE_HASH_FUNCTIONS |
( |
|
type | ) |
|
Value: static_assert(
sizeof(std::size_t) <=
sizeof(
type),
"Size of " #
type " must be at least that of size_t"); \
inline std::size_t hash_value(
const type &_v) { \
memcpy(&
h, std::addressof(_v),
sizeof(
h)); \
} \
} \
template<> \
struct hash<crypto::type> { \
memcpy(&
h, std::addressof(_v),
sizeof(
h)); \
} \
}; \
}
int type
Definition: superscalar.cpp:50
crypto namespace.
Definition: crypto.cpp:60
static uint64_t h
Definition: blockchain_stats.cpp:55
◆ CRYPTO_MAKE_COMPARABLE
| #define CRYPTO_MAKE_COMPARABLE |
( |
|
type | ) |
|
Value: return !memcmp(&_v1, &_v2, sizeof(_v1)); \
} \
} \
}
bool operator!=(const ipv4_network_address &lhs, const ipv4_network_address &rhs) noexcept
Definition: net_utils_base.h:113
bool operator==(const ipv4_network_address &lhs, const ipv4_network_address &rhs) noexcept
Definition: net_utils_base.h:111
int type
Definition: superscalar.cpp:50
crypto namespace.
Definition: crypto.cpp:60
◆ CRYPTO_MAKE_COMPARABLE_CONSTANT_TIME
| #define CRYPTO_MAKE_COMPARABLE_CONSTANT_TIME |
( |
|
type | ) |
|
Value: static_assert(sizeof(_v1) == 32, "constant time comparison is only implenmted for 32 bytes"); \
return
crypto_verify_32((
const unsigned char*)&_v1, (
const unsigned char*)&_v2) == 0; \
} \
} \
}
int crypto_verify_32(const unsigned char *, const unsigned char *)
Definition: verify.c:3
bool operator!=(const ipv4_network_address &lhs, const ipv4_network_address &rhs) noexcept
Definition: net_utils_base.h:113
bool operator==(const ipv4_network_address &lhs, const ipv4_network_address &rhs) noexcept
Definition: net_utils_base.h:111
int type
Definition: superscalar.cpp:50
crypto namespace.
Definition: crypto.cpp:60
◆ CRYPTO_MAKE_HASHABLE
| #define CRYPTO_MAKE_HASHABLE |
( |
|
type | ) |
|
Value:CRYPTO_DEFINE_HASH_FUNCTIONS(
type)
#define CRYPTO_MAKE_COMPARABLE(type)
Definition: generic-ops.h:39
int type
Definition: superscalar.cpp:50
◆ CRYPTO_MAKE_HASHABLE_CONSTANT_TIME
| #define CRYPTO_MAKE_HASHABLE_CONSTANT_TIME |
( |
|
type | ) |
|
Value:CRYPTO_DEFINE_HASH_FUNCTIONS(
type)
#define CRYPTO_MAKE_COMPARABLE_CONSTANT_TIME(type)
Definition: generic-ops.h:49
int type
Definition: superscalar.cpp:50