]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost3410.pyi
2.3 release is ready
[pygost.git] / pygost / stubs / pygost / gost3410.pyi
1 from typing import Dict
2 from typing import Tuple
3
4
5 CURVE_PARAMS = ...  # type: Dict[str, Tuple[bytes, bytes, bytes, bytes, bytes, bytes]]
6
7
8 class GOST3410Curve(object):
9     p = ...  # type: int
10     q = ...  # type: int
11     a = ...  # type: int
12     b = ...  # type: int
13     x = ...  # type: int
14     y = ...  # type: int
15
16     def __init__(
17         self, p: bytes, q: bytes, a: bytes, b: bytes, x: bytes, y: bytes
18     ) -> None: ...
19
20     def exp(self, degree: int, x: int=..., y: int=...) -> int: ...
21
22
23 PublicKey = Tuple[int, int]
24
25
26 def public_key(curve: GOST3410Curve, private_key: int) -> PublicKey: ...
27
28
29 def kek(
30     curve: GOST3410Curve,
31     private_key: int,
32     ukm: bytes,
33     pubkey: PublicKey,
34 ) -> bytes: ...
35
36
37 def sign(
38     curve: GOST3410Curve,
39     private_key: int,
40     digest: bytes,
41     size: int=...,
42 ) -> bytes: ...
43
44
45 def verify(
46     curve: GOST3410Curve,
47     pubkeyX: int,
48     pubkeyY: int,
49     digest: bytes,
50     signature: bytes,
51     size: int=...,
52 ) -> bool: ...