# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2017 Sergey Matveev <stargrave@stargrave.org>
#
# 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
class TestVKO34102001(TestCase):
+ def test_vector(self):
+ curve = GOST3410Curve(*CURVE_PARAMS["GostR3410_2001_TestParamSet"])
+ ukm = ukm_unmarshal(hexdec("5172be25f852a233"))
+ prv1 = prv_unmarshal(hexdec("1df129e43dab345b68f6a852f4162dc69f36b2f84717d08755cc5c44150bf928"))
+ prv2 = prv_unmarshal(hexdec("5b9356c6474f913f1e83885ea0edd5df1a43fd9d799d219093241157ac9ed473"))
+ kek = hexdec("ee4618a0dbb10cb31777b4b86a53d9e7ef6cb3e400101410f0c0f2af46c494a6")
+ pub1 = public_key(curve, prv1)
+ pub2 = public_key(curve, prv2)
+ self.assertEqual(kek_34102001(curve, prv1, pub2, ukm), kek)
+ self.assertEqual(kek_34102001(curve, prv2, pub1, ukm), kek)
+
def test_sequence(self):
curve = GOST3410Curve(*CURVE_PARAMS["GostR3410_2001_TestParamSet"])
for _ in range(10):
class TestVKO34102012256(TestCase):
- """http://tc26.ru/methods/recommendation/%D0%A2%D0%9A26%D0%90%D0%9B%D0%93.pdf test vectors
+ """RFC 7836
"""
def test_vector(self):
curve = GOST3410Curve(*CURVE_PARAMS["GostR3410_2012_TC26_ParamSetA"])
class TestVKO34102012512(TestCase):
- """http://tc26.ru/methods/recommendation/%D0%A2%D0%9A26%D0%90%D0%9B%D0%93.pdf test vectors
+ """RFC 7836
"""
def test_vector(self):
curve = GOST3410Curve(*CURVE_PARAMS["GostR3410_2012_TC26_ParamSetA"])