1 from typing import Dict
2 from typing import Tuple
5 DEFAULT_CURVE = ... # type: GOST3410Curve
6 CURVES = ... # type: Dict[str, GOST3410Curve]
7 PublicKey = Tuple[int, int]
10 class GOST3410Curve(object):
17 cofactor = ... # type: int
20 name = ... # type: str
36 def pos(self, v: int) -> int: ...
38 def exp(self, degree: int, x: int = ..., y: int = ...) -> int: ...
40 def st(self) -> Tuple[int, int]: ...
43 def point_size(self) -> int: ...
45 def contains(self, point: Tuple[int, int]) -> bool: ...
48 def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...
51 def sign(curve: GOST3410Curve, prv: int, digest: bytes, rand: bytes = None) -> bytes: ...
54 def verify(curve: GOST3410Curve, pub: PublicKey, digest: bytes, signature: bytes) -> bool: ...
57 def prv_unmarshal(prv: bytes) -> int: ...
60 def prv_marshal(curve: GOST3410Curve, prv: int) -> bytes: ...
63 def pub_marshal(pub: PublicKey) -> bytes: ...
66 def pub_unmarshal(pub: bytes) -> PublicKey: ...
69 def uv2xy(curve: GOST3410Curve, u: int, v: int) -> Tuple[int, int]: ...
72 def xy2uv(curve: GOST3410Curve, x: int, y: int) -> Tuple[int, int]: ...