test:
PYTHONPATH=.. $(PYTHON) -m unittest test_gost28147
PYTHONPATH=.. $(PYTHON) -m unittest test_gost28147_mac
- PYTHONPATH=.. $(PYTHON) -m unittest test_gost3411_94
- PYTHONPATH=.. $(PYTHON) -m unittest test_gost3411_2012
+ PYTHONPATH=.. $(PYTHON) -m unittest test_gost341194
+ PYTHONPATH=.. $(PYTHON) -m unittest test_gost34112012
PYTHONPATH=.. $(PYTHON) -m unittest test_gost3410
PYTHONPATH=.. $(PYTHON) -m unittest test_gost3410_vko
PYTHONPATH=.. $(PYTHON) -m unittest test_wrap
from pygost.gost3410 import pub_marshal
-from pygost.gost3411_2012_256 import GOST34112012256
-from pygost.gost3411_2012_512 import GOST34112012512
-from pygost.gost3411_94 import GOST341194
+from pygost.gost34112012256 import GOST34112012256
+from pygost.gost34112012512 import GOST34112012512
+from pygost.gost341194 import GOST341194
from pygost.utils import bytes2long
taken according to specification's terminology.
"""
-from gost3411_2012 import GOST34112012
+from gost34112012 import GOST34112012
class GOST34112012256(GOST34112012):
taken according to specification's terminology.
"""
-from gost3411_2012 import GOST34112012
+from gost34112012 import GOST34112012
class GOST34112012512(GOST34112012):
--- /dev/null
+class GOST34112012256:
+ def __init__(self, data: bytes=...) -> None: ...
+
+ @property
+ def digest_size(self) -> int: ...
+
+ def copy(self) -> "GOST34112012256": ...
+
+ def update(self, data: bytes) -> None: ...
+
+ def digest(self) -> bytes: ...
+
+ def hexdigest(self) -> str: ...
--- /dev/null
+class GOST34112012512:
+ def __init__(self, data: bytes=...) -> None: ...
+
+ @property
+ def digest_size(self) -> int: ...
+
+ def copy(self) -> "GOST34112012512": ...
+
+ def update(self, data: bytes) -> None: ...
+
+ def digest(self) -> bytes: ...
+
+ def hexdigest(self) -> str: ...
from unittest import TestCase
import hmac
-from pygost import gost3411_2012_256
-from pygost import gost3411_2012_512
-from pygost.gost3411_2012_256 import GOST34112012256
-from pygost.gost3411_2012_512 import GOST34112012512
+from pygost import gost34112012256
+from pygost import gost34112012512
+from pygost.gost34112012256 import GOST34112012256
+from pygost.gost34112012512 import GOST34112012512
from pygost.utils import hexdec
"""http://tc26.ru/methods/recommendation/%D0%A2%D0%9A26%D0%90%D0%9B%D0%93.pdf test vectors
"""
def test_256(self):
- for digestmod in (GOST34112012256, gost3411_2012_256):
+ for digestmod in (GOST34112012256, gost34112012256):
self.assertEqual(
hmac.new(
key=hexdec("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"),
)
def test_512(self):
- for digestmod in (GOST34112012512, gost3411_2012_512):
+ for digestmod in (GOST34112012512, gost34112012512):
self.assertEqual(
hmac.new(
key=hexdec("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"),
from unittest import TestCase
import hmac
-from pygost import gost3411_94
-from pygost.gost3411_94 import GOST341194
+from pygost import gost341194
+from pygost.gost341194 import GOST341194
from pygost.utils import bytes2long
from pygost.utils import hexenc
from pygost.utils import long2bytes
class TestHMACPEP247(TestCase):
def runTest(self):
- h = hmac.new(b"foo", digestmod=gost3411_94)
+ h = hmac.new(b"foo", digestmod=gost341194)
h.update(b"foobar")
h.digest()