X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fstubs%2Fpygost%2Fgost3410.pyi;h=66494455102d91c4fad69c1f773d451f72ef29a3;hb=82af8726ef5d5e2752089a45750e56c9910398c7;hp=74d8a24e135e743b66989fb47a2617404b1eb69a;hpb=96f9d11b0924f078ded87ace8269963875faeefa;p=pygost.git diff --git a/pygost/stubs/pygost/gost3410.pyi b/pygost/stubs/pygost/gost3410.pyi index 74d8a24..6649445 100644 --- a/pygost/stubs/pygost/gost3410.pyi +++ b/pygost/stubs/pygost/gost3410.pyi @@ -2,8 +2,8 @@ from typing import Dict from typing import Tuple -DEFAULT_CURVE = ... # type: str -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] @@ -15,33 +15,49 @@ class GOST3410Curve(object): b = ... # type: int x = ... # type: int y = ... # type: int + cofactor = ... # 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, + cofactor: int = 1, + 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: ... -def sign(curve: GOST3410Curve, prv: int, digest: bytes, mode: int=...) -> bytes: ... +def sign(curve: GOST3410Curve, prv: int, digest: bytes, rand: bytes=None) -> bytes: ... -def verify( - curve: GOST3410Curve, - pub: PublicKey, - digest: bytes, - signature: bytes, - mode: int=..., -) -> bool: ... +def verify(curve: GOST3410Curve, pub: PublicKey, digest: bytes, signature: bytes) -> bool: ... def prv_unmarshal(prv: bytes) -> int: ... -def pub_marshal(pub: PublicKey, mode: int=...) -> bytes: ... +def pub_marshal(pub: PublicKey) -> bytes: ... + + +def pub_unmarshal(pub: bytes) -> PublicKey: ... + + +def uv2xy(curve: GOST3410Curve, u: int, v: int) -> Tuple[int, int]: ... -def pub_unmarshal(pub: bytes, mode: int=...) -> PublicKey: ... +def xy2uv(curve: GOST3410Curve, x: int, y: int) -> Tuple[int, int]: ...