]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost28147.pyi
Completely get rid of addmod
[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 validate_key(key: bytes) -> None: ...
20
21
22 def validate_iv(iv: bytes) -> None: ...
23
24
25 def validate_sbox(sbox: str) -> None: ...
26
27
28 def xcrypt(seq: Sequence[int], sbox: str, key: bytes, ns: Words) -> Words: ...
29
30
31 def encrypt(sbox: str, key: bytes, ns: Words) -> Words: ...
32
33
34 def decrypt(sbox: str, key: bytes, ns: Words) -> Words: ...
35
36
37 def ecb(
38     key: bytes,
39     data: bytes,
40     action: Callable[[str, bytes, Words], Words],
41     sbox: str=...,
42 ) -> bytes: ...
43
44
45 def ecb_encrypt(
46     key: bytes,
47     data: bytes,
48     sbox: str=...,
49 ) -> bytes: ...
50
51
52 def ecb_decrypt(
53     key: bytes,
54     data: bytes,
55     sbox: str=...,
56 ) -> bytes: ...
57
58
59 def cbc_encrypt(
60     key: bytes,
61     data: bytes,
62     iv: bytes=...,
63     pad: bool=...,
64     sbox: str=...,
65     mesh: bool=...,
66 ) -> bytes: ...
67
68
69 def cbc_decrypt(
70     key: bytes,
71     data: bytes,
72     pad: bool=...,
73     sbox: str=...,
74     mesh: bool=...,
75 ) -> bytes: ...
76
77
78 def cnt(
79     key: bytes,
80     data: bytes,
81     iv: bytes=...,
82     sbox: str=...,
83 ) -> bytes: ...
84
85
86 def cfb_encrypt(
87     key: bytes,
88     data: bytes,
89     iv: bytes=...,
90     sbox: str=...,
91     mesh: bool=...,
92 ) -> bytes: ...
93
94
95 def cfb_decrypt(
96     key: bytes,
97     data: bytes,
98     iv: bytes=...,
99     sbox: str=...,
100     mesh: bool=...,
101 ) -> bytes: ...