Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grim7reaper/SipHash
A pure Ada implementation of the SipHash PRF (mirror repository).
https://github.com/grim7reaper/SipHash
Last synced: 3 months ago
JSON representation
A pure Ada implementation of the SipHash PRF (mirror repository).
- Host: GitHub
- URL: https://github.com/grim7reaper/SipHash
- Owner: grim7reaper
- License: bsd-3-clause
- Created: 2014-01-26T09:51:30.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-15T01:33:39.000Z (almost 11 years ago)
- Last Synced: 2024-07-31T20:39:47.046Z (6 months ago)
- Language: Ada
- Homepage: http://projects.gw-computing.net/projects/siphash
- Size: 211 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ada - sip-hash - A pure Ada implementation of the SipHash PRF. (Libraries / Cryptography)
README
# SipHash: a fast short-input PRF
This is a pure Ada implementation of the SipHash PRF.
It is based on the original paper and tested against the test values provided in
the paper and in the reference C implementation.SipHash was designed by Jean-Philippe Aumasson and Daniel J. Bernstein.
## Description
From the [official website](https://131002.net/siphash/):
--------------------------------------------------------------------------------
SipHash is a family of pseudorandom functions (a.k.a. keyed hash functions)
optimized for speed on short messages.Target applications include network traffic authentication and defense against
hash-flooding DoS attacks.SipHash is secure, fast, and simple (for real):
* SipHash is simpler and faster than previous cryptographic algorithms (e.g.
MACs based on universal hashing)
* SipHash is competitive in performance with insecure non-cryptographic
algorithms (e.g. MurmurHash)We propose that hash tables switch to SipHash as a hash function. Users of
SipHash already include FreeBSD, OpenDNS, Perl 5, Ruby, or Rust.--------------------------------------------------------------------------------
## Usage
Block interface:
with SipHash.PRF;
[…]
package SipHash24 is new SipHash.PRF(Nb_Compression_Rounds => 2,
Nb_Finalization_Rounds => 4);
[…]
Output := SipHash24.Hash(Input, Key);Streaming interface:
with SipHash.PRF;
[…]
package SipHash48 is new SipHash.PRF(Nb_Compression_Rounds => 4,
Nb_Finalization_Rounds => 8);
[…]
-- Initialization with the 128-bit secret key.
Hash : SipHash48.Object := SipHash48.Initialize(Key);
[…]
-- Processing of each byte of the input.
for I in Input'Range loop
SipHash48.Update(Hash, Input(I));
end loop;
-- Finalization to compute the hash value.
SipHash48.Finalize(Hash, Output);## Compilation
In debug mode:
$ make
In release mode:
$ make BUILD_MODE=release
## Testing
To run the tests:
$ make run_tests
## Reference
J.-P. Aumasson and D. J. Bernstein,
“[SipHash: a fast short-input PRF](https://131002.net/siphash/siphash.pdf).”
18-Sep-2012.J.-P. Aumasson and D. J. Bernstein,
"[Reference C implementation](https://131002.net/siphash/siphash24.c)"## License
This software is licensed under the BSD3 license.
Copyright (c) 2014, Sylvain Laperche