]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost28147.pyi
2.3 release is ready
[pygost.git] / pygost / stubs / pygost / gost28147.pyi
1 from typing import Callable
2 from typing import Sequence
3 from typing import Tuple
4
5
6 Words = Tuple[int, int]
7
8
9 def block2ns(data: bytes) -> Words: ...
10
11
12 def ns2block(ns: Words) -> bytes: ...
13
14
15 def addmod(x: int, y: int, mod: int=...) -> int: ...
16
17
18 def validate_key(key: bytes) -> None: ...
19
20
21 def validate_iv(iv: bytes) -> None: ...
22
23
24 def validate_sbox(sbox: str) -> None: ...
25
26
27 def xcrypt(seq: Sequence[int], sbox: str, key: bytes, ns: Words) -> Words: ...
28
29
30 def encrypt(sbox: str, key: bytes, ns: Words) -> Words: ...
31
32
33 def decrypt(sbox: str, key: bytes, ns: Words) -> Words: ...
34
35
36 def ecb(
37     key: bytes,
38     data: bytes,
39     action: Callable[[str, bytes, Words], Words],
40     sbox: str=...,
41 ) -> bytes: ...
42
43
44 def cbc_encrypt(
45     key: bytes,
46     data: bytes,
47     iv: bytes=...,
48     pad: bool=...,
49     sbox: str=...,
50 ) -> bytes: ...
51
52
53 def cbc_decrypt(
54     key: bytes,
55     data: bytes,
56     pad: bool=...,
57     sbox: str=...,
58 ) -> bytes: ...
59
60
61 def cnt(
62     key: bytes,
63     data: bytes,
64     iv: bytes=...,
65     sbox: str=...,
66 ) -> bytes: ...
67
68
69 def cfb_encrypt(
70     key: bytes,
71     data: bytes,
72     iv: bytes=...,
73     sbox: str=...,
74     mesh: bool=...,
75 ) -> bytes: ...
76
77
78 def cfb_decrypt(
79     key: bytes,
80     data: bytes,
81     iv: bytes=...,
82     sbox: str=...,
83     mesh: bool=...,
84 ) -> bytes: ...