Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/siphash|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: egg]] == siphash [[toc:]] == Description A Scheme implementation of the SipHash family of hash functions. [[https://131002.net/siphash|SipHash]] is a cryptographically strong family of hash functions designed by Jean-Philippe Aumasson and Daniel J. Bernstein. The source for this extension is available [[https://git.foldling.org/siphash.git|here]]. == Requirements * [[numbers]] == API Three functions are provided: * {{make-siphash}} * {{siphash-2-4}} * {{siphash-4-8}} <procedure>(make-siphash c d) => procedure</procedure> {{make-siphash}} constructs a hashing function. It takes two positive integer arguments {{c}} and {{d}} and returns a hashing procedure with that many compression and finalization rounds, respectively. The returned procedure's signature matches those of {{siphash-2-4}} and {{siphash-4-8}}. <procedure>(siphash-2-4 key) => (procedure message) => integer</procedure> <procedure>(siphash-2-4 key message) => integer</procedure> <procedure>(siphash-4-8 key) => (procedure message) => integer</procedure> <procedure>(siphash-4-8 key message) => integer</procedure> {{siphash-2-4}} and {{siphash-4-8}} are predefined hashing procedures. Each takes one or two SRFI-4 u8vector arguments, the key and message to hash, and returns a positive integer. {{key}} should have a length of 16, while {{message}} may be any length. If {{message}} isn't given, a prekeyed hashing function is returned. The SipHash specification recommends SipHash-2-4 for performance and SipHash-4-8 for cryptographic security. == Examples <enscript highlight=scheme> > (define string->u8vector (compose blob->u8vector string->blob)) > (define key (u8vector 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) > (define msg (string->u8vector "The rain in Spain falls mainly on the plain.")) > (siphash-2-4 key msg) ; => 8751579407287093977 > ((siphash-4-8 key) msg) ; => 13472556437817646137 > ((make-siphash 8 16) key (string->u8vector "In Hertford, Hereford and Hampshire, hurricanes hardly ever happen.")) ; => 9275736844991428064 </enscript> == Author [[/users/evan-hanson|Evan Hanson]] == License 3-Clause BSD
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 12 to 20?