This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Port Marvin hash code to CoreRT#3233
Merged
1 commit merged intonmirrorfrom Apr 6, 2017
unknown repository
Merged
Conversation
Fix #2588 Port of SymCryptMarvin32() from marvin.cpp. https://github.com/dotnet/coreclr/blob/master/src/vm/marvin32.cpp#L219 - Tested on various seeds and data arrays up to 30 bytes long. (test data obtained by hacking CoreCLR to get test data with deterministic seeds.) - s0/s1 renamed to p0/p1 (for more consistency with algorithm description in patent.) - Verified that NUTC generates fully inlined code for Marving.ComputeHashString() (including reducing _rotl to rol or ror.) - Marvin specifies interpreting bytes in little-endian fashion - if this code ever runs on a big-endian machine, the result is probably not Marvin (though I can see how it's any less useful for the way we use it.) - This is not turned on by default (we don't yet have a switch to turn on randomized string hashing in CoreRT).
jkotas
reviewed
Apr 7, 2017
|
|
||
| default: | ||
| Debug.Fail("Should not get here."); | ||
| throw new InvalidOperationException(); |
Member
There was a problem hiding this comment.
@atsushikan Debug.Fail should be sufficient here. I do not think we should be adding unreachable throws.
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #2588
Port of SymCryptMarvin32() from marvin.cpp.
https://github.com/dotnet/coreclr/blob/master/src/vm/marvin32.cpp#L219
Tested on various seeds and data arrays up to 30 bytes long.
(test data obtained by hacking CoreCLR to get test data with deterministic
seeds.)
s0/s1 renamed to p0/p1 (for more consistency with algorithm description
in patent.)
Verified that NUTC generates fully inlined code for Marving.ComputeHashString()
(including reducing _rotl to rol or ror.)
Marvin specifies interpreting bytes in little-endian fashion - if this code
ever runs on a big-endian machine, the result is probably not Marvin
(though I can see how it's any less useful for the way we use it.)
This is not turned on by default (we don't yet have a switch to turn
on randomized string hashing in CoreRT).