# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2019 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
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)
: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)
: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]