|
| 1 | +from _typeshed import Incomplete |
| 2 | +from enum import IntEnum |
| 3 | + |
| 4 | +MODE_ECB: int |
| 5 | +MODE_CBC: int |
| 6 | +MODE_CFB: int |
| 7 | +MODE_OFB: int |
| 8 | +MODE_CTR: int |
| 9 | +ECC_CURVE_INVALID: int |
| 10 | +ECC_CURVE_DEF: int |
| 11 | +ECC_SECP192R1: int |
| 12 | +ECC_PRIME192V2: int |
| 13 | +ECC_PRIME192V3: int |
| 14 | +ECC_PRIME239V1: int |
| 15 | +ECC_PRIME239V2: int |
| 16 | +ECC_PRIME239V3: int |
| 17 | +ECC_SECP256R1: int |
| 18 | +ECC_SECP112R1: int |
| 19 | +ECC_SECP112R2: int |
| 20 | +ECC_SECP128R1: int |
| 21 | +ECC_SECP128R2: int |
| 22 | +ECC_SECP160R1: int |
| 23 | +ECC_SECP160R2: int |
| 24 | +ECC_SECP224R1: int |
| 25 | +ECC_SECP384R1: int |
| 26 | +ECC_SECP521R1: int |
| 27 | +ECC_SECP160K1: int |
| 28 | +ECC_SECP192K1: int |
| 29 | +ECC_SECP224K1: int |
| 30 | +ECC_SECP256K1: int |
| 31 | +ECC_BRAINPOOLP160R1: int |
| 32 | +ECC_BRAINPOOLP192R1: int |
| 33 | +ECC_BRAINPOOLP224R1: int |
| 34 | +ECC_BRAINPOOLP256R1: int |
| 35 | +ECC_BRAINPOOLP320R1: int |
| 36 | +ECC_BRAINPOOLP384R1: int |
| 37 | +ECC_BRAINPOOLP512R1: int |
| 38 | +MGF1NONE: Incomplete |
| 39 | +MGF1SHA1: Incomplete |
| 40 | +MGF1SHA224: Incomplete |
| 41 | +MGF1SHA256: Incomplete |
| 42 | +MGF1SHA384: Incomplete |
| 43 | +MGF1SHA512: Incomplete |
| 44 | +HASH_TYPE_NONE: Incomplete |
| 45 | +HASH_TYPE_MD2: Incomplete |
| 46 | +HASH_TYPE_MD4: Incomplete |
| 47 | +HASH_TYPE_MD5: Incomplete |
| 48 | +HASH_TYPE_SHA: Incomplete |
| 49 | +HASH_TYPE_SHA224: Incomplete |
| 50 | +HASH_TYPE_SHA256: Incomplete |
| 51 | +HASH_TYPE_SHA384: Incomplete |
| 52 | +HASH_TYPE_SHA512: Incomplete |
| 53 | +HASH_TYPE_MD5_SHA: Incomplete |
| 54 | +HASH_TYPE_SHA3_224: Incomplete |
| 55 | +HASH_TYPE_SHA3_256: Incomplete |
| 56 | +HASH_TYPE_SHA3_384: Incomplete |
| 57 | +HASH_TYPE_SHA3_512: Incomplete |
| 58 | +HASH_TYPE_BLAKE2B: Incomplete |
| 59 | +HASH_TYPE_BLAKE2S: Incomplete |
| 60 | + |
| 61 | +class _Cipher: |
| 62 | + mode: Incomplete |
| 63 | + def __init__(self, key, mode, IV=None) -> None: ... |
| 64 | + @classmethod |
| 65 | + def new(cls, key, mode, IV=None, **kwargs): ... |
| 66 | + def encrypt(self, string): ... |
| 67 | + def decrypt(self, string): ... |
| 68 | + |
| 69 | +class Aes(_Cipher): |
| 70 | + block_size: int |
| 71 | + key_size: Incomplete |
| 72 | + |
| 73 | +class AesGcmStream: |
| 74 | + block_size: int |
| 75 | + def __init__(self, key, IV, tag_bytes: int = 16) -> None: ... |
| 76 | + def set_aad(self, data) -> None: ... |
| 77 | + def get_aad(self): ... |
| 78 | + def encrypt(self, data): ... |
| 79 | + def decrypt(self, data): ... |
| 80 | + def final(self, authTag=None): ... |
| 81 | + |
| 82 | +class ChaCha(_Cipher): |
| 83 | + block_size: int |
| 84 | + key_size: Incomplete |
| 85 | + def __init__(self, key: str = "", size: int = 32) -> None: ... |
| 86 | + def set_iv(self, nonce, counter: int = 0) -> None: ... |
| 87 | + |
| 88 | +class ChaCha20Poly1305: |
| 89 | + block_size: int |
| 90 | + def __init__(self, key, IV, aad, tag_bytes: int = 16) -> None: ... |
| 91 | + def set_aad(self, data) -> None: ... |
| 92 | + def get_aad(self): ... |
| 93 | + def encrypt(self, inPlainText): ... |
| 94 | + def decrypt(self, inGeneratedAuthTag, inGeneratedCipher): ... |
| 95 | + def checkTag(self, authTag) -> None: ... |
| 96 | + def final(self, authTag=None): ... |
| 97 | + |
| 98 | +class Des3(_Cipher): |
| 99 | + block_size: int |
| 100 | + key_size: int |
| 101 | + |
| 102 | +class _Rsa: |
| 103 | + RSA_MIN_PAD_SIZE: int |
| 104 | + native_object: Incomplete |
| 105 | + def __init__(self) -> None: ... |
| 106 | + def __del__(self) -> None: ... |
| 107 | + def set_mgf(self, mgf) -> None: ... |
| 108 | + |
| 109 | +class RsaPublic(_Rsa): |
| 110 | + output_size: Incomplete |
| 111 | + size: Incomplete |
| 112 | + def __init__(self, key=None, hash_type=None) -> None: ... |
| 113 | + @classmethod |
| 114 | + def from_pem(cls, file, hash_type=None): ... |
| 115 | + def encrypt(self, plaintext): ... |
| 116 | + def encrypt_oaep(self, plaintext, label: str = ""): ... |
| 117 | + def verify(self, signature): ... |
| 118 | + def verify_pss(self, plaintext, signature): ... |
| 119 | + |
| 120 | +class RsaPrivate(RsaPublic): |
| 121 | + @classmethod |
| 122 | + def make_key(cls, size, rng=..., hash_type=None): ... |
| 123 | + size: Incomplete |
| 124 | + output_size: Incomplete |
| 125 | + def __init__(self, key=None, hash_type=None) -> None: ... |
| 126 | + @classmethod |
| 127 | + def from_pem(cls, file, hash_type=None): ... |
| 128 | + def encode_key(self): ... |
| 129 | + def decrypt(self, ciphertext): ... |
| 130 | + def decrypt_oaep(self, ciphertext, label: str = ""): ... |
| 131 | + def sign(self, plaintext): ... |
| 132 | + def sign_pss(self, plaintext): ... |
| 133 | + |
| 134 | +class _Ecc: |
| 135 | + native_object: Incomplete |
| 136 | + def __init__(self) -> None: ... |
| 137 | + def __del__(self) -> None: ... |
| 138 | + @property |
| 139 | + def size(self): ... |
| 140 | + @property |
| 141 | + def max_signature_size(self): ... |
| 142 | + |
| 143 | +class EccPublic(_Ecc): |
| 144 | + def __init__(self, key=None) -> None: ... |
| 145 | + def decode_key(self, key) -> None: ... |
| 146 | + def decode_key_raw(self, qx, qy, curve_id=7) -> None: ... |
| 147 | + def encode_key(self, with_curve: bool = True): ... |
| 148 | + def encode_key_raw(self): ... |
| 149 | + def import_x963(self, x963) -> None: ... |
| 150 | + def export_x963(self): ... |
| 151 | + def verify(self, signature, data): ... |
| 152 | + def verify_raw(self, R, S, data): ... |
| 153 | + |
| 154 | +class EccPrivate(EccPublic): |
| 155 | + @classmethod |
| 156 | + def make_key(cls, size, rng=...): ... |
| 157 | + def decode_key(self, key) -> None: ... |
| 158 | + def decode_key_raw(self, qx, qy, d, curve_id=7) -> None: ... |
| 159 | + def encode_key(self): ... |
| 160 | + def encode_key_raw(self): ... |
| 161 | + def shared_secret(self, peer): ... |
| 162 | + def sign(self, plaintext, rng=...): ... |
| 163 | + def sign_raw(self, plaintext, rng=...): ... |
| 164 | + |
| 165 | +class _Ed25519: |
| 166 | + native_object: Incomplete |
| 167 | + def __init__(self) -> None: ... |
| 168 | + def __del__(self) -> None: ... |
| 169 | + @property |
| 170 | + def size(self): ... |
| 171 | + @property |
| 172 | + def max_signature_size(self): ... |
| 173 | + |
| 174 | +class Ed25519Public(_Ed25519): |
| 175 | + def __init__(self, key=None) -> None: ... |
| 176 | + def decode_key(self, key) -> None: ... |
| 177 | + def encode_key(self): ... |
| 178 | + def verify(self, signature, data): ... |
| 179 | + |
| 180 | +class Ed25519Private(Ed25519Public): |
| 181 | + def __init__(self, key=None, pub=None) -> None: ... |
| 182 | + @classmethod |
| 183 | + def make_key(cls, size, rng=...): ... |
| 184 | + def decode_key(self, key, pub=None) -> None: ... |
| 185 | + def encode_key(self): ... |
| 186 | + def sign(self, plaintext): ... |
| 187 | + |
| 188 | +class _Ed448: |
| 189 | + native_object: Incomplete |
| 190 | + def __init__(self) -> None: ... |
| 191 | + def __del__(self) -> None: ... |
| 192 | + @property |
| 193 | + def size(self): ... |
| 194 | + @property |
| 195 | + def max_signature_size(self): ... |
| 196 | + |
| 197 | +class Ed448Public(_Ed448): |
| 198 | + def __init__(self, key=None) -> None: ... |
| 199 | + def decode_key(self, key) -> None: ... |
| 200 | + def encode_key(self): ... |
| 201 | + def verify(self, signature, data, ctx=None): ... |
| 202 | + |
| 203 | +class Ed448Private(Ed448Public): |
| 204 | + def __init__(self, key=None, pub=None) -> None: ... |
| 205 | + @classmethod |
| 206 | + def make_key(cls, size, rng=...): ... |
| 207 | + def decode_key(self, key, pub=None) -> None: ... |
| 208 | + def encode_key(self): ... |
| 209 | + def sign(self, plaintext, ctx=None): ... |
| 210 | + |
| 211 | +class MlKemType(IntEnum): |
| 212 | + ML_KEM_512 = ... |
| 213 | + ML_KEM_768 = ... |
| 214 | + ML_KEM_1024 = ... |
| 215 | + |
| 216 | +class _MlKemBase: |
| 217 | + INVALID_DEVID: Incomplete |
| 218 | + init_done: bool |
| 219 | + native_object: Incomplete |
| 220 | + def __init__(self, mlkem_type) -> None: ... |
| 221 | + def __del__(self) -> None: ... |
| 222 | + @property |
| 223 | + def ct_size(self): ... |
| 224 | + @property |
| 225 | + def ss_size(self): ... |
| 226 | + |
| 227 | +class MlKemPublic(_MlKemBase): |
| 228 | + @property |
| 229 | + def key_size(self): ... |
| 230 | + def encode_key(self): ... |
| 231 | + def decode_key(self, pub_key) -> None: ... |
| 232 | + def encapsulate(self, rng=...): ... |
| 233 | + def encapsulate_with_random(self, rand): ... |
| 234 | + |
| 235 | +class MlKemPrivate(_MlKemBase): |
| 236 | + @classmethod |
| 237 | + def make_key(cls, mlkem_type, rng=...): ... |
| 238 | + @classmethod |
| 239 | + def make_key_with_random(cls, mlkem_type, rand): ... |
| 240 | + @property |
| 241 | + def pub_key_size(self): ... |
| 242 | + @property |
| 243 | + def priv_key_size(self): ... |
| 244 | + def encode_pub_key(self): ... |
| 245 | + def encode_priv_key(self): ... |
| 246 | + def decode_key(self, priv_key: tuple[bytes, str]): ... |
| 247 | + native_object: Incomplete |
| 248 | + def decapsulate(self, ct): ... |
| 249 | + |
| 250 | +class MlDsaType(IntEnum): |
| 251 | + ML_DSA_44 = ... |
| 252 | + ML_DSA_65 = ... |
| 253 | + ML_DSA_87 = ... |
| 254 | + |
| 255 | +class _MlDsaBase: |
| 256 | + INVALID_DEVID: Incomplete |
| 257 | + native_object: Incomplete |
| 258 | + def __init__(self, mldsa_type) -> None: ... |
| 259 | + def __del__(self) -> None: ... |
| 260 | + @property |
| 261 | + def sig_size(self): ... |
| 262 | + def verify(self, signature, message): ... |
| 263 | + |
| 264 | +class MlDsaPrivate(_MlDsaBase): |
| 265 | + @classmethod |
| 266 | + def make_key(cls, mldsa_type, rng=...): ... |
| 267 | + @property |
| 268 | + def pub_key_size(self): ... |
| 269 | + @property |
| 270 | + def priv_key_size(self): ... |
| 271 | + def encode_pub_key(self): ... |
| 272 | + def encode_priv_key(self): ... |
| 273 | + def decode_key(self, priv_key, pub_key=None) -> None: ... |
| 274 | + def sign(self, message, rng=...): ... |
| 275 | + |
| 276 | +class MlDsaPublic(_MlDsaBase): |
| 277 | + @property |
| 278 | + def key_size(self): ... |
| 279 | + def decode_key(self, pub_key): ... |
| 280 | + def encode_key(self): ... |
0 commit comments