]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/stubs/pygost/gost3410.pyi
Simplify GOST3410Curve initialization
[pygost.git] / pygost / stubs / pygost / gost3410.pyi
index 9151e994e009b287ceabc9cfa275a3615b8549e7..ed5918638c7777ff62e593a21f7d4e5c010e7694 100644 (file)
@@ -2,7 +2,10 @@ 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]
 
 
 class GOST3410Curve(object):
@@ -20,33 +23,25 @@ class GOST3410Curve(object):
     def exp(self, degree: int, x: int=..., y: int=...) -> int: ...
 
 
-PublicKey = Tuple[int, int]
-
-
-def public_key(curve: GOST3410Curve, private_key: int) -> PublicKey: ...
+def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...
 
 
-def kek(
-    curve: GOST3410Curve,
-    private_key: int,
-    ukm: bytes,
-    pubkey: PublicKey,
-) -> bytes: ...
-
-
-def sign(
-    curve: GOST3410Curve,
-    private_key: int,
-    digest: bytes,
-    size: int=...,
-) -> bytes: ...
+def sign(curve: GOST3410Curve, prv: int, digest: bytes, mode: int=...) -> bytes: ...
 
 
 def verify(
     curve: GOST3410Curve,
-    pubkeyX: int,
-    pubkeyY: int,
+    pub: PublicKey,
     digest: bytes,
     signature: bytes,
-    size: int=...,
+    mode: int=...,
 ) -> bool: ...
+
+
+def prv_unmarshal(prv: bytes) -> int: ...
+
+
+def pub_marshal(pub: PublicKey, mode: int=...) -> bytes: ...
+
+
+def pub_unmarshal(pub: bytes, mode: int=...) -> PublicKey: ...