]> Cypherpunks.ru repositories - pygost.git/blob - pygost/stubs/pygost/gost28147.pyi
1c0986f73bbf7343249e70a68fef2e66f83d5749
[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 ) -> bytes: ...
69
70
71 def cbc_decrypt(
72     key: bytes,
73     data: bytes,
74     pad: bool=...,
75     sbox: str=...,
76 ) -> bytes: ...
77
78
79 def cnt(
80     key: bytes,
81     data: bytes,
82     iv: bytes=...,
83     sbox: str=...,
84 ) -> bytes: ...
85
86
87 def cfb_encrypt(
88     key: bytes,
89     data: bytes,
90     iv: bytes=...,
91     sbox: str=...,
92     mesh: bool=...,
93 ) -> bytes: ...
94
95
96 def cfb_decrypt(
97     key: bytes,
98     data: bytes,
99     iv: bytes=...,
100     sbox: str=...,
101     mesh: bool=...,
102 ) -> bytes: ...