]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost3410.pyi
Add GOST3410Curve.point_size property stub
[pygost.git] / pygost / stubs / pygost / gost3410.pyi
1 from typing import Dict
2 from typing import Tuple
3
4
5 DEFAULT_CURVE = ...  # type: GOST3410Curve
6 CURVES = ...  # type: Dict[str, GOST3410Curve]
7 PublicKey = Tuple[int, int]
8
9
10 class GOST3410Curve(object):
11     p = ...  # type: int
12     q = ...  # type: int
13     a = ...  # type: int
14     b = ...  # type: int
15     x = ...  # type: int
16     y = ...  # type: int
17     cofactor = ...  # type: int
18     e = ...  # type: int
19     d = ...  # type: int
20
21     def __init__(
22             self,
23             p: int,
24             q: int,
25             a: int,
26             b: int,
27             x: int,
28             y: int,
29             cofactor: int = 1,
30             e: int = None,
31             d: int = None,
32     ) -> None: ...
33
34     def pos(self, v: int) -> int: ...
35
36     def exp(self, degree: int, x: int=..., y: int=...) -> int: ...
37
38     def st(self) -> Tuple[int, int]: ...
39
40     @property
41     def point_size(self) -> int: ...
42
43
44 def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...
45
46
47 def sign(curve: GOST3410Curve, prv: int, digest: bytes, rand: bytes=None) -> bytes: ...
48
49
50 def verify(curve: GOST3410Curve, pub: PublicKey, digest: bytes, signature: bytes) -> bool: ...
51
52
53 def prv_unmarshal(prv: bytes) -> int: ...
54
55
56 def pub_marshal(pub: PublicKey) -> bytes: ...
57
58
59 def pub_unmarshal(pub: bytes) -> PublicKey: ...
60
61
62 def uv2xy(curve: GOST3410Curve, u: int, v: int) -> Tuple[int, int]: ...
63
64
65 def xy2uv(curve: GOST3410Curve, x: int, y: int) -> Tuple[int, int]: ...