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

Use the SHA-3 implementation from tiny-keccak #163

Merged
merged 1 commit into from
Jun 2, 2017

Conversation

mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Jun 2, 2017

This is faster than the implementation in rust-crypto, has fewer dependencies, and is more actively maintained.

This is faster than the implementation in rust-crypto, has fewer
dependencies, and is more actively maintained.
@CLAassistant
Copy link

CLAassistant commented Jun 2, 2017

CLA assistant check
All committers have signed the CLA.

@sorpaas sorpaas merged commit ab6af1c into ETCDEVTeam:master Jun 2, 2017
@sorpaas
Copy link
Contributor

sorpaas commented Jun 2, 2017

Thanks @mbrubeck!

@coveralls
Copy link

coveralls commented Jun 2, 2017

Coverage Status

Coverage remained the same at 76.27% when pulling a4d9923 on mbrubeck:sha3 into 8669a90 on ethereumproject:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 76.27% when pulling a4d9923 on mbrubeck:sha3 into 8669a90 on ethereumproject:master.

@newpavlov
Copy link

I was a bit late, but if you are interested I can create PR with the sha3 crate instead of tiny-keccak. It's a bit faster asymptotically (at least on my machines) and is part of the bigger project.

@sjmackenzie
Copy link
Contributor

sjmackenzie commented Jun 2, 2017

Thanks @mbrubeck, @newpavlov please read the CONTRIBUTING.md file (currently it's pointing at the incorrect domain but there are two processes called 1/C4 and 2/COSS here: www.github.com/ethereumproject/rfc) You will see that you do not need to ask permission, please join in and contribute your patches, they will be merged quickly. @mbrubeck as you've made a patch, could you please read over 1/C4 and if you agree to working according to 1/C4, i'd like to extend an invitation to you to join the sputnikvm maintainers group.

@sorpaas
Copy link
Contributor

sorpaas commented Jun 2, 2017

@newpavlov We're currently using keccak for two occasions. The first one is to hash an address (20 bytes) together with a nonce (32 bytes), using RLP. That is something around ~52 bytes (a few additional bytes are there due to RLP). The second one is the SHA3 opcode, which hashes exact 32 bytes. According to debris/tiny-keccak#14, it seems that when hashing smaller amount of bytes (around 32), tinny-keccak is faster than sha3?

But please feel free to create an issue or a PR. We can do some banchmark!

@newpavlov
Copy link

Yes, for 52 bytes input tiny-keccak is faster by 40-50 ns on my laptop (802 vs 844). I did not see this difference substantial, so I have not investigated how to make it run faster. Copying data to buffer and running keccak's f directly results in the ~750 ns.

@ghost
Copy link

ghost commented Jun 2, 2017

@newpavlov we also look to an alternative to rust-crypto for our anouther project emerald-rs, so thank you. I will look at source code and choice more transparent impl.

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.

None yet

6 participants