• bcd32 based Hash Function with variable Length Hash Output

    From Karl.Frank@21:1/5 to All on Tue May 2 16:36:31 2017
    Out of curiosity I thought that the bit mixing function of bcd32 might
    also perform greatly inside a hash function. So I like to propose such a versatile hash calculator build around my 32bit PRNG bcd32. It can
    generate any hash with a size of a multiple of 32bit like
    32/64/96/128/160 ... and so on.

    It passes all extensive tests for distribution, collision, and
    performance conducted with the SMHasher test battery made by Austin
    Appleby, author of the MurmurHash.
    https://github.com/aappleby/smhasher

    The source code including compile instructions and test vectors is
    located for download on my server at
    http://www.freecx.co.uk/bcd32/bcd32_hash/

    The SMHasher test results are available here http://www.freecx.co.uk/bcd32/bcd32_hash/Test_Results/

    If you like to run your own tests on bcd32_hash with SMHasher in order
    to verify my published results you need either to modify the following
    source code files accordingly or download the prepared files from here http://www.freecx.co.uk/bcd32/bcd32_hash/smhasher_bcd32/


    https://github.com/aappleby/smhasher/blob/master/src/Hashes.h

    Add
    ------8<-----------------------------------------------------

    [...]

    void bcd32_hash( const void * key, int len, uint32_t seed, void * out,
    int byte_size );

    inline void bcd32_32(const void *key, int len, uint32_t seed, void *out) {
    bcd32_hash(key, len, seed, out, 4);
    }

    inline void bcd32_64(const void *key, int len, uint32_t seed, void *out) {
    bcd32_hash(key, len, seed, out, 8);
    }

    inline void bcd32_128(const void *key, int len, uint32_t seed, void *out) {
    bcd32_hash(key, len, seed, out, 16);
    }

    inline void bcd32_256(const void *key, int len, uint32_t seed, void *out) {
    bcd32_hash(key, len, seed, out, 32);
    }

    [...]

    ------8<-----------------------------------------------------


    https://github.com/aappleby/smhasher/blob/master/src/main.cpp

    Add
    ------8<-----------------------------------------------------

    [...]

    { bcd32_32, 32, 0x00000000, "bcd32_32bit", " 32 bit hash result" },
    { bcd32_64, 64, 0x00000000, "bcd32_64bit", " 64 bit hash result" },
    { bcd32_128, 128, 0x00000000, "bcd32_128bit", "128 bit hash result" },
    { bcd32_256, 256, 0x00000000, "bcd32_256bit", "256 bit hash result" },

    [...]

    ------8<-----------------------------------------------------


    https://github.com/aappleby/smhasher/blob/master/src/CMakeLists.txt

    Add
    ------8<-----------------------------------------------------
    [...]

    add_library(

    [...]

    bcd32_hash.cpp
    )

    [...]

    ------8<-----------------------------------------------------


    Comments and critique is always welcome.

    Cheers,
    Karl-Uwe


    --
    cHNiMUBACG0HAAAAAAAAAAAAAABIZVbDdKVM0w1kM9vxQHw+bkLxsY/Z0czY0uv8/Ks6WULxJVua zjvpoYvtEwDVhP7RGTCBVlzZ+VBWPHg5rqmKWvtzsuVmMSDxAIS6Db6YhtzT+RStzoG9ForBcG8k G97Q3Jml/aBun8Kyf+XOBHpl5gNW4YqhiM0=

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl.Frank@21:1/5 to All on Tue May 2 19:11:01 2017
    For those only interested in skimming over the source code without
    actually downloading
    it's available here as well

    http://paste.debian.net/930390

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl.Frank@21:1/5 to All on Fri May 5 19:14:38 2017
    The source code of an example implementation of bcd32_hash in Java is
    available for download here
    http://www.freecx.co.uk/bcd32/bcd32_hash/

    or if you prefer taking a glimpse on the source at a neutral website http://paste.debian.net/930891/

    Additionally on the same neutral website two of the SMhasher results

    # output_bcd32_32bit_20170105-1431-shortened.txt
    http://paste.debian.net/930899

    # output_bcd32_128bit_20170105-2355-shortened.txt http://paste.debian.net/930900

    All results in full length are still located here http://www.freecx.co.uk/bcd32/bcd32_hash/Test_Results/


    Finally just a reminder that bcd32_hash in its current form is not
    suitable for cryptographic purposes. Although the internal state has
    huge size of 192bit it might be a relatively easy task crafting two
    files that give the exact same hash because of the simple construct of
    the mixer. This might hold true even if bcd32_hash was initialised with
    a 128bit secret key.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)