]> git.proxmox.com Git - systemd.git/blame - src/basic/siphash24.h
Merge tag 'upstream/229'
[systemd.git] / src / basic / siphash24.h
CommitLineData
60f067b4
JS
1#pragma once
2
3#include <inttypes.h>
4c89c718
MP
4#include <stddef.h>
5#include <stdint.h>
60f067b4
JS
6#include <sys/types.h>
7
6300502b 8struct siphash {
db2df898
MP
9 uint64_t v0;
10 uint64_t v1;
11 uint64_t v2;
12 uint64_t v3;
13 uint64_t padding;
14 size_t inlen;
6300502b
MP
15};
16
17void siphash24_init(struct siphash *state, const uint8_t k[16]);
18void siphash24_compress(const void *in, size_t inlen, struct siphash *state);
4c89c718
MP
19#define siphash24_compress_byte(byte, state) siphash24_compress((const uint8_t[]) { (byte) }, 1, (state))
20
db2df898 21uint64_t siphash24_finalize(struct siphash *state);
6300502b 22
db2df898 23uint64_t siphash24(const void *in, size_t inlen, const uint8_t k[16]);