]> Cypherpunks.ru repositories - pygost.git/commitdiff
Rename Kuz to Kuznechik for clarity
authorSergey Matveev <stargrave@stargrave.org>
Sat, 10 Jun 2017 19:59:15 +0000 (22:59 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 10 Jun 2017 19:59:15 +0000 (22:59 +0300)
NEWS
VERSION
pygost/gost3412.py
pygost/stubs/pygost/gost3412.pyi
pygost/test_gost3412.py
pygost/test_gost3413.py
www.texi

diff --git a/NEWS b/NEWS
index 7298105b970cab46cb9ef6cb438685f1bcb4ccb8..fd1faa5f55d554280cfc5e541c2bba5b1747b4a1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+3.3:
+    * GOST3412Kuz renamed to GOST3412Kuznezhik
+
 3.2:
     34.13-2015 block cipher modes of operation implementations.
 
diff --git a/VERSION b/VERSION
index a3ec5a4bd3d7209b4a687a77cad49b945339994b..eb39e5382f4f035e4d71c7f67712cdbfa6c0c335 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.2
+3.3
index 48919c2fefad7da79057a90d1482da5174f9a816..663318609d47d0d0214e2f907263a730d7d525c5 100644 (file)
@@ -121,7 +121,7 @@ def lp(blk):
     return L([PI[v] for v in blk])
 
 
-class GOST3412Kuz(object):
+class GOST3412Kuznechik(object):
     """GOST 34.12-2015 128-bit block cipher Кузнечик (Kuznechik)
     """
     def __init__(self, key):
index 5b177435238df71c634c3104398d310f4e1a2108..c67a7daa7c9c7c682e783a180a4d19368283e0b8 100644 (file)
@@ -1,4 +1,4 @@
-class GOST3412Kuz(object):
+class GOST3412Kuznechik(object):
     def __init__(self, key: bytes) -> None: ...
 
     def encrypt(self, blk: bytes) -> bytes: ...
index e7138b3c6aa5dbc2b708eb05149880ba58faaffe..6ab4c90d7076de2e3cc2e1d7a31cd7737afc681d 100644 (file)
@@ -18,7 +18,7 @@
 from unittest import TestCase
 
 from pygost.gost3412 import C
-from pygost.gost3412 import GOST3412Kuz
+from pygost.gost3412 import GOST3412Kuznechik
 from pygost.gost3412 import L
 from pygost.gost3412 import PI
 from pygost.utils import hexdec
@@ -102,7 +102,7 @@ class KuznechikTest(TestCase):
         self.assertEqual(C[7], hexdec("f6593616e6055689adfba18027aa2a08"))
 
     def test_roundkeys(self):
-        ciph = GOST3412Kuz(self.key)
+        ciph = GOST3412Kuznechik(self.key)
         self.assertEqual(ciph.ks[0], hexdec("8899aabbccddeeff0011223344556677"))
         self.assertEqual(ciph.ks[1], hexdec("fedcba98765432100123456789abcdef"))
         self.assertEqual(ciph.ks[2], hexdec("db31485315694343228d6aef8cc78c44"))
@@ -115,9 +115,9 @@ class KuznechikTest(TestCase):
         self.assertEqual(ciph.ks[9], hexdec("72e9dd7416bcf45b755dbaa88e4a4043"))
 
     def test_encrypt(self):
-        ciph = GOST3412Kuz(self.key)
+        ciph = GOST3412Kuznechik(self.key)
         self.assertEqual(ciph.encrypt(self.plaintext), self.ciphertext)
 
     def test_decrypt(self):
-        ciph = GOST3412Kuz(self.key)
+        ciph = GOST3412Kuznechik(self.key)
         self.assertEqual(ciph.decrypt(self.ciphertext), self.plaintext)
index 5e3a39b87397bfbcc0c62e0dda738a75e620572a..31a56f3203f9ad55c5237c625b05bfbadd9343f8 100644 (file)
@@ -2,7 +2,7 @@ from os import urandom
 from random import randint
 from unittest import TestCase
 
-from pygost.gost3412 import GOST3412Kuz
+from pygost.gost3412 import GOST3412Kuznechik
 from pygost.gost3413 import _mac_ks
 from pygost.gost3413 import cbc_decrypt
 from pygost.gost3413 import cbc_encrypt
@@ -30,9 +30,9 @@ class Pad2Test(TestCase):
                 )
 
 
