]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost3410.pyi
Fix mypy stubs
[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 PublicKey = Tuple[int, int]
7
8
9 class GOST3410Curve(object):
10     p = ...  # type: int
11     q = ...  # type: int
12     a = ...  # type: int
13     b = ...  # type: int
14     x = ...  # type: int
15     y = ...  # type: int
16
17     def __init__(
18         self, p: bytes, q: bytes, a: bytes, b: bytes, x: bytes, y: bytes
19     ) -> None: ...
20
21     def exp(self, degree: int, x: int=..., y: int=...) -> int: ...
22
23
24 def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...
25
26
27 def sign(curve: GOST3410Curve, prv: int, digest: bytes, mode: int=...) -> bytes: ...
28
29
30 def verify(
31     curve: GOST3410Curve,
32     pub: PublicKey,
33     digest: bytes,
34     signature: bytes,
35     mode: int=...,
36 ) -> bool: ...
37
38
39 def prv_unmarshal(prv: bytes) -> int: ...
40
41
42 def pub_marshal(pub: PublicKey, mode: int=...) -> bytes: ...
43
44
45 def pub_unmarshal(pub: bytes, mode: int=...) -> PublicKey: ...