-
Notifications
You must be signed in to change notification settings - Fork 128
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
keccak: Optimize Keccak with BMI extension #162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 1643 1652 +9
=========================================
+ Hits 1643 1652 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
8845b2c
to
010e9fe
Compare
typedef void (*ethash_keccakf1600_func)(uint64_t[25]); | ||
|
||
/// The pointer to the Keccak-f[1600] function implementation. | ||
extern ethash_keccakf1600_func ethash_keccakf1600; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of exposing global variable it would look simpler to have another wrapper function like ethash_keccakf1600_best
or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just ethash_keccakf1600
that would call ethash_keccakf1600_best
function pointer inside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this, but that mean call + indirect call instead of just indirect call.
Anyway, don't want to expose keccakf1600
any more. It is convenient for benchmarking only so I will either expose these under some macro KECCAK_EXPORT_INTERNALS
or will just use keccak256(nullptr, 0)
. I'm not sure why I exposed these in the first place.
But I don't want to do it here.
Using BMI and BMI2 instruction set extensions makes Keccak 25% faster.