5 #ifndef FABCOIN_CRYPTO_COMMON_H 6 #define FABCOIN_CRYPTO_COMMON_H 8 #if defined(HAVE_CONFIG_H) 17 uint16_t
static inline ReadLE16(
const unsigned char* ptr)
24 uint32_t
static inline ReadLE32(
const unsigned char* ptr)
31 uint64_t
static inline ReadLE64(
const unsigned char* ptr)
38 void static inline WriteLE16(
unsigned char* ptr, uint16_t x)
44 void static inline WriteLE32(
unsigned char* ptr, uint32_t x)
50 void static inline WriteLE64(
unsigned char* ptr, uint64_t x)
56 uint32_t
static inline ReadBE32(
const unsigned char* ptr)
63 uint64_t
static inline ReadBE64(
const unsigned char* ptr)
70 void static inline WriteBE32(
unsigned char* ptr, uint32_t x)
76 void static inline WriteBE64(
unsigned char* ptr, uint64_t x)
83 uint64_t
static inline CountBits(uint64_t x)
85 #ifdef HAVE_DECL___BUILTIN_CLZL 86 if (
sizeof(
unsigned long) >=
sizeof(uint64_t)) {
87 return x ? 8 *
sizeof(
unsigned long) - __builtin_clzl(x) : 0;
90 #ifdef HAVE_DECL___BUILTIN_CLZLL 91 if (
sizeof(
unsigned long long) >=
sizeof(uint64_t)) {
92 return x ? 8 *
sizeof(
unsigned long long) - __builtin_clzll(x) : 0;
103 #endif // FABCOIN_CRYPTO_COMMON_H uint32_t htobe32(uint32_t host_32bits)
uint64_t htole64(uint64_t host_64bits)
uint32_t le32toh(uint32_t little_endian_32bits)
uint64_t le64toh(uint64_t little_endian_64bits)
uint16_t le16toh(uint16_t little_endian_16bits)
void * memcpy(void *a, const void *b, size_t c)
uint16_t htole16(uint16_t host_16bits)
uint32_t htole32(uint32_t host_32bits)
uint64_t htobe64(uint64_t host_64bits)
uint64_t be64toh(uint64_t big_endian_64bits)
uint32_t be32toh(uint32_t big_endian_32bits)