]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost3410.pyi
MODE2SIZE in typing stub
[pygost.git] / pygost / stubs / pygost / gost3410.pyi
1 from typing import Dict
2 from typing import Tuple
3
4
5 DEFAULT_CURVE = ...  # type: str
6 CURVE_PARAMS = ...  # type: Dict[str, Tuple[bytes, bytes, bytes, bytes, bytes, bytes]]
7 MODE2SIZE = ...  # type: Dict[int, int]
8 PublicKey = Tuple[int, int]
9
10
11 class GOST3410Curve(object):
12     p = ...  # type: int
13     q = ...  # type: int
14     a = ...  # type: int
15     b = ...  # type: int
16     x = ...  # type: int
17     y = ...  # type: int
18
19     def __init__(
20         self, p: bytes, q: bytes, a: bytes, b: bytes, x: bytes, y: bytes
21     ) -> None: ...
22
23     def exp(self, degree: int, x: int=..., y: int=...) -> int: ...
24
25
26 def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...
27
28
29 def sign(curve: GOST3410Curve, prv: int, digest: bytes, mode: int=...) -> bytes: ...
30
31
32 def verify(
33     curve: GOST3410Curve,
34     pub: PublicKey,
35     digest: bytes,
36     signature: bytes,
37     mode: int=...,
38 ) -> bool: ...
39
40
41 def prv_unmarshal(prv: bytes) -> int: ...
42
43
44 def pub_marshal(pub: PublicKey, mode: int=...) -> bytes: ...
45
46
47 def pub_unmarshal(pub: bytes, mode: int=...) -> PublicKey: ...