X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fstubs%2Fpygost%2Fgost3410.pyi;h=f2071cc4f3040813443b00902fb809ed0b34b7ae;hb=312c6b813adbf8a04253e3b1da28e02780c61d07;hp=3f93d71bb217035277669e92913e955566dfd1de;hpb=bff2726a7310b9c919ea3457e86e58f2a9ec95f8;p=pygost.git diff --git a/pygost/stubs/pygost/gost3410.pyi b/pygost/stubs/pygost/gost3410.pyi index 3f93d71..f2071cc 100644 --- a/pygost/stubs/pygost/gost3410.pyi +++ b/pygost/stubs/pygost/gost3410.pyi @@ -2,7 +2,9 @@ from typing import Dict from typing import Tuple -CURVE_PARAMS = ... # type: Dict[str, Tuple[bytes, bytes, bytes, bytes, bytes, bytes]] +DEFAULT_CURVE = ... # type: GOST3410Curve +CURVES = ... # type: Dict[str, GOST3410Curve] +MODE2SIZE = ... # type: Dict[int, int] PublicKey = Tuple[int, int] @@ -13,13 +15,27 @@ class GOST3410Curve(object): b = ... # type: int x = ... # type: int y = ... # type: int + e = ... # type: int + d = ... # type: int def __init__( - self, p: bytes, q: bytes, a: bytes, b: bytes, x: bytes, y: bytes + self, + p: int, + q: int, + a: int, + b: int, + x: int, + y: int, + e: int = None, + d: int = None, ) -> None: ... + def pos(self, v: int) -> int: ... + def exp(self, degree: int, x: int=..., y: int=...) -> int: ... + def st(self) -> Tuple[int, int]: ... + def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ... @@ -43,3 +59,9 @@ def pub_marshal(pub: PublicKey, mode: int=...) -> bytes: ... def pub_unmarshal(pub: bytes, mode: int=...) -> PublicKey: ... + + +def uv2xy(curve: GOST3410Curve, u: int, v: int) -> Tuple[int, int]: ... + + +def xy2uv(curve: GOST3410Curve, x: int, y: int) -> Tuple[int, int]: ...