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

feat: support Keccak with sha3 #737

Merged
merged 3 commits into from
Sep 18, 2024
Merged

Conversation

xJonathanLEI
Copy link
Contributor

Adds a new feature sha3-keccak to alloy-primitives that when enabled, uses sha3 for Keccak. This can be desirable as in some cases sha3 is faster.

This feature is added in a completely backward-compatible way: tiny-keccak is still the default, and downstream libs/apps will not suddenly start using sha3 by just doing cargo update.

@xJonathanLEI
Copy link
Contributor Author

Yo any update on this?

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm impl wise, pending either @DaniPopes or @mattsse if we want this in

@onbjerg onbjerg added the enhancement New feature or request label Sep 18, 2024
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

tbh not super familiar with the diff, but do they even produce the same hashes?

@onbjerg
Copy link
Member

onbjerg commented Sep 18, 2024

yeah they do produce the same hashes, both crates are impls of https://csrc.nist.gov/pubs/fips/202/final

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

not opposed to it, but defer to @DaniPopes

1 question about activated both feature gated hashers

crates/primitives/src/utils/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Thanks! I've simplified the cfgs by consolidating them into one place

@DaniPopes DaniPopes merged commit 9867b55 into alloy-rs:main Sep 18, 2024
31 checks passed
@xJonathanLEI xJonathanLEI deleted the dev/sha3_keccak branch September 18, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants