# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2021 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2024 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
from pygost.gost3410 import CURVES
from pygost.gost3410 import GOST3410Curve
+from pygost.gost3410 import prv_marshal
+from pygost.gost3410 import prv_unmarshal
from pygost.gost3410 import public_key
from pygost.gost3410 import sign
from pygost.gost3410 import uv2xy
def test_sequence(self):
c = CURVES["id-GostR3410-2001-TestParamSet"]
- prv = bytes2long(urandom(32))
- pubX, pubY = public_key(c, prv)
+ prv = prv_unmarshal(urandom(32))
+ pubX, pubY = public_key(c, prv_unmarshal(prv_marshal(c, prv)))
for _ in range(20):
digest = urandom(32)
s = sign(c, prv, digest)
def test_sequence(self):
c = CURVES["id-tc26-gost-3410-12-512-paramSetA"]
prv = bytes2long(urandom(64))
- pubX, pubY = public_key(c, prv)
+ pubX, pubY = public_key(c, prv_unmarshal(prv_marshal(c, prv)))
for _ in range(20):
digest = urandom(64)
s = sign(c, prv, digest)