Commits

evhan committed 43290d3

add LICENSE and README

Comments (0)

Files changed (3)

+Copyright (c) 2013, Evan Hanson <evhan@foldling.org>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+  * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+  * The name of the author may not be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+README.md
+siphash
+=======
+A Scheme implementation of the SipHash family of hash functions.
+
+Description
+-----------
+[SipHash][] is a cryptographically strong family of hash functions designed
+by Jean-Philippe Aumasson and Daniel J. Bernstein.
+
+This library provides an implementation of these functions for [CHICKEN
+Scheme][].
+
+[SipHash]: http://131002.net/siphash
+[CHICKEN Scheme]: http://call-cc.org/
+
+Installation
+------------
+When installing for CHICKEN Scheme, the [numbers][] extension is required.
+
+    $ git clone git://bitbucket.org/evhan/siphash.git
+    $ cd siphash
+    $ chicken-install -test
+
+[numbers]: http://wiki.call-cc.org/egg/numbers
+
+Usage
+-----
+Three functions are provided:
+
+  * `make-siphash`
+  * `siphash-2-4`
+  * `siphash-4-8`
+
+`make-siphash` constructs a hashing function.
+
+It takes two positive integer arguments `c` and `d` and returns a
+hashing procedure of that number of compression and finalization rounds,
+respectively.
+
+    (make-siphash c d) => (procedure key message) => integer
+
+`siphash-2-4` and `siphash-4-8` are predefined hashing functions.
+
+Each takes two bytevectors, the key and message to hash, and returns a
+positive integer. `key` should have a length of 16, while `message` may
+be any length.
+
+The SipHash specification recommends SipHash-2-4 for performance and
+SipHash-4-8 for cryptographic security.
+
+    (siphash-2-4 key message) => integer
+    (siphash-4-8 key message) => integer
+
+Examples
+--------
+
+    > (siphash-2-4
+       (bytevector 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
+       (string->utf8 "The rain in Spain falls mainly on the plain."))
+    ; => 8751579407287093977
+
+    > (siphash-4-8
+       (bytevector 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
+       (string->utf8 "In Hertford, Hereford and Hampshire, hurricanes hardly ever happen."))
+    ; => 14358585221060811317
+
+    > ((make-siphash 8 16)
+       (string->utf8 "123456789abcdfgh")
+       (read-bytevector 16 (open-binary-input-file "/etc/motd")))
+    ; => an integer
+
+Notes
+-----
+This library hasn't been tested on 32-bit systems, and may fall over if
+used on one. It's on the TODO.
+
+Author
+------
+Evan Hanson <evhan@foldling.org>
+
+License
+-------
+Copyright (c) 2013, Evan Hanson under a BSD-style license.
+
+See LICENSE for full license information.