]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost3410.pyi
Use public key tuple as an argument for convenience
[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, private_key: int) -> PublicKey: ...
25
26
27 def sign(
28     curve: GOST3410Curve,
29     private_key: int,
30     digest: bytes,
31     size: int=...,
32 ) -> bytes: ...
33
34
35 def verify(
36     curve: GOST3410Curve,
37     pub: PublicKey,
38     digest: bytes,
39     signature: bytes,
40     size: int=...,
41 ) -> bool: ...
42
43
44 def prv_unmarshal(private_key: bytes) -> int: ...
45
46
47 def pub_marshal(pub: PublicKey, mode: int) -> bytes: ...
48
49
50 def pub_unmarshal(pub: bytes, mode: int) -> PublicKey: ...