Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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
12 typedef struct {
13 uint32_t u32[2];
14 } sip_uint64_t;
15 #define uint64_t sip_uint64_t
16 #else
17 typedef uint64_t sip_uint64_t;
18 #endif
19
20 typedef struct {
21 int c;
22 int d;
23 uint64_t v[4];
24 uint8_t buf[sizeof(uint64_t)];
25 uint8_t buflen;
26 uint8_t msglen_byte;
27 } sip_state;
28
29 typedef struct sip_interface_st sip_interface;
30
31 typedef struct {
32 sip_state state[1];
33 const sip_interface *methods;
34 } sip_hash;
35
36 sip_hash *sip_hash_new(const uint8_t key[16], int c, int d);
37 sip_hash *sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d);
38 int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len);
39 int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len);
40 int sip_hash_final_integer(sip_hash *h, uint64_t *digest);
41 int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len);
42 int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest);
43 void sip_hash_free(sip_hash *h);
44 void sip_hash_dump(sip_hash *h);
45
46 uint64_t sip_hash24(const uint8_t key[16], const uint8_t *data, size_t len);
47
48 #endif
data
VALUE data
Definition: tcltklib.c:3368
sip_hash::methods
const sip_interface * methods
Definition: siphash.h:33
sip_hash_final_integer
int sip_hash_final_integer(sip_hash *h, uint64_t *digest)
Definition: siphash.c:355
u32
uint32_t u32[(16 *sizeof(uint8_t)-1)/sizeof(uint32_t)]
Definition: random.c:1371
sip_hash_update
int sip_hash_update(sip_hash *h, const uint8_t *msg, size_t len)
Definition: siphash.c:333
sip_uint64_t
Definition: siphash.h:12
sip_hash
Definition: siphash.h:31
sip_state::msglen_byte
uint8_t msglen_byte
Definition: siphash.h:26
uint64_t
#define uint64_t
Definition: siphash.h:15
state
int state
Definition: tcltklib.c:1462
sip_interface_st
Definition: siphash.c:140
d
d
Definition: strlcat.c:58
uint8_t
unsigned char uint8_t
Definition: sha2.h:100
sip_state::d
int d
Definition: siphash.h:22
sip_hash_digest_integer
int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest)
Definition: siphash.c:369
sip_hash_free
void sip_hash_free(sip_hash *h)
Definition: siphash.c:376
sip_state::buflen
uint8_t buflen
Definition: siphash.h:25
uint64_t
unsigned long long uint64_t
Definition: sha2.h:102
buf
unsigned char buf[MIME_BUF_SIZE]
Definition: nkf.c:4308
sip_state::c
int c
Definition: siphash.h:21
key
static int VALUE key
Definition: tkutil.c:265
sip_state
Definition: siphash.h:20
sip_hash_final
int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len)
Definition: siphash.c:340
sip_hash_new
sip_hash * sip_hash_new(const uint8_t key[16], int c, int d)
Definition: siphash.c:312
c
VpDivd * c
Definition: bigdecimal.c:1205
uint32_t
unsigned int uint32_t
Definition: sha2.h:101
sip_hash_init
sip_hash * sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d)
Definition: siphash.c:321
sip_hash_digest
int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len)
Definition: siphash.c:362
sip_hash_dump
void sip_hash_dump(sip_hash *h)
Definition: siphash.c:382
sip_hash24
#define sip_hash24
Definition: random.c:1352
v
BDIGIT v
Definition: bigdecimal.c:5656
len
size_t len
Definition: tcltklib.c:3568