[Cryptech-Commits] [core/hash/sha512] branch clock_speed updated: Added support for dumping T2 inputs and calculations.

git at cryptech.is git at cryptech.is
Fri Apr 6 11:42:55 UTC 2018


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch clock_speed
in repository core/hash/sha512.

The following commit(s) were added to refs/heads/clock_speed by this push:
     new 69cebd6  Added support for dumping T2 inputs and calculations.
69cebd6 is described below

commit 69cebd617e1a2ad8eadde7e8c813a4b0c53705bb
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Fri Apr 6 13:42:43 2018 +0200

    Added support for dumping T2 inputs and calculations.
---
 src/model/python/sha512.py | 11 ++++++++---
 1 file 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):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list