OpenVPN
Functions
siphash_openssl.c File Reference
#include "siphash.h"
#include <openssl/opensslv.h>
Include dependency graph for siphash_openssl.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ siphash_openssl()

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

Calculates SIPHASH using the crypto library function.

Definition at line 120 of file siphash_openssl.c.

Referenced by test_siphash_openssl().

◆ siphash_openssl_available()

bool siphash_openssl_available ( 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 127 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 133 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 139 of file siphash_openssl.c.

Referenced by test_siphash_openssl().