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

Compatibility with RustCrypto #2

Merged
merged 1 commit into from
Sep 21, 2021
Merged

Compatibility with RustCrypto #2

merged 1 commit into from
Sep 21, 2021

Conversation

daxpedda
Copy link
Collaborator

@daxpedda daxpedda commented Sep 21, 2021

Hi!

This PR makes a couple of changes with the goal to make this library compatible with an upcoming Rust implementation in RustCrypto: RustCrypto/password-hashes#232

There are really only two changes required that intend to bring the implementation closer to the research paper/prototype implementation:

  1. Values are currently all converted to UTF-8 strings before being hashed, the change improves on that by converting all integers to little-endian 64-bit byte representation and values that are already bytes are passed through instead of converted to strings.
  2. The research paper mentions a ints_to_block function, but otherwise doesn't go into detail what this is. The prototype implementation uses encryption to create a byte "block" of these values. I have decided to simply hash them with the selected hash. Alternatively it may be valuable to always use SHA-1 here as this part isn't really cryptographically important and it could avoid any increased cost by "slower" hashes.

I'm open to any suggestions!

@nachonavarro
Copy link
Owner

Hey @daxpedda this is great! Thank you for taking the time, I'll merge now.

@nachonavarro nachonavarro merged commit 7a89523 into nachonavarro:master Sep 21, 2021
@daxpedda
Copy link
Collaborator Author

Amazing, thank you!

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