6 #ifndef RAVEN_CRYPTO_COMMON_H 7 #define RAVEN_CRYPTO_COMMON_H 9 #if defined(HAVE_CONFIG_H) 18 uint16_t
static inline ReadLE16(
const unsigned char* ptr)
25 uint32_t
static inline ReadLE32(
const unsigned char* ptr)
32 uint64_t
static inline ReadLE64(
const unsigned char* ptr)
39 void static inline WriteLE16(
unsigned char* ptr, uint16_t x)
45 void static inline WriteLE32(
unsigned char* ptr, uint32_t x)
51 void static inline WriteLE64(
unsigned char* ptr, uint64_t x)
57 uint32_t
static inline ReadBE32(
const unsigned char* ptr)
64 uint64_t
static inline ReadBE64(
const unsigned char* ptr)
71 void static inline WriteBE32(
unsigned char* ptr, uint32_t x)
77 void static inline WriteBE64(
unsigned char* ptr, uint64_t x)
84 uint64_t
static inline CountBits(uint64_t x)
86 #ifdef HAVE_DECL___BUILTIN_CLZL 87 if (
sizeof(
unsigned long) >=
sizeof(uint64_t)) {
88 return x ? 8 *
sizeof(
unsigned long) - __builtin_clzl(x) : 0;
91 #ifdef HAVE_DECL___BUILTIN_CLZLL 92 if (
sizeof(
unsigned long long) >=
sizeof(uint64_t)) {
93 return x ? 8 *
sizeof(
unsigned long long) - __builtin_clzll(x) : 0;
104 #endif // RAVEN_CRYPTO_COMMON_H uint64_t htobe64(uint64_t host_64bits)
uint32_t be32toh(uint32_t big_endian_32bits)
uint32_t htole32(uint32_t host_32bits)
uint32_t htobe32(uint32_t host_32bits)
uint64_t be64toh(uint64_t big_endian_64bits)
uint16_t le16toh(uint16_t little_endian_16bits)
uint16_t htole16(uint16_t host_16bits)
uint64_t le64toh(uint64_t little_endian_64bits)
void * memcpy(void *a, const void *b, size_t c)
uint64_t htole64(uint64_t host_64bits)
uint32_t le32toh(uint32_t little_endian_32bits)