aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/muhash.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/test_framework/muhash.py')
-rw-r--r--test/functional/test_framework/muhash.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/functional/test_framework/muhash.py b/test/functional/test_framework/muhash.py
index 183548f71f..0d96114e3e 100644
--- a/test/functional/test_framework/muhash.py
+++ b/test/functional/test_framework/muhash.py
@@ -6,8 +6,6 @@
import hashlib
import unittest
-from .util import modinv
-
def rot32(v, bits):
"""Rotate the 32-bit value v left by bits bits."""
bits %= 32 # Make sure the term below does not throw an exception
@@ -88,7 +86,7 @@ class MuHash3072:
def digest(self):
"""Extract the final hash. Does not modify this object."""
- val = (self.numerator * modinv(self.denominator, self.MODULUS)) % self.MODULUS
+ val = (self.numerator * pow(self.denominator, -1, self.MODULUS)) % self.MODULUS
bytes384 = val.to_bytes(384, 'little')
return hashlib.sha256(bytes384).digest()