aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/model/python/sha512.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/model/python/sha512.py b/src/model/python/sha512.py
index 672dc73..8bc1793 100755
--- a/src/model/python/sha512.py
+++ b/src/model/python/sha512.py
@@ -257,7 +257,6 @@ class SHA512():
def _T1(self, e, f, g, h, k, w):
T1 = (h + self._sigma1(e) + self._Ch(e, f, g) + k + w) & MAX_64BIT
-
if self.verbose:
print("Inputs, calculations and result for T1:")
print("e = 0x%016x, f = 0x%016x, g = 0x%016x, h = 0x%016x" % (e, f, g, h))
@@ -265,12 +264,18 @@ class SHA512():
print("Ch = 0x%016x, sigma1 = 0x%016x" % (self._Ch(e, f, g), self._sigma1(e)))
print("T1 = 0x%016x" % (T1))
print()
-
return T1
def _T2(self, a, b, c):
- return (self._sigma0(a) + self._Maj(a, b, c)) & MAX_64BIT
+ T2 = (self._sigma0(a) + self._Maj(a, b, c)) & MAX_64BIT
+ if self.verbose:
+ print("Inputs, calculations and result for T2:")
+ print("a = 0x%016x, b = 0x%016x, c = 0x%016x" % (a, b, c))
+ print("Maj = 0x%016x, sigma0 = 0x%016x" % (self._Maj(a, b, c), self._sigma0(a)))
+ print("T2 = 0x%016x" % (T2))
+ print()
+ return T2
def _rotr64(self, n, r):