package core:crypto/siphash
Overview
SipHash hashing algorithm.
Use the specific procedures for a certain setup. The generic procedures will default to Siphash 2-4.
See:
Types
Context ¶
Context :: struct { v0: u64, v1: u64, v2: u64, v3: u64, // State values k0: u64, k1: u64, // Split key c_rounds: int, // Number of message rounds d_rounds: int, // Number of finalization rounds buf: [8]u8, // Provided data last_block: int, // Offset from the last block total_length: int, is_initialized: bool, }
Constants
BLOCK_SIZE ¶
BLOCK_SIZE :: 8
DIGEST_SIZE ¶
DIGEST_SIZE :: 8
KEY_SIZE ¶
KEY_SIZE :: 16
Variables
This section is empty.
Procedures
sum_bytes ¶
sum_bytes :: sum_bytes_2_4
sum_bytes_2_4 will hash the given message with the key and return the computed hash as a u64
sum_bytes_1_3 ¶
sum_bytes_1_3 will hash the given message with the key and return the computed hash as a u64
sum_bytes_2_4 ¶
sum_bytes_2_4 will hash the given message with the key and return the computed hash as a u64
sum_bytes_4_8 ¶
sum_bytes_4_8 will hash the given message with the key and return the computed hash as a u64
sum_bytes_to_buffer ¶
sum_bytes_to_buffer :: sum_bytes_to_buffer_2_4
sum_bytes_to_buffer_2_4 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_bytes_to_buffer_1_3 ¶
sum_bytes_to_buffer_1_3 :: proc(msg, key, dst: []u8) {…}
sum_bytes_to_buffer_1_3 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_bytes_to_buffer_2_4 ¶
sum_bytes_to_buffer_2_4 :: proc(msg, key, dst: []u8) {…}
sum_bytes_to_buffer_2_4 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_bytes_to_buffer_4_8 ¶
sum_bytes_to_buffer_4_8 :: proc(msg, key, dst: []u8) {…}
sum_bytes_to_buffer_4_8 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_string ¶
sum_string :: sum_string_2_4
sum_string_2_4 will hash the given message with the key and return the computed hash as a u64
sum_string_1_3 ¶
sum_string_1_3 will hash the given message with the key and return the computed hash as a u64
sum_string_2_4 ¶
sum_string_2_4 will hash the given message with the key and return the computed hash as a u64
sum_string_4_8 ¶
sum_string_4_8 will hash the given message with the key and return the computed hash as a u64
sum_string_to_buffer ¶
sum_string_to_buffer :: sum_string_to_buffer_2_4
sum_string_to_buffer_2_4 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_string_to_buffer_1_3 ¶
sum_string_to_buffer_1_3 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_string_to_buffer_2_4 ¶
sum_string_to_buffer_2_4 will hash the given message with the key and write the computed hash into the provided destination buffer
sum_string_to_buffer_4_8 ¶
sum_string_to_buffer_4_8 will hash the given message with the key and write the computed hash into the provided destination buffer
verify_bytes ¶
verify_bytes :: verify_bytes_2_4
verify_bytes will check if the supplied tag matches with the output you will get from the provided message and key
Related Procedure Groups
verify_bytes_1_3 ¶
verify_bytes will check if the supplied tag matches with the output you will get from the provided message and key
verify_bytes_2_4 ¶
verify_bytes will check if the supplied tag matches with the output you will get from the provided message and key
Related Procedure Groups
verify_bytes_4_8 ¶
verify_bytes will check if the supplied tag matches with the output you will get from the provided message and key
verify_u64 ¶
verify_u64 :: verify_u64_2_4
verify_u64_2_4 will check if the supplied tag matches with the output you will get from the provided message and key
Related Procedure Groups
verify_u64_1_3 ¶
verify_u64_1_3 will check if the supplied tag matches with the output you will get from the provided message and key
verify_u64_2_4 ¶
verify_u64_2_4 will check if the supplied tag matches with the output you will get from the provided message and key
Related Procedure Groups
verify_u64_4_8 ¶
verify_u64_4_8 will check if the supplied tag matches with the output you will get from the provided message and key
Procedure Groups
sum ¶
sum :: proc{ sum_string_2_4, sum_bytes_2_4, sum_string_to_buffer_2_4, sum_bytes_to_buffer_2_4, }
sum_1_3 ¶
sum_1_3 :: proc{ sum_string_1_3, sum_bytes_1_3, sum_string_to_buffer_1_3, sum_bytes_to_buffer_1_3, }
sum_2_4 ¶
sum_2_4 :: proc{ sum_string_2_4, sum_bytes_2_4, sum_string_to_buffer_2_4, sum_bytes_to_buffer_2_4, }
sum_4_8 ¶
sum_4_8 :: proc{ sum_string_4_8, sum_bytes_4_8, sum_string_to_buffer_4_8, sum_bytes_to_buffer_4_8, }
verify ¶
verify :: proc{ verify_bytes_2_4, verify_u64_2_4, }
verify_1_3 ¶
verify_1_3 :: proc{ verify_bytes_1_3, verify_u64_1_3, }
verify_2_4 ¶
verify_2_4 :: proc{ verify_bytes_2_4, verify_u64_2_4, }
verify_4_8 ¶
verify_4_8 :: proc{ verify_bytes_4_8, verify_u64_4_8, }
Source Files
Generation Information
Generated with odin version dev-2026-11 (vendor "odin") Windows_amd64 @ 2026-11-28 21:05:09.772358800 +0000 UTC