X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Ftest_cms.py;h=048fafcffe687c4e5fa1834f0b66bcb263cc0c93;hp=98e9e068626ba8e49e8a79c387b094acd4cd6089;hb=ff0ff768110b9bd69d030a1423bad515ea4c32bb;hpb=0fcc8bc147ada51d2a9a912f18ac362d54b7d49a diff --git a/pygost/test_cms.py b/pygost/test_cms.py index 98e9e06..048fafc 100644 --- a/pygost/test_cms.py +++ b/pygost/test_cms.py @@ -20,8 +20,7 @@ from unittest import skipIf from unittest import TestCase from pygost.gost28147 import cfb_decrypt -from pygost.gost3410 import CURVE_PARAMS -from pygost.gost3410 import GOST3410Curve +from pygost.gost3410 import CURVES from pygost.gost3410 import prv_unmarshal from pygost.gost3410 import pub_unmarshal from pygost.gost3410 import public_key @@ -68,7 +67,7 @@ class TestSigned(TestCase): self.assertIsNotNone(content_info["content"].defined) _, signed_data = content_info["content"].defined self.assertEqual(len(signed_data["signerInfos"]), 1) - curve = GOST3410Curve(*CURVE_PARAMS[curve_name]) + curve = CURVES[curve_name] self.assertTrue(verify( curve, public_key(curve, prv_unmarshal(prv_key_raw)), @@ -209,7 +208,7 @@ class TestEnvelopedKTRI(TestCase): spk = encrypted_key["transportParameters"]["ephemeralPublicKey"]["subjectPublicKey"] self.assertIsNotNone(spk.defined) _, pub_key_their = spk.defined - curve = GOST3410Curve(*CURVE_PARAMS[curve_name]) + curve = CURVES[curve_name] kek = keker(curve, prv_key_our, bytes(pub_key_their), ukm) key_wrapped = bytes(encrypted_key["sessionEncryptedKey"]["encryptedKey"]) mac = bytes(encrypted_key["sessionEncryptedKey"]["macKey"]) @@ -385,7 +384,7 @@ class TestEnvelopedKARI(TestCase): _, pub_key_their = kari["originator"]["originatorKey"]["publicKey"].defined ukm = bytes(kari["ukm"]) rek = kari["recipientEncryptedKeys"][0] - curve = GOST3410Curve(*CURVE_PARAMS[curve_name]) + curve = CURVES[curve_name] kek = keker(curve, prv_key_our, bytes(pub_key_their), ukm) self.assertIsNotNone(rek["encryptedKey"].defined) _, encrypted_key = rek["encryptedKey"].defined