Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: othersrc/external/bsd/hash64



Module Name:    othersrc
Committed By:   agc
Date:           Sat Jun  4 22:33:55 UTC 2011

Update of /cvsroot/othersrc/external/bsd/hash64
In directory ivanova.netbsd.org:/tmp/cvs-serv21752

Log Message:
Initial import of hash64 functionality (libhash64(3), and hash64(1))
into othersrc.

This library and program use two 32-bit hash algorithms combined to
create one 64-bit hash value.  The thinking behind this is that, while
the individual algorithms are subject to collisions in the same way
that any hash routine is, a hash value created by a combination of two
hash algorithms is more difficult to exploit.

The hash algorithms gathered here are the ones aggregated by Simon Burge
in

        ftp://ftp.netbsd.org/pub/NetBSD/misc/simonb/hashtest.tar.gz

and relate to this discussion from 2001(!):

        http://mail-index.netbsd.org/tech-perform/2001/11/29/0002.html

Specifically, the algorithms in use are:

        perlhash/perl
        mousehash/mouse
        dumbhash/dumb
        dumbmulhash/dumbmul
        crchash/crc
        perlxorhash/perlxor
        pythonhash/python
        bernsteinhash/bernstein
        honeymanhash/honeyman
        pjwhash/pjw
        torekhash/torek
        byacchash/byacc
        tclhash/tcl
        gawkhash/gawk
        nemhash/nem

and

        size

(the last of which is a simple number of characters in the data that has
been hashed). Whilst "size" is not technically a hash value, it is useful
for a number of use cases.

A number of hashing algorithms from the original discussion have been
left out of this implementation, as they require more than 32-bits of
context to calculate the resultant hash, and one of the goals of
hash64(3) is to keep the implementation small and simple.

The API of hash64(3) has been designed to model the API of sha1(3) and
friends, with the exception that a single unsigned 64-bit integer is
returned to indicate the hash value, rather than a raw/cooked character
buffer.

The internals of hash64(3) have been designed to allow easy addition of
further 32-bit hash algorithms. As an aside, perlhash() is used internally
to invoke the desired hashing functions.

Example of its use:

        % hash64 -a perl,mouse Makefile 
        HASH64 (Makefile) = 562f50c7f2030d74
        % hash64 Makefile 
        HASH64 (Makefile) = 562f50c7f2030d74
        % hash64 < Makefile 
        562f50c7f2030d74
        % hash64 -a mouse,perl Makefile 
        HASH64 (Makefile) = f2030d74562f50c7
        % hash64 -l
        perlhash/perl
        mousehash/mouse
        dumbhash/dumb
        dumbmulhash/dumbmul
        crchash/crc
        perlxorhash/perlxor
        pythonhash/python
        bernsteinhash/bernstein
        honeymanhash/honeyman
        pjwhash/pjw
        torekhash/torek
        byacchash/byacc
        tclhash/tcl
        gawkhash/gawk
        nemhash/nem
        size
        % hash64 -a pjw,size Makefile Makefile 
        HASH64 (Makefile) = 09aa1a5a0000009c
        HASH64 (Makefile) = 09aa1a5a0000009c
        % wc -c Makefile 
             156 Makefile
        %

This whole idea can and will be extended to combining other message
digests to produce larger, but much more collision-resistant digests
and hashes, including better protection against various attacks
against digest algorithms such as pre-imaging.

Status:

Vendor Tag:     CROOKS
Release Tags:   hash64-base
                
N othersrc/external/bsd/hash64/Makefile
N othersrc/external/bsd/hash64/hash64/Makefile
N othersrc/external/bsd/hash64/libhash64/shlib_version
N othersrc/external/bsd/hash64/libhash64/Makefile
N othersrc/external/bsd/hash64/dist/hash64.c
N othersrc/external/bsd/hash64/dist/hash64.h
N othersrc/external/bsd/hash64/dist/main.c
N othersrc/external/bsd/hash64/dist/Makefile
N othersrc/external/bsd/hash64/dist/hash64.3
N othersrc/external/bsd/hash64/dist/hash64.1

No conflicts created by this import



Home | Main Index | Thread Index | Old Index