-
Notifications
You must be signed in to change notification settings - Fork 223
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
Replace ECMH with Muhash #1624
Replace ECMH with Muhash #1624
Conversation
Codecov Report
@@ Coverage Diff @@
## v0.10.0-dev #1624 +/- ##
===============================================
- Coverage 59.97% 59.92% -0.06%
===============================================
Files 516 516
Lines 20471 20469 -2
===============================================
- Hits 12278 12266 -12
- Misses 6238 6246 +8
- Partials 1955 1957 +2
Continue to review full report at Codecov.
|
domain/dagconfig/genesis.go
Outdated
@@ -101,10 +102,10 @@ var devnetGenesisBlock = externalapi.DomainBlock{ | |||
[]*externalapi.DomainHash{}, | |||
devnetGenesisMerkleRoot, | |||
&externalapi.DomainHash{}, | |||
&externalapi.DomainHash{}, | |||
externalapi.NewDomainHashFromByteArray((*[32]byte)(&muhash.EmptyMuHashHash)), |
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.
It could be nice if Hash would have .ToArray()
or something to save the (*[32]byte)
ugliness
@@ -21,28 +22,27 @@ func (m multiset) Remove(data []byte) { | |||
|
|||
func (m multiset) Hash() *externalapi.DomainHash { | |||
finalizedHash := m.ms.Finalize() | |||
finalizedHashAsByteArray := (*[secp256k1.HashSize]byte)(finalizedHash) | |||
return externalapi.NewDomainHashFromByteArray(finalizedHashAsByteArray) | |||
finalizedHashAsByteArray := ([secp256k1.HashSize]byte)(finalizedHash) |
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.
You can use .AsArray here I think
On my machine(without turbo 2.4Ghz), ECMH:
MuHash:
And potentially if we add assembly implementations using SSE2/SSE4.1/AVX this can get even faster.
Note that the MuHash code isn't audited or reviewed and need to be audited before we go to mainnet.