Move Crypto to 2and3 and generate rest of stubs. (#782)

I implemented strong types for Crypto.Cipher
This commit is contained in:
Roy Williams
2016-12-19 20:13:51 -08:00
committed by Łukasz Langa
parent 7e89fc0d49
commit 89da3a4159
61 changed files with 947 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
# Stubs for Crypto.Util.Counter (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
from Crypto.Util.py21compat import *
from Crypto.Util.py3compat import *
def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ...

View File

@@ -0,0 +1,10 @@
# Stubs for Crypto.Util (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# RFC1751
# asn1
# number
# randpool
# strxor

View File

@@ -0,0 +1,11 @@
# Stubs for Crypto.Util.py3compat (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
__revision__ = ... # type: str
def b(s): ...
def bchr(s): ...
def bstr(s): ...
def bord(s): ...
def tobytes(s): ...

View File

View File

@@ -1,3 +0,0 @@
# very stubby version of Crypto.Random
def randint(min: int, max: int) -> int: ...

View File

23
third_party/2and3/Crypto/Cipher/AES.pyi vendored Normal file
View File

@@ -0,0 +1,23 @@
# Stubs for Crypto.Cipher.AES (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from .blockalgo import BlockAlgo
__revision__ = ... # type: str
class AESCipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> AESCipher: ...
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
block_size = ... # type: int
key_size = ... # type: int

View File

@@ -0,0 +1,23 @@
# Stubs for Crypto.Cipher.ARC2 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from .blockalgo import BlockAlgo
__revision__ = ... # type: str
class RC2Cipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> RC2Cipher: ...
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
block_size = ... # type: int
key_size = ... # type: int

View File

@@ -0,0 +1,19 @@
# Stubs for Crypto.Cipher.ARC4 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
__revision__ = ... # type: str
class ARC4Cipher:
block_size = ... # type: int
key_size = ... # type: int
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def encrypt(self, plaintext): ...
def decrypt(self, ciphertext): ...
def new(key: Union[bytes, Text], *args, **kwargs) -> ARC4Cipher: ...
block_size = ... # type: int
key_size = ... # type: int

View File

@@ -0,0 +1,23 @@
# Stubs for Crypto.Cipher.Blowfish (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from .blockalgo import BlockAlgo
__revision__ = ... # type: str
class BlowfishCipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> BlowfishCipher: ...
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
block_size = ... # type: int
key_size = ... # type: Any

View File

@@ -0,0 +1,23 @@
# Stubs for Crypto.Cipher.CAST (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from .blockalgo import BlockAlgo
__revision__ = ... # type: str
class CAST128Cipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> CAST128Cipher: ...
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
block_size = ... # type: int
key_size = ... # type: Any

23
third_party/2and3/Crypto/Cipher/DES.pyi vendored Normal file
View File

@@ -0,0 +1,23 @@
# Stubs for Crypto.Cipher.DES (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from .blockalgo import BlockAlgo
__revision__ = ... # type: str
class DESCipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> DESCipher: ...
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
block_size = ... # type: int
key_size = ... # type: int

View File

@@ -0,0 +1,24 @@
# Stubs for Crypto.Cipher.DES3 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from .blockalgo import BlockAlgo
__revision__ = ... # type: str
class DES3Cipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> DES3Cipher: ...
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
block_size = ... # type: int
key_size = ... # type: Any

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Cipher.PKCS1_OAEP (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional, Union, Text
from Crypto.PublicKey.RSA import _RSAobj
class PKCS1OAEP_Cipher:
def __init__(self, key: _RSAobj, hashAlgo: Any, mgfunc: Any, label: Any) -> None: ...
def can_encrypt(self): ...
def can_decrypt(self): ...
def encrypt(self, message: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ct: bytes) -> bytes: ...
def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ...

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Cipher.PKCS1_v1_5 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
from Crypto.PublicKey.RSA import _RSAobj
class PKCS115_Cipher:
def __init__(self, key: _RSAobj) -> None: ...
def can_encrypt(self) -> bool: ...
def can_decrypt(self) -> bool: ...
rf = ... # type: Any
def encrypt(self, message: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ct: bytes, sentinel: Any) -> bytes: ...
def new(key: _RSAobj) -> PKCS115_Cipher: ...

20
third_party/2and3/Crypto/Cipher/XOR.pyi vendored Normal file
View File

@@ -0,0 +1,20 @@
# Stubs for Crypto.Cipher.XOR (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
__revision__ = ... # type: str
class XORCipher:
block_size = ... # type: int
key_size = ... # type: int
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ciphertext: bytes) -> bytes: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ...
block_size = ... # type: int
key_size = ... # type: int

View File

@@ -1,4 +1,4 @@
# Stubs for Crypto.Cipher (Python 2)
# Stubs for Crypto.Cipher (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -0,0 +1,21 @@
# Stubs for Crypto.Cipher.blockalgo (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Union, Text
MODE_ECB = ... # type: int
MODE_CBC = ... # type: int
MODE_CFB = ... # type: int
MODE_PGP = ... # type: int
MODE_OFB = ... # type: int
MODE_CTR = ... # type: int
MODE_OPENPGP = ... # type: int
class BlockAlgo:
mode = ... # type: int
block_size = ... # type: int
IV = ... # type: Any
def __init__(self, factory: Any, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ciphertext: bytes) -> bytes: ...

20
third_party/2and3/Crypto/Hash/HMAC.pyi vendored Normal file
View File

@@ -0,0 +1,20 @@
# Stubs for Crypto.Hash.HMAC (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
digest_size = ... # type: Any
class HMAC:
digest_size = ... # type: Any
digestmod = ... # type: Any
outer = ... # type: Any
inner = ... # type: Any
def __init__(self, key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...) -> None: ...
def update(self, msg): ...
def copy(self): ...
def digest(self): ...
def hexdigest(self): ...
def new(key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...): ...

17
third_party/2and3/Crypto/Hash/MD2.pyi vendored Normal file
View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.MD2 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD2Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

17
third_party/2and3/Crypto/Hash/MD4.pyi vendored Normal file
View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.MD4 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD4Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

17
third_party/2and3/Crypto/Hash/MD5.pyi vendored Normal file
View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.MD5 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD5Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.RIPEMD (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class RIPEMD160Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

17
third_party/2and3/Crypto/Hash/SHA.pyi vendored Normal file
View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.SHA (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA1Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.SHA224 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA224Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.SHA256 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA256Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.SHA384 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA384Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Hash.SHA512 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA512Hash(HashAlgo):
oid = ... # type: Any
digest_size = ... # type: int
block_size = ... # type: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size = ... # type: Any

View File

@@ -0,0 +1,15 @@
# Stubs for Crypto.Hash (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# HMAC
# MD2
# MD4
# MD5
# RIPEMD
# SHA
# SHA224
# SHA256
# SHA384
# SHA512

View File

@@ -0,0 +1,15 @@
# Stubs for Crypto.Hash.hashalgo (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
class HashAlgo:
digest_size = ... # type: Any
block_size = ... # type: Any
def __init__(self, hashFactory, data: Optional[Any] = ...) -> None: ...
def update(self, data): ...
def digest(self): ...
def hexdigest(self): ...
def copy(self): ...
def new(self, data: Optional[Any] = ...): ...

View File

@@ -0,0 +1,14 @@
# Stubs for Crypto.Protocol.AllOrNothing (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
__revision__ = ... # type: str
def isInt(x): ...
class AllOrNothing:
def __init__(self, ciphermodule, mode: Optional[Any] = ..., IV: Optional[Any] = ...) -> None: ...
def digest(self, text): ...
def undigest(self, blocks): ...

View File

@@ -0,0 +1,9 @@
# Stubs for Crypto.Protocol.Chaffing (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
__revision__ = ... # type: str
class Chaff:
def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ...
def chaff(self, blocks): ...

View File

@@ -0,0 +1,11 @@
# Stubs for Crypto.Protocol.KDF (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.Hash import SHA as SHA1
__revision__ = ... # type: str
def PBKDF1(password, salt, dkLen, count: int = ..., hashAlgo: Optional[Any] = ...): ...
def PBKDF2(password, salt, dkLen: int = ..., count: int = ..., prf: Optional[Any] = ...): ...

View File

@@ -0,0 +1,8 @@
# Stubs for Crypto.Protocol (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# AllOrNothing
# Chaffing
# KDF

View File

@@ -0,0 +1,31 @@
# Stubs for Crypto.PublicKey.DSA (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from .pubkey import pubkey
class _DSAobj(pubkey):
keydata = ... # type: Any
implementation = ... # type: Any
key = ... # type: Any
def __init__(self, implementation, key) -> None: ...
def __getattr__(self, attrname): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def has_private(self): ...
def size(self): ...
def can_blind(self): ...
def can_encrypt(self): ...
def can_sign(self): ...
def publickey(self): ...
class DSAImplementation:
error = ... # type: Any
def __init__(self, **kwargs) -> None: ...
def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ...): ...
def construct(self, tup): ...
generate = ... # type: Any
construct = ... # type: Any
error = ... # type: Any

View File

@@ -0,0 +1,21 @@
# Stubs for Crypto.PublicKey.ElGamal (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from Crypto.PublicKey.pubkey import *
class error(Exception): ...
def generate(bits, randfunc, progress_func: Optional[Any] = ...): ...
def construct(tup): ...
class ElGamalobj(pubkey):
keydata = ... # type: Any
def encrypt(self, plaintext, K): ...
def decrypt(self, ciphertext): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def size(self): ...
def has_private(self): ...
def publickey(self): ...

View File

@@ -0,0 +1,36 @@
# Stubs for Crypto.PublicKey.RSA (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional, Union, Text
from .pubkey import pubkey
class _RSAobj(pubkey):
keydata = ... # type: Any
implementation = ... # type: Any
key = ... # type: Any
def __init__(self, implementation, key, randfunc: Optional[Any] = ...) -> None: ...
def __getattr__(self, attrname): ...
def encrypt(self, plaintext, K): ...
def decrypt(self, ciphertext): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def has_private(self): ...
def size(self): ...
def can_blind(self): ...
def can_encrypt(self): ...
def can_sign(self): ...
def publickey(self): ...
def exportKey(self, format: str = ..., passphrase: Optional[Any] = ..., pkcs: int = ...): ...
class RSAImplementation:
error = ... # type: Any
def __init__(self, **kwargs) -> None: ...
def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ..., e: int = ...): ...
def construct(self, tup): ...
def importKey(self, externKey: Any, passphrase: Union[None, bytes, Text] = ...) -> _RSAobj: ...
generate = ... # type: Any
construct = ... # type: Any
importKey = ... # type: Any
error = ... # type: Any

View File

@@ -0,0 +1,8 @@
# Stubs for Crypto.PublicKey (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# DSA
# ElGamal
# RSA

View File

@@ -0,0 +1,25 @@
# Stubs for Crypto.PublicKey.pubkey (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from Crypto.Util.number import *
__revision__ = ... # type: str
class pubkey:
def __init__(self) -> None: ...
def encrypt(self, plaintext, K): ...
def decrypt(self, ciphertext): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def validate(self, M, signature): ...
def blind(self, M, B): ...
def unblind(self, M, B): ...
def can_sign(self): ...
def can_encrypt(self): ...
def can_blind(self): ...
def size(self): ...
def has_private(self): ...
def publickey(self): ...
def __eq__(self, other): ...
def __ne__(self, other): ...

View File

@@ -0,0 +1,29 @@
# Stubs for Crypto.Random.Fortuna.FortunaAccumulator (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
__revision__ = ... # type: str
class FortunaPool:
digest_size = ... # type: Any
def __init__(self) -> None: ...
def append(self, data): ...
def digest(self): ...
def hexdigest(self): ...
length = ... # type: int
def reset(self): ...
def which_pools(r): ...
class FortunaAccumulator:
min_pool_size = ... # type: int
reseed_interval = ... # type: float
reseed_count = ... # type: int
generator = ... # type: Any
last_reseed = ... # type: Any
pools = ... # type: Any
def __init__(self) -> None: ...
def random_data(self, bytes): ...
def add_random_event(self, source_number, pool_number, data): ...

View File

@@ -0,0 +1,20 @@
# Stubs for Crypto.Random.Fortuna.FortunaGenerator (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
__revision__ = ... # type: str
class AESGenerator:
block_size = ... # type: Any
key_size = ... # type: int
max_blocks_per_request = ... # type: Any
counter = ... # type: Any
key = ... # type: Any
block_size_shift = ... # type: Any
blocks_per_key = ... # type: Any
max_bytes_per_request = ... # type: Any
def __init__(self) -> None: ...
def reseed(self, seed): ...
def pseudo_random_data(self, bytes): ...

View File

@@ -0,0 +1,17 @@
# Stubs for Crypto.Random.Fortuna.SHAd256 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
class _SHAd256:
digest_size = ... # type: Any
def __init__(self, internal_api_check, sha256_hash_obj) -> None: ...
def copy(self): ...
def digest(self): ...
def hexdigest(self): ...
def update(self, data): ...
digest_size = ... # type: Any
def new(data: Optional[Any] = ...): ...

View File

@@ -1,5 +1,4 @@
# Stubs for Crypto.Random (Python 2)
# Stubs for Crypto.Random.Fortuna (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
def get_random_bytes(n: int) -> str: ...

View File

@@ -0,0 +1,5 @@
# Stubs for Crypto.Random.OSRNG (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
__revision__ = ... # type: str

View File

@@ -0,0 +1,9 @@
# Stubs for Crypto.Random.OSRNG.fallback (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from .rng_base import BaseRNG
class PythonOSURandomRNG(BaseRNG):
name = ... # type: str
def __init__(self) -> None: ...

View File

@@ -0,0 +1,10 @@
# Stubs for Crypto.Random.OSRNG.posix (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from .rng_base import BaseRNG
class DevURandomRNG(BaseRNG):
name = ... # type: str
def __init__(self, devname: Optional[Any] = ...) -> None: ...

View File

@@ -0,0 +1,15 @@
# Stubs for Crypto.Random.OSRNG.rng_base (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
__revision__ = ... # type: str
class BaseRNG:
closed = ... # type: bool
def __init__(self) -> None: ...
def __del__(self): ...
def __enter__(self): ...
def __exit__(self): ...
def close(self): ...
def flush(self): ...
def read(self, N: int = ...): ...

View File

@@ -0,0 +1,5 @@
# Stubs for Crypto.Random (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
def new(*args, **kwargs): ...

View File

@@ -0,0 +1,21 @@
# Stubs for Crypto.Random.random (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
class StrongRandom:
def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ...
def getrandbits(self, k): ...
def randrange(self, *args): ...
def randint(self, a, b): ...
def choice(self, seq): ...
def shuffle(self, x): ...
def sample(self, population, k): ...
getrandbits = ... # type: Any
randrange = ... # type: Any
randint = ... # type: Any
choice = ... # type: Any
shuffle = ... # type: Any
sample = ... # type: Any

View File

@@ -0,0 +1,13 @@
# Stubs for Crypto.Signature.PKCS1_PSS (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
class PSS_SigScheme:
def __init__(self, key, mgfunc, saltLen) -> None: ...
def can_sign(self): ...
def sign(self, mhash): ...
def verify(self, mhash, S): ...
def new(key, mgfunc: Optional[Any] = ..., saltLen: Optional[Any] = ...): ...

View File

@@ -0,0 +1,12 @@
# Stubs for Crypto.Signature.PKCS1_v1_5 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
class PKCS115_SigScheme:
def __init__(self, key) -> None: ...
def can_sign(self): ...
def sign(self, mhash): ...
def verify(self, mhash, S): ...
def new(key): ...

View File

@@ -0,0 +1,7 @@
# Stubs for Crypto.Signature (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# PKCS1_PSS
# PKCS1_v1_5

View File

@@ -0,0 +1,7 @@
# Stubs for Crypto.Util.Counter (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ...

View File

@@ -0,0 +1,13 @@
# Stubs for Crypto.Util.RFC1751 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
__revision__ = ... # type: str
binary = ... # type: Any
def key_to_english(key): ...
def english_to_key(s): ...
wordlist = ... # type: Any

View File

@@ -0,0 +1,10 @@
# Stubs for Crypto.Util (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# RFC1751
# asn1
# number
# randpool
# strxor

49
third_party/2and3/Crypto/Util/asn1.pyi vendored Normal file
View File

@@ -0,0 +1,49 @@
# Stubs for Crypto.Util.asn1 (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
class DerObject:
typeTags = ... # type: Any
typeTag = ... # type: Any
payload = ... # type: Any
def __init__(self, ASN1Type: Optional[Any] = ..., payload: Any = ...) -> None: ...
def isType(self, ASN1Type): ...
def encode(self): ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerInteger(DerObject):
value = ... # type: Any
def __init__(self, value: int = ...) -> None: ...
payload = ... # type: Any
def encode(self): ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerSequence(DerObject):
def __init__(self, startSeq: Optional[Any] = ...) -> None: ...
def __delitem__(self, n): ...
def __getitem__(self, n): ...
def __setitem__(self, key, value): ...
def __setslice__(self, i, j, sequence): ...
def __delslice__(self, i, j): ...
def __getslice__(self, i, j): ...
def __len__(self): ...
def append(self, item): ...
def hasInts(self): ...
def hasOnlyInts(self): ...
payload = ... # type: Any
def encode(self): ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerOctetString(DerObject):
payload = ... # type: Any
def __init__(self, value: Any = ...) -> None: ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerNull(DerObject):
def __init__(self) -> None: ...
class DerObjectId(DerObject):
def __init__(self) -> None: ...
def decode(self, derEle, noLeftOvers: int = ...): ...

View File

@@ -0,0 +1,26 @@
# Stubs for Crypto.Util.number (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from warnings import warn as _warn
__revision__ = ... # type: str
bignum = ... # type: Any
def size(N): ...
def getRandomNumber(N, randfunc: Optional[Any] = ...): ...
def getRandomInteger(N, randfunc: Optional[Any] = ...): ...
def getRandomRange(a, b, randfunc: Optional[Any] = ...): ...
def getRandomNBitInteger(N, randfunc: Optional[Any] = ...): ...
def GCD(x, y): ...
def inverse(u, v): ...
def getPrime(N, randfunc: Optional[Any] = ...): ...
def getStrongPrime(N, e: int = ..., false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ...
def isPrime(N, false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ...
def long_to_bytes(n, blocksize: int = ...): ...
def bytes_to_long(s): ...
def long2str(n, blocksize: int = ...): ...
def str2long(s): ...
sieve_base = ... # type: Any

View File

@@ -0,0 +1,20 @@
# Stubs for Crypto.Util.randpool (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
__revision__ = ... # type: str
class RandomPool:
bytes = ... # type: Any
bits = ... # type: Any
entropy = ... # type: Any
def __init__(self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...) -> None: ...
def get_bytes(self, N): ...
def randomize(self, N: int = ...): ...
def stir(self, s: str = ...): ...
def stir_n(self, N: int = ...): ...
def add_event(self, s: str = ...): ...
def getBytes(self, N): ...
def addEvent(self, event, s: str = ...): ...

View File

@@ -0,0 +1,6 @@
# Stubs for Crypto.Util.strxor (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
def strxor(*args, **kwargs): ...
def strxor_c(*args, **kwargs): ...

11
third_party/2and3/Crypto/__init__.pyi vendored Normal file
View File

@@ -0,0 +1,11 @@
# Stubs for Crypto (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Names in __all__ with no definition:
# Cipher
# Hash
# Protocol
# PublicKey
# Signature
# Util

View File

@@ -0,0 +1,11 @@
# Stubs for Crypto.pct_warnings (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
class CryptoWarning(Warning): ...
class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): ...
class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): ...
class RandomPool_DeprecationWarning(CryptoDeprecationWarning): ...
class ClockRewindWarning(CryptoRuntimeWarning): ...
class GetRandomNumber_DeprecationWarning(CryptoDeprecationWarning): ...
class PowmInsecureWarning(CryptoRuntimeWarning): ...