Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd)
siphash.h
Go to the documentation of this file.
1#ifndef SIPHASH_H
2#define SIPHASH_H 1
3#include <stdlib.h>
4#ifdef HAVE_STDINT_H
5#include <stdint.h>
6#endif
7#ifdef HAVE_INTTYPES_H
8#include <inttypes.h>
9#endif
10
11#ifndef HAVE_UINT64_T
12typedef struct {
15#define uint64_t sip_uint64_t
16#else
18#endif
19
20typedef struct {
21 int c;
22 int d;
27} sip_state;
28
29typedef struct sip_interface_st sip_interface;
30
31typedef struct {
32 sip_state state[1];
34} sip_hash;
35
36sip_hash *sip_hash_new(const uint8_t key[16], int c, int d);
37sip_hash *sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d);
38int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len);
39int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len);
41int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len);
42int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest);
45
46NO_SANITIZE("unsigned-integer-overflow", uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len));
47
48#endif
uint32_t u32[type_roomof(seed_keys_t, uint32_t)]
Definition: random.c:1424
__uint32_t uint32_t
__uint8_t uint8_t
__inline__ const void *__restrict__ size_t len
__uint64_t uint64_t
int VALUE v
struct rb_call_cache buf
size_t st_index_t h
uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)
Definition: siphash.c:397
#define uint64_t
Definition: siphash.h:15
int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len)
sip_hash * sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d)
NO_SANITIZE("unsigned-integer-overflow", uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len))
void sip_hash_free(sip_hash *h)
int sip_hash_final_integer(sip_hash *h, uint64_t *digest)
int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len)
int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len)
int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest)
struct sip_interface_st sip_interface
Definition: siphash.h:29
sip_hash * sip_hash_new(const uint8_t key[16], int c, int d)
void sip_hash_dump(sip_hash *h)
const sip_interface * methods
Definition: siphash.h:33
int c
Definition: siphash.h:21
uint8_t msglen_byte
Definition: siphash.h:26
uint8_t buflen
Definition: siphash.h:25
int d
Definition: siphash.h:22