30#ifdef ENABLE_CRYPTO_OPENSSL
31#include <openssl/opensslv.h>
35#define SIPHASH_KEY_SIZE 16
42 uint8_t *out,
size_t outlen);
45#if defined(OPENSSL_IS_AWSLC)
46#define USE_CRYPOTOLIB_SIPHASH
47#include <openssl/siphash.h>
59siphash_cryptolib(
const void *in,
const size_t inlen,
60 const void *k, uint8_t *out,
const size_t outlen)
62 ASSERT(outlen ==
sizeof(uint64_t));
63 uint64_t sipout = SIPHASH_24(k, in, inlen);
65 memcpy(out, &sipout,
sizeof(uint64_t));
70siphash(
const void *in,
size_t inlen,
const void *k,
71 uint8_t *out,
size_t outlen)
73#if defined(USE_CRYPOTOLIB_SIPHASH)
74 siphash_cryptolib(in, inlen, k, out, outlen);
void prng_bytes(uint8_t *output, int len)
Data Channel Cryptography Module.
void siphash_reference(const void *in, size_t inlen, const void *k, uint8_t *out, size_t outlen)
Calculates SIPHASH using the reference implementation.
static void siphash(const void *in, size_t inlen, const void *k, uint8_t *out, size_t outlen)
uint64_t siphash_hash_func(const uint8_t *k, uint32_t length, const uint8_t hash_key[SIPHASH_KEY_SIZE])
Wrapper of the siphash function to be able to use it in the hash map.
static void siphash_key_init(uint8_t *key)
Initialises a SIPHASH key with a random value.
Container for unidirectional cipher and HMAC key material.