Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add finish_buf output function for 128-bit hasher #8

Closed
wants to merge 2 commits into from

Conversation

dhardy
Copy link

@dhardy dhardy commented Jul 11, 2018

This is a proof of concept.

The idea is to make it easy to reproducibly seed any PRNG (see Seed type) from any input with a "good quality" seed.

To make it portable it also needs Hasher to be portable see this thread.

It's not intended for cryptography (and definitely not for password hashing).

@jedisct1
Copy link
Owner

Hi Diggory,

I'm not a big fan of this.

The point over the current finish() function is not obvious. It seems to be designed for a very niche use case that I don't completely understand (are you willing to use SipHash-core as a stream cipher?) and the implementation doesn't look very idiomatic.

@dhardy
Copy link
Author

dhardy commented Jul 12, 2018

Hi Frank,

You're right, this is probably very niche in usage. This is my original attempt to build a universal PRNG seeder; I also experimented with the Keccak team's KangarooTwelve. I don't want to include a complete hash function in rand or rand_core though, so tacking the functionality required onto an existing crate has some sense. Alternatively maybe I should create a new crate for this.

I suspect SipHash's core will work fine as a stream cipher, though I guess I should at least pass the output through PractRand.

It's also terrible code style using so many raw pointers, but this was more a proof of concept (I tried to use split_at_mut but had lifetime issues).

I pushed a second commit which is more generally applicable. BTW you really ought to add CI tests on a BE platform (e.g. like this; it also needs the global install and script commands). I believe both versions of the function are correct however.

@dhardy
Copy link
Author

dhardy commented Jul 15, 2018

Well, I created a new crate instead: rust-random/rand#554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants