massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / cryptography / cryptography / hazmat / primitives / ciphers / modes.pyi
1 from abc import ABCMeta, abstractmethod
2
3 from cryptography.hazmat.primitives.ciphers import CipherAlgorithm
4
5 class Mode(metaclass=ABCMeta):
6     @property
7     @abstractmethod
8     def name(self) -> str: ...
9     @abstractmethod
10     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
11
12 class ModeWithAuthenticationTag(metaclass=ABCMeta):
13     @property
14     @abstractmethod
15     def tag(self) -> bytes: ...
16
17 class ModeWithInitializationVector(metaclass=ABCMeta):
18     @property
19     @abstractmethod
20     def initialization_vector(self) -> bytes: ...
21
22 class ModeWithNonce(metaclass=ABCMeta):
23     @property
24     @abstractmethod
25     def nonce(self) -> bytes: ...
26
27 class ModeWithTweak(metaclass=ABCMeta):
28     @property
29     @abstractmethod
30     def tweak(self) -> bytes: ...
31
32 class CBC(Mode, ModeWithInitializationVector):
33     def __init__(self, initialization_vector: bytes) -> None: ...
34     @property
35     def initialization_vector(self) -> bytes: ...
36     @property
37     def name(self) -> str: ...
38     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
39
40 class CTR(Mode, ModeWithNonce):
41     def __init__(self, nonce: bytes) -> None: ...
42     @property
43     def name(self) -> str: ...
44     @property
45     def nonce(self) -> bytes: ...
46     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
47
48 class CFB(Mode, ModeWithInitializationVector):
49     def __init__(self, initialization_vector: bytes) -> None: ...
50     @property
51     def initialization_vector(self) -> bytes: ...
52     @property
53     def name(self) -> str: ...
54     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
55
56 class CFB8(Mode, ModeWithInitializationVector):
57     def __init__(self, initialization_vector: bytes) -> None: ...
58     @property
59     def initialization_vector(self) -> bytes: ...
60     @property
61     def name(self) -> str: ...
62     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
63
64 class ECB(Mode):
65     @property
66     def name(self) -> str: ...
67     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
68
69 class GCM(Mode, ModeWithInitializationVector, ModeWithAuthenticationTag):
70     def __init__(self, initialization_vector: bytes, tag: bytes | None = ..., min_tag_length: int | None = ...) -> None: ...
71     @property
72     def initialization_vector(self) -> bytes: ...
73     @property
74     def name(self) -> str: ...
75     @property
76     def tag(self) -> bytes: ...
77     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
78
79 class OFB(Mode, ModeWithInitializationVector):
80     def __init__(self, initialization_vector: bytes) -> None: ...
81     @property
82     def initialization_vector(self) -> bytes: ...
83     @property
84     def name(self) -> str: ...
85     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...
86
87 class XTS(Mode, ModeWithTweak):
88     def __init__(self, tweak: bytes) -> None: ...
89     @property
90     def name(self) -> str: ...
91     @property
92     def tweak(self) -> bytes: ...
93     def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ...