Giter VIP home page Giter VIP logo

mum-hash's People

Contributors

theironborn avatar vnmakarov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mum-hash's Issues

No benchmark results for i386 and 32 bit arm.

Though, this platforms are going to die, there is still wide adoption of.
So, it should be mention, which performance to expect from Mum, compared for other well performed 32bit hash functions.

Benchmark against BLAKE2

Hi,

could you please benchmark against BLAKE2b and BLAKE2s if it's not too much hassle?
It tries to be a very fast cryptographically secure hash function. I believe it to be still ballpark 10x slower than MUM but it would be nice to know for sure! Of course it would also make sense to compare it with MUM512. Thanks in advance!

[1] https://blake2.net/

is mum-hash suitable for authenticating network traffic just like SipHash-2-4 does in linux kernel?

linux kernel now use siphash_4u32 in net/ipv4/syncookies.c & net/ipv6/syncookies.c:
( https://github.com/torvalds/linux/tree/master )
static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport,
u32 count, int c)
{
net_get_random_once(syncookie_secret, sizeof(syncookie_secret));
return siphash_4u32((__force u32)saddr, (__force u32)daddr,
(__force u32)sport << 16 | (__force u32)dport,
count, &syncookie_secret[c]);
}

siphash maybe too heavy or slow to generate tcp syncookie, just a message authentication code can do it, syncookie not need second pre-image resistance or collision resistance, pre-image resistance may be enough, how to prove mum-hash can do it?

Access to primes[] out of bounds

This code in the inner loop of the hash assumes _mum_primes has an infinite number of elements and will produce non-deterministic output for any key longer than ((16 + _MUM_UNROLL_FACTOR) * sizeof(uint64_t) + 7)

for (i = 0; i < n; i++)
    result ^= _mum (_mum_le (((uint64_t *) str)[i]), _mum_primes[i]);

g-test for mum v2

I plugged in your v2 code into demerphq/smhasher and, unlike v1, it's failing most of its test suite. Have you tested it with that smhasher fork by any chance? It doesn't make sense to me that this would happen to the extent it is, so it may be something to do with the integration; I'll check that next unless you have an idea of what's going on.

Performance benchmarks with strings that are not multiple of 8 bytes

Hello, I'd like to thank you for your hard work - I really like your algorithm.

However, I have a sort of question: I tried mum-hash to calculate shingles which implies a lot of hash calculations for individual words in some arbitrary text. It turns out, that mum-hash performs quite bad in these conditions: it is slower than xxhash64:

mum-hash:

(50000 words of 5 len, 0.02 perm factor): percentage of common shingles: 0.968, generate time: 0.0533 sec
(50000 words of 16 len, 0.02 perm factor): percentage of common shingles: 0.937, generate time: 0.0351 sec

xxhash64:

(50000 words of 5 len, 0.02 perm factor): percentage of common shingles: 0.781, generate time: 0.0330 sec
(50000 words of 16 len, 0.02 perm factor): percentage of common shingles: 0.906, generate time: 0.0361 sec

As you can see, for inputs that are not 'good' for hash the performance is reduced significantly. I think this is worth to mention in the documentation.

Compilation warnings with gcc

When compiling with the -wno-unused-value flag the following warning is produced:

mum.h:118:13: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  118 |   lo = v * p, hi;
      |

How to use for multiple continuous blocks of data ?

In how to use MUM we can read:

  • mum_hash_init, mum_hash_step, and mum_hash_finish for hashing complex data structures
  • mum_hash64 for hashing a 64-bit data
  • mum_hash for hashing any continuous block of data

The most often scenario I'm woking with is creating hashes for multiple continuous blocks of data.
How should I do that with MUM, it is not obvious from the source.

e.g. how to I get the single hash over the following arrays with the right combinations of mum functions ?

const uint8_t key_1 [1] = { 0 };
const uint8_t key_2 [2] = { 1, 2 };
const uint8_t key_3 [3] = { 1, 2, 3 };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.