OpenVPN
siphash_openssl.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
Include dependency graph for siphash_openssl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void * siphash_openssl_init (size_t hash_size)
int siphash_openssl (void *sip_context, const void *in, size_t inlen, const void *k, uint8_t *out, size_t outlen)
 Calculates SIPHASH using the crypto library function.
void siphash_openssl_uninit (void *sip_context)
 Free the siphash context used for the crypto library.
bool siphash_openssl_available (const void *sip_context)
 Returns if the crypto library is available (and should be used).

Function Documentation

◆ siphash_openssl()

int siphash_openssl ( void * sip_context,
const void * in,
size_t inlen,
const void * k,
uint8_t * out,
size_t outlen )

Calculates SIPHASH using the crypto library function.

Definition at line 123 of file siphash_openssl.c.

Referenced by test_siphash_openssl().

◆ siphash_openssl_available()

bool siphash_openssl_available ( const void * sip_context)

Returns if the crypto library is available (and should be used).

This returns if there is a crypto library version of Siphash24 is available and should be used (OpenSSL 3/4 version is quite slow, so we prefer the reference implementation)

Definition at line 130 of file siphash_openssl.c.

Referenced by test_siphash_openssl().

◆ siphash_openssl_init()

void * siphash_openssl_init ( size_t hash_size)
Parameters
hash_sizethe size of the output hash size
Returns
initialised context for siphash

Definition at line 136 of file siphash_openssl.c.

Referenced by test_siphash_openssl().

◆ siphash_openssl_uninit()

void siphash_openssl_uninit ( void * sip_context)

Free the siphash context used for the crypto library.

Parameters
sip_context

Definition at line 142 of file siphash_openssl.c.

Referenced by test_siphash_openssl().