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

Specify initial ring buffer contents when rolling #20

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

cole-miller
Copy link
Contributor

@cole-miller cole-miller commented Oct 7, 2020

As discussed in #11, requiring the ring buffer to be zeroed means that checksum values emitted before W bytes have been consumed are fully determined by the input data, so there's no need to protect callers of the hashsplitting routine by disallowing splitting in this region.

Closes #11

@zenhack
Copy link
Collaborator

zenhack commented Oct 7, 2020

Hm, this doesn't really do what was intended, since it doesn't touch the declarative description of the hash function, only the implementation notes; the way the declarative version is described still doesn't define what the hash would be for a a window that started in the negative.

As an aside, perhaps we should explicitly mark sections of the spec as "normative" or "non-normative"; this language is used by some standards bodies to indicate whether a section is prescriptive in terms of conformance or just additional guidance. In this case the "Implementation" section is non-normative, since it's intended to provide guidance to implementers, but doesn't authoritatively define the function.

I think if we were to stick with the constraint W <= S_min, the implementation section might be a good place to spell out why, as it has implications for that.

This allows us to remove the restriction `S_min >= W`, since the
checksum values produced before `W` bytes have been consumed are now
precisely determined.
@cole-miller
Copy link
Contributor Author

Hm, this doesn't really do what was intended, since it doesn't touch the declarative description of the hash function, only the implementation notes

Yep, this was my oversight. It should be repaired now.

I don't have a strong opinion about splitting normative from non-normative language.

@zenhack zenhack merged commit 2bdf062 into hashsplit:master Oct 7, 2020
@zenhack
Copy link
Collaborator

zenhack commented Oct 7, 2020

Merged this locally and tacked on a commit that adds a 'non-negative' constraint to i (since a negative i is possibly defined now, depending on the hash function...). Thanks!

@cole-miller cole-miller deleted the zero-ring-buffer branch October 7, 2020 22:34
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.

Add rationale re: requiring W <= Smin
2 participants