]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost3410.pyi
34.10-2012 VKO implementation and remove X.509-compatibility helpers
[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     pubkeyX: int,
38     pubkeyY: int,
39     digest: bytes,
40     signature: bytes,
41     size: int=...,
42 ) -> bool: ...
43
44
45 def prv_unmarshal(private_key: bytes) -> int: ...
46
47
48 def pub_marshal(pub: PublicKey, mode: int) -> bytes: ...
49
50
51 def pub_unmarshal(pub: bytes, mode: int) -> PublicKey: ...