X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Ftest_gost3410_vko.py;h=7ca1163ddc174d0819b8b14bc4583ba91541ae15;hb=fbaa1fc82dbec2c3ebaf8d272600ef4f91649e08;hp=83053500cd38bd8d5dedfe042a75d46663954c26;hpb=82af8726ef5d5e2752089a45750e56c9910398c7;p=pygost.git diff --git a/pygost/test_gost3410_vko.py b/pygost/test_gost3410_vko.py index 8305350..7ca1163 100644 --- a/pygost/test_gost3410_vko.py +++ b/pygost/test_gost3410_vko.py @@ -1,6 +1,6 @@ # coding: utf-8 # PyGOST -- Pure Python GOST cryptographic functions library -# Copyright (C) 2015-2020 Sergey Matveev +# Copyright (C) 2015-2024 Sergey Matveev # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ class TestVKO34102012256(TestCase): self.assertSequenceEqual(kek_34102012256(curve, prvB, pubA, ukm), vko) def test_sequence(self): - curve = CURVES["id-tc26-gost-3410-12-512-paramSetA"] + curve = CURVES["id-tc26-gost-3410-2012-256-paramSetA"] for _ in range(10): ukm = ukm_unmarshal(urandom(8)) prv1 = bytes2long(urandom(32)) @@ -86,6 +86,14 @@ class TestVKO34102012256(TestCase): kek2 = kek_34102012256(curve, prv2, pub2, ukm) self.assertNotEqual(kek1, kek2) + def test_pub_is_not_on_curve(self): + with self.assertRaises(ValueError): + kek_34102012256( + CURVES["id-tc26-gost-3410-2012-256-paramSetA"], + bytes2long(urandom(32)), + pub_unmarshal(urandom(64)), + ) + class TestVKO34102012512(TestCase): """RFC 7836