mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-04 04:29:01 +00:00
Optimized RIPEMD160 #788
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#788
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Aug 25, 2021).
We use
golang.org/x/crypto/ripemd160which is cross-platform, but doesn't have and won't have any optimized platform-specific version of the hash. Surprisingly, even though everyone and their dog in crypto space are using RIPEMD160 there are no asm implementations of it in Go. And even in C there is just ia-32 implementation in openssl. So either generic implementation is compiled into perfect assembly and optimizing it makes no sense (but it is slower than SHA256 in the profiler, so I doubt that), or no one really tried.It'd be interesting to check this and try to make some amd64 version.
Even though it's not exactly a bottleneck every script we have gets hashed with SHA256 and then RIPEMD160, so the number of hashes we do is quite substantial and having an optimized version can't hurt.