-class GOST3412KuzModesTest(TestCase):
+class GOST3412KuznechikModesTest(TestCase):
     key = hexdec("8899aabbccddeeff0011223344556677fedcba98765432100123456789abcdef")
-    ciph = GOST3412Kuz(key)
+    ciph = GOST3412Kuznechik(key)
     plaintext = ""
     plaintext += "1122334455667700ffeeddccbbaa9988"
     plaintext += "00112233445566778899aabbcceeff0a"
@@ -58,7 +58,7 @@ class GOST3412KuzModesTest(TestCase):
     def test_ecb_symmetric(self):
         for _ in range(100):
             pt = pad2(urandom(randint(0, 16 * 2)), 16)
-            ciph = GOST3412Kuz(urandom(32))
+            ciph = GOST3412Kuznechik(urandom(32))
             ct = ecb_encrypt(ciph.encrypt, 16, pt)
             self.assertSequenceEqual(ecb_decrypt(ciph.decrypt, 16, ct), pt)
 
@@ -82,7 +82,7 @@ class GOST3412KuzModesTest(TestCase):
         for _ in range(100):
             pt = urandom(randint(0, 16 * 2))
             iv = urandom(8)
-            ciph = GOST3412Kuz(urandom(32))
+            ciph = GOST3412Kuznechik(urandom(32))
             ct = ctr(ciph.encrypt, 16, pt, iv)
             self.assertSequenceEqual(ctr(ciph.encrypt, 16, ct, iv), pt)
 
@@ -105,7 +105,7 @@ class GOST3412KuzModesTest(TestCase):
         for _ in range(100):
             pt = urandom(randint(0, 16 * 2))
             iv = urandom(16 * 2)
-            ciph = GOST3412Kuz(urandom(32))
+            ciph = GOST3412Kuznechik(urandom(32))
             ct = ofb(ciph.encrypt, 16, pt, iv)
             self.assertSequenceEqual(ofb(ciph.encrypt, 16, ct, iv), pt)
 
@@ -128,7 +128,7 @@ class GOST3412KuzModesTest(TestCase):
         for _ in range(100):
             pt = pad2(urandom(randint(0, 16 * 2)), 16)
             iv = urandom(16 * 2)
-            ciph = GOST3412Kuz(urandom(32))
+            ciph = GOST3412Kuznechik(urandom(32))
             ct = cbc_encrypt(ciph.encrypt, 16, pt, iv)
             self.assertSequenceEqual(cbc_decrypt(ciph.decrypt, 16, ct, iv), pt)
 
@@ -151,7 +151,7 @@ class GOST3412KuzModesTest(TestCase):
         for _ in range(100):
             pt = urandom(randint(0, 16 * 2))
             iv = urandom(16 * 2)
-            ciph = GOST3412Kuz(urandom(32))
+            ciph = GOST3412Kuznechik(urandom(32))
             ct = cfb_encrypt(ciph.encrypt, 16, pt, iv)
             self.assertSequenceEqual(cfb_decrypt(ciph.encrypt, 16, ct, iv), pt)
 
@@ -167,5 +167,5 @@ class GOST3412KuzModesTest(TestCase):
     def test_mac_applies(self):
         for _ in range(100):
             data = urandom(randint(0, 16 * 2))
-            ciph = GOST3412Kuz(urandom(32))
+            ciph = GOST3412Kuznechik(urandom(32))
             mac(ciph.encrypt, 16, data)
index 834b6829dc138bc13e31a339de6adb1870578f73..6cb880b6d6cf47818c6f7baa2810d6118df609b4 100644 (file)
--- a/www.texi
+++ b/www.texi
@@ -89,6 +89,11 @@ mailing list. Announcements also go to this mailing list.
 @unnumbered News
 
 @table @strong
+@item 3.3
+    @itemize
+    @item @code{GOST3412Kuz} renamed to @code{GOST3412Kuznezhik}
+    @end itemize
+
 @item 3.2
 34.13-2015 block cipher modes of operation implementations.