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

Domain separator during merge #40

Merged
merged 2 commits into from
Jan 23, 2023
Merged

Domain separator during merge #40

merged 2 commits into from
Jan 23, 2023

Conversation

0xkanekiken
Copy link
Contributor

Describe your changes

This PR addresses #35. It introduces a new method merge_in_domain as mentioned by @bobbinth here when impl Rpo256.

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality.
  • Documentation/comments updated according to changes.

Copy link
Contributor

@grjte grjte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @0xkanekiken looks to me good overall! Just a few small things inline

src/hash/rpo/mod.rs Outdated Show resolved Hide resolved
src/hash/rpo/tests.rs Outdated Show resolved Hide resolved
src/hash/rpo/tests.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thank you!

src/hash/rpo/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: 0xKanekiKen <100861945+0xKanekiKen@users.noreply.github.com>
@0xkanekiken 0xkanekiken force-pushed the kaneki-domain-separator branch 2 times, most recently from 7bc816f to f0d0ad9 Compare January 23, 2023 16:39
@0xkanekiken
Copy link
Contributor Author

Thanks @grjte and @Al-Kindi-0 for the review. I've worked on your suggestions.

@0xkanekiken 0xkanekiken requested review from Al-Kindi-0 and grjte and removed request for Al-Kindi-0 January 23, 2023 16:57
Copy link
Contributor

@grjte grjte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! I'd prefer to update the one doc comment from "separator" to "identifier", but I won't block it over that. I'll leave it to you to merge, and you can make that change if you want.

Signed-off-by: 0xKanekiKen <100861945+0xKanekiKen@users.noreply.github.com>
@0xkanekiken
Copy link
Contributor Author

Thanks! I've updated the doc string.

@0xkanekiken 0xkanekiken merged commit 6de7730 into next Jan 23, 2023
@0xkanekiken 0xkanekiken deleted the kaneki-domain-separator branch January 23, 2023 20:20
@@ -51,6 +52,40 @@ fn hash_elements_vs_merge() {
assert_eq!(m_result, h_result);
}

#[test]
fn hash_elements_vs_merge_in_domain() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name of this test is a bit confusing: we are not testing whether hash_elements() produces a different result from merge_in_domain() but rather if merge_in_domain() is valid. So, I would probably rename this test to merge_in_domain().

Also, I wonder if we can replace this test with tests which do the following:

  • merge() and merge_in_domain() give the same result when domain is ZERO.
  • merge_in_domain() gives two different results if the domains are different.

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.

4 participants