mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
crypto: Make MuHash Remove method efficient
Division of MuHash objects are very expensive and multiplication relatively cheap. The whole idea of introducing and tracking numerator and denominators seperately as a representation of the internal state was so that divisions would be rare. So using divison in the Remove method did not make any sense and was just a silly mistake which is corrected here.
This commit is contained in:
@@ -341,6 +341,6 @@ MuHash3072& MuHash3072::Insert(Span<const unsigned char> in) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MuHash3072& MuHash3072::Remove(Span<const unsigned char> in) noexcept {
|
MuHash3072& MuHash3072::Remove(Span<const unsigned char> in) noexcept {
|
||||||
m_numerator.Divide(ToNum3072(in));
|
m_denominator.Multiply(ToNum3072(in));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user