]> Cypherpunks.ru repositories - pygost.git/commitdiff
Hexadecimal is more convenient
authorSergey Matveev <stargrave@stargrave.org>
Fri, 4 Sep 2020 18:32:12 +0000 (21:32 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 4 Sep 2020 18:32:12 +0000 (21:32 +0300)
pygost/gost28147.py

index 25c0f506a28d35b00fefc5e38c7416a6054d49f9..b7fc0f46634d5589cb41b3bdef10feff8d2e4c84 100644 (file)
@@ -181,8 +181,8 @@ def ns2block(ns):
     """
     n1, n2 = ns
     return bytes(bytearray((
-        (n2 >> 0) & 255, (n2 >> 8) & 255, (n2 >> 16) & 255, (n2 >> 24) & 255,
-        (n1 >> 0) & 255, (n1 >> 8) & 255, (n1 >> 16) & 255, (n1 >> 24) & 255,
+        (n2 >> 0) & 0xFF, (n2 >> 8) & 0xFF, (n2 >> 16) & 0xFF, (n2 >> 24) & 0xFF,
+        (n1 >> 0) & 0xFF, (n1 >> 8) & 0xFF, (n1 >> 16) & 0xFF, (n1 >> 24) & 0xFF,
     )))