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
34 def pos(self, v: int) -> int: ...
36 def exp(self, degree: int, x: int = ..., y: int = ...) -> int: ...
38 def st(self) -> Tuple[int, int]: ...
41 def point_size(self) -> int: ...
43 def contains(self, point: Tuple[int, int]) -> bool: ...
46 def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...
49 def sign(curve: GOST3410Curve, prv: int, digest: bytes, rand: bytes = None) -> bytes: ...
52 def verify(curve: GOST3410Curve, pub: PublicKey, digest: bytes, signature: bytes) -> bool: ...
55 def prv_unmarshal(prv: bytes) -> int: ...
58 def prv_marshal(curve: GOST3410Curve, prv: int) -> bytes: ...
61 def pub_marshal(pub: PublicKey) -> bytes: ...
64 def pub_unmarshal(pub: bytes) -> PublicKey: ...
67 def uv2xy(curve: GOST3410Curve, u: int, v: int) -> Tuple[int, int]: ...
70 def xy2uv(curve: GOST3410Curve, x: int, y: int) -> Tuple[int, int]: ...