aboutgitcodebugslistschat
path: root/siphash.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-03-17 10:57:36 +0100
committerStefano Brivio <sbrivio@redhat.com>2021-03-17 10:57:36 +0100
commita41894683710b00d67015cd1683eef6de0ffd89b (patch)
tree19356a46614530fd359d238eea7f368bffecf495 /siphash.h
parent8bca388e8a771d069b2a2d4ac47589112f6f0af3 (diff)
downloadpasst-a41894683710b00d67015cd1683eef6de0ffd89b.tar
passt-a41894683710b00d67015cd1683eef6de0ffd89b.tar.gz
passt-a41894683710b00d67015cd1683eef6de0ffd89b.tar.bz2
passt-a41894683710b00d67015cd1683eef6de0ffd89b.tar.lz
passt-a41894683710b00d67015cd1683eef6de0ffd89b.tar.xz
passt-a41894683710b00d67015cd1683eef6de0ffd89b.tar.zst
passt-a41894683710b00d67015cd1683eef6de0ffd89b.zip
tcp: Add siphash implementation for initial sequence numbers
Implement siphash routines for initial TCP sequence numbers (12 bytes input for IPv4, 36 bytes input for IPv6), and while at it, also functions we'll use later on for hash table indices and TCP timestamp offsets (with 8, 20, 32 bytes of input). Use these to set the initial sequence number, according to RFC 6528, for connections originating either from the tap device or from sockets. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'siphash.h')
-rw-r--r--siphash.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/siphash.h b/siphash.h
new file mode 100644
index 0000000..694fdc3
--- /dev/null
+++ b/siphash.h
@@ -0,0 +1,5 @@
+uint64_t siphash_8b(const uint8_t *in, const uint64_t *k);
+uint32_t siphash_12b(const uint8_t *in, const uint64_t *k);
+uint64_t siphash_20b(const uint8_t *in, const uint64_t *k);
+uint32_t siphash_32b(const uint8_t *in, const uint64_t *k);
+uint32_t siphash_36b(const uint8_t *in, const uint64_t *k);