From 2e2648a9021dfbb6e17dfa81472f057dacbc34e0 Mon Sep 17 00:00:00 2001 From: Fabian Jahr Date: Thu, 25 Feb 2021 19:09:12 +0100 Subject: 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. --- src/crypto/muhash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/muhash.cpp b/src/crypto/muhash.cpp index e5a0d4cb9c..a2b769cd56 100644 --- a/src/crypto/muhash.cpp +++ b/src/crypto/muhash.cpp @@ -341,6 +341,6 @@ MuHash3072& MuHash3072::Insert(Span in) noexcept { } MuHash3072& MuHash3072::Remove(Span in) noexcept { - m_numerator.Divide(ToNum3072(in)); + m_denominator.Multiply(ToNum3072(in)); return *this; } -- cgit v1.2.3