X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fgost3410.py;h=50f3d00b0e05e02f25eabe9d6047cc5b1349a87c;hb=cf0e4b011863b11ccaba5fbcd9566cafbd130398;hp=77637c31b534e28c30bd972755a89b5a45567f02;hpb=4b7fd2c1923d5803afe1b078727ee68624430af9;p=pygost.git diff --git a/pygost/gost3410.py b/pygost/gost3410.py index 77637c3..50f3d00 100644 --- a/pygost/gost3410.py +++ b/pygost/gost3410.py @@ -1,6 +1,6 @@ # coding: utf-8 # PyGOST -- Pure Python GOST cryptographic functions library -# Copyright (C) 2015-2016 Sergey Matveev +# Copyright (C) 2015-2018 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 @@ -162,9 +162,9 @@ class GOST3410Curve(object): y = y or self.y tx = x ty = y - degree -= 1 if degree == 0: raise ValueError("Bad degree value") + degree -= 1 while degree != 0: if degree & 1 == 1: tx, ty = self._add(tx, ty, x, y) @@ -178,7 +178,7 @@ def public_key(curve, prv): :param GOST3410Curve curve: curve to use :param long prv: private key - :return: public key's parts, X and Y + :returns: public key's parts, X and Y :rtype: (long, long) """ return curve.exp(prv) @@ -191,7 +191,7 @@ def sign(curve, prv, digest, mode=2001): :param long prv: private key :param digest: digest for signing :type digest: bytes, 32 or 64 bytes - :return: signature + :returns: signature :rtype: bytes, 64 or 128 bytes """ size = MODE2SIZE[mode]