compiler/shared/runtime/dea_siphash.h

Overview Symbols grouped by source file: compiler/shared/runtime/dea_siphash.h

Source: compiler/shared/runtime/dea_siphash.h Language: C

SipHash-1-3 and SipHash-2-4 (64-bit tag), portable C99.

Header-only / single-header pattern:

  • In one translation unit: #define SIPHASH_IMPLEMENTATION before including this header.
  • Everywhere else: include this header without SIPHASH_IMPLEMENTATION .

Imports / Includes

  • stddef.h
  • stdint.h

Symbols

Function siphash24

uint64_t siphash24(const void *data, size_t len, const uint8_t key[16])

SipHash-2-4 (64-bit tag).

Parameters:

  • data: Pointer to the data to hash.
  • len: Length of the data in bytes.
  • key: 16-byte key, interpreted as little-endian (k0 = key[0..7], k1 = key[8..15]).

Returns: 64-bit hash value.

Function siphash13

uint64_t siphash13(const void *data, size_t len, const uint8_t key[16])

SipHash-1-3 (64-bit tag).

Parameters:

  • data: Pointer to the data to hash.
  • len: Length of the data in bytes.
  • key: 16-byte key, interpreted as little-endian (k0 = key[0..7], k1 = key[8..15]).

Returns: 64-bit hash value.

Function siphash24_tag8_bytes

uint64_t siphash24_tag8_bytes(const uint8_t tag8[8], const void *data, size_t len, const uint8_t key[16])

Hash (tag8 || data) where tag8 is a raw 8-byte array using SipHash-2-4.

Parameters:

  • tag8: 8-byte tag/prefix.
  • data: Pointer to the data to hash.
  • len: Length of the data in bytes.
  • key: 16-byte key.

Returns: 64-bit hash value.

Function siphash13_tag8_bytes

uint64_t siphash13_tag8_bytes(const uint8_t tag8[8], const void *data, size_t len, const uint8_t key[16])

Hash (tag8 || data) where tag8 is a raw 8-byte array using SipHash-1-3.

Parameters:

  • tag8: 8-byte tag/prefix.
  • data: Pointer to the data to hash.
  • len: Length of the data in bytes.
  • key: 16-byte key.

Returns: 64-bit hash value.

Function siphash24_tag8_bf

uint64_t siphash24_tag8_bf(const uint8_t tag8[8], const uint8_t flags, const void *data, size_t len, const uint8_t key[16])

Hash (tag8^flags || data) where tag8 is a raw 8-byte array and flags is one byte (XORed into tag8[0]).

Uses SipHash-2-4.

Parameters:

  • tag8: 8-byte tag/prefix.
  • flags: One byte flags XORed into tag8[0].
  • data: Pointer to the data to hash.
  • len: Length of the data in bytes.
  • key: 16-byte key.

Returns: 64-bit hash value.

Function siphash13_tag8_bf

uint64_t siphash13_tag8_bf(const uint8_t tag8[8], const uint8_t flags, const void *data, size_t len, const uint8_t key[16])

Hash (tag8^flags || data) where tag8 is a raw 8-byte array and flags is one byte (XORed into tag8[0]).

Uses SipHash-1-3.

Parameters:

  • tag8: 8-byte tag/prefix.
  • flags: One byte flags XORed into tag8[0].
  • data: Pointer to the data to hash.
  • len: Length of the data in bytes.
  • key: 16-byte key.

Returns: 64-bit hash value.