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