hashsplit / hashsplit-spec

The Unlicense
7 stars 3 forks source link

rrs: fix use of rotation parameter #6

Closed cole-miller closed 4 years ago

cole-miller commented 4 years ago

Currently the spec performs rotation by multiplying by 2^R, which leaves zero bits on the right side of the bit vector. This is fixed by giving a correct definition of left rotation (hopefully I remembered the right LaTeX symbols). Please feel free to change the notation/presentation if it doesn't match the style you're going for.

I had the thought that the rotation parameter R could be replaced by a binary option, call it "style", that indicates which convention (rrs0 or rrs1) should be used; but I decided to stick with the smaller change for this PR.

cole-miller commented 4 years ago

(Sorry for the flurry of contributions; I happen to have a lot of free time right now.)

zenhack commented 4 years ago

Derp, for some reason I was thinking the mod 2^32 would cover that, but you're right.

(Why on earth would you apologize for helping? This is great, keep it up!)

I think especially as we expand the spec to cover the full hash splitting algorithm, and maybe a couple other hashes, there will be other functions like this that we'll want defined, and we probably should just have a section up at the top with basic notation like this; it's a bit odd having something as basic as a rotate defined in the middle of a section about a hash function.

zenhack commented 4 years ago

Merged, and made some changes on top, including moving stuff to a 'Notation' section. Thanks!