aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/PublicKey
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2024-08-23 03:14:03 +0000
committerDeterminant <[email protected]>2024-08-22 20:34:57 -0700
commit8d1c76ec7caf247d5675e14260d20fc508977ffb (patch)
tree8fa7c8ce3b7e3f4ece150a6da5922b5eb2dc7772 /frozen_deps/Cryptodome/PublicKey
parent258780284151d49cba1d9c0d2ce33f9a19bb058b (diff)
release v0.1.8
Diffstat (limited to 'frozen_deps/Cryptodome/PublicKey')
-rw-r--r--frozen_deps/Cryptodome/PublicKey/ECC.py56
-rw-r--r--frozen_deps/Cryptodome/PublicKey/ECC.pyi50
-rw-r--r--frozen_deps/Cryptodome/PublicKey/RSA.py150
-rw-r--r--frozen_deps/Cryptodome/PublicKey/RSA.pyi41
-rwxr-xr-xfrozen_deps/Cryptodome/PublicKey/_ec_ws.abi3.sobin1068008 -> 960552 bytes
-rwxr-xr-xfrozen_deps/Cryptodome/PublicKey/_ec_ws.cpython-39-x86_64-linux-gnu.sobin1000375 -> 0 bytes
-rwxr-xr-xfrozen_deps/Cryptodome/PublicKey/_ed25519.abi3.sobin578280 -> 220544 bytes
-rwxr-xr-xfrozen_deps/Cryptodome/PublicKey/_ed448.abi3.sobin329424 -> 250592 bytes
-rwxr-xr-xfrozen_deps/Cryptodome/PublicKey/_x25519.abi3.sobin124632 -> 79472 bytes
9 files changed, 223 insertions, 74 deletions
diff --git a/frozen_deps/Cryptodome/PublicKey/ECC.py b/frozen_deps/Cryptodome/PublicKey/ECC.py
index 84a4e07..4546742 100644
--- a/frozen_deps/Cryptodome/PublicKey/ECC.py
+++ b/frozen_deps/Cryptodome/PublicKey/ECC.py
@@ -101,7 +101,7 @@ int ed25519_neg(Point *p);
int ed25519_get_xy(uint8_t *xb, uint8_t *yb, size_t modsize, Point *p);
int ed25519_double(Point *p);
int ed25519_add(Point *P1, const Point *P2);
-int ed25519_scalar(Point *P, uint8_t *scalar, size_t scalar_len, uint64_t seed);
+int ed25519_scalar(Point *P, const uint8_t *scalar, size_t scalar_len, uint64_t seed);
""")
_ed448_lib = load_pycryptodome_raw_lib("Cryptodome.PublicKey._ed448", """
@@ -534,6 +534,9 @@ class EccPoint(object):
return self
def __eq__(self, point):
+ if not isinstance(point, EccPoint):
+ return False
+
cmp_func = lib_func(self, "cmp")
return 0 == cmp_func(self._point.get(), point._point.get())
@@ -753,7 +756,7 @@ class EccKey(object):
if curve_name not in _curves:
raise ValueError("Unsupported curve (%s)" % curve_name)
self._curve = _curves[curve_name]
- self.curve = curve_name
+ self.curve = self._curve.desc
count = int(self._d is not None) + int(self._seed is not None)
@@ -801,6 +804,9 @@ class EccKey(object):
return self._curve.desc in ("Ed25519", "Ed448")
def __eq__(self, other):
+ if not isinstance(other, EccKey):
+ return False
+
if other.has_private() != self.has_private():
return False
@@ -809,7 +815,7 @@ class EccKey(object):
def __repr__(self):
if self.has_private():
if self._is_eddsa():
- extra = ", seed=%s" % self._seed.hex()
+ extra = ", seed=%s" % tostr(binascii.hexlify(self._seed))
else:
extra = ", d=%d" % int(self._d)
else:
@@ -957,7 +963,7 @@ class EccKey(object):
from Cryptodome.IO import PKCS8
if kwargs.get('passphrase', None) is not None and 'protection' not in kwargs:
- raise ValueError("At least the 'protection' parameter should be present")
+ raise ValueError("At least the 'protection' parameter must be present")
if self._is_eddsa():
oid = self._curve.oid
@@ -1035,7 +1041,7 @@ class EccKey(object):
Args:
format (string):
- The format to use for encoding the key:
+ The output format:
- ``'DER'``. The key will be encoded in ASN.1 DER format (binary).
For a public key, the ASN.1 ``subjectPublicKeyInfo`` structure
@@ -1056,20 +1062,25 @@ class EccKey(object):
* For NIST P-curves: equivalent to ``'SEC1'``.
* For EdDSA curves: ``bytes`` in the format defined in `RFC8032`_.
- passphrase (byte string or string):
- The passphrase to use for protecting the private key.
+ passphrase (bytes or string):
+ (*Private keys only*) The passphrase to protect the
+ private key.
use_pkcs8 (boolean):
- Only relevant for private keys.
-
+ (*Private keys only*)
If ``True`` (default and recommended), the `PKCS#8`_ representation
will be used. It must be ``True`` for EdDSA curves.
+ If ``False`` and a passphrase is present, the obsolete PEM
+ encryption will be used.
+
protection (string):
When a private key is exported with password-protection
and PKCS#8 (both ``DER`` and ``PEM`` formats), this parameter MUST be
- present and be a valid algorithm supported by :mod:`Cryptodome.IO.PKCS8`.
- It is recommended to use ``PBKDF2WithHMAC-SHA1AndAES128-CBC``.
+ present,
+ For all possible protection schemes,
+ refer to :ref:`the encryption parameters of PKCS#8<enc_params>`.
+ It is recommended to use ``'PBKDF2WithHMAC-SHA5126AndAES128-CBC'``.
compress (boolean):
If ``True``, the method returns a more compact representation
@@ -1080,6 +1091,16 @@ class EccKey(object):
This parameter is ignored for EdDSA curves, as compression is
mandatory.
+ prot_params (dict):
+ When a private key is exported with password-protection
+ and PKCS#8 (both ``DER`` and ``PEM`` formats), this dictionary
+ contains the parameters to use to derive the encryption key
+ from the passphrase.
+ For all possible values,
+ refer to :ref:`the encryption parameters of PKCS#8<enc_params>`.
+ The recommendation is to use ``{'iteration_count':21000}`` for PBKDF2,
+ and ``{'iteration_count':131072}`` for scrypt.
+
.. warning::
If you don't provide a passphrase, the private key will be
exported in the clear!
@@ -1115,8 +1136,11 @@ class EccKey(object):
raise ValueError("Empty passphrase")
use_pkcs8 = args.pop("use_pkcs8", True)
- if not use_pkcs8 and self._is_eddsa():
- raise ValueError("'pkcs8' must be True for EdDSA curves")
+ if not use_pkcs8:
+ if self._is_eddsa():
+ raise ValueError("'pkcs8' must be True for EdDSA curves")
+ if 'protection' in args:
+ raise ValueError("'protection' is only supported for PKCS#8")
if ext_format == "PEM":
if use_pkcs8:
@@ -1390,8 +1414,8 @@ def _import_rfc5915_der(encoded, passphrase, curve_oid=None):
d = Integer.from_bytes(scalar_bytes)
# Decode public key (if any)
- if len(private_key) == 4:
- public_key_enc = DerBitString(explicit=1).decode(private_key[3]).value
+ if len(private_key) > 2:
+ public_key_enc = DerBitString(explicit=1).decode(private_key[-1]).value
public_key = _import_public_der(public_key_enc, curve_oid=curve_oid)
point_x = public_key.pointQ.x
point_y = public_key.pointQ.y
@@ -1766,7 +1790,7 @@ def import_key(encoded, passphrase=None, curve_name=None):
return _import_der(encoded, passphrase)
# SEC1
- if len(encoded) > 0 and bord(encoded[0]) in b'\x02\x03\x04':
+ if len(encoded) > 0 and bord(encoded[0]) in (0x02, 0x03, 0x04):
if curve_name is None:
raise ValueError("No curve name was provided")
return _import_public_der(encoded, curve_name=curve_name)
diff --git a/frozen_deps/Cryptodome/PublicKey/ECC.pyi b/frozen_deps/Cryptodome/PublicKey/ECC.pyi
index b0bfbec..e3c4ed5 100644
--- a/frozen_deps/Cryptodome/PublicKey/ECC.pyi
+++ b/frozen_deps/Cryptodome/PublicKey/ECC.pyi
@@ -1,12 +1,24 @@
-from typing import Union, Callable, Optional, NamedTuple, List, Tuple, Dict, NamedTuple, Any
+from __future__ import annotations
+
+from typing import Union, Callable, Optional, Tuple, Dict, NamedTuple, Any, overload, Literal
+from typing_extensions import TypedDict, Unpack, NotRequired
from Cryptodome.Math.Numbers import Integer
+from Cryptodome.IO._PBES import ProtParams
RNG = Callable[[int], bytes]
-class UnsupportedEccFeature(ValueError): ...
+
+class UnsupportedEccFeature(ValueError):
+ ...
+
+
class EccPoint(object):
- def __init__(self, x: Union[int, Integer], y: Union[int, Integer], curve: Optional[str] = ...) -> None: ...
+ def __init__(self,
+ x: Union[int, Integer],
+ y: Union[int, Integer],
+ curve: Optional[str] = ...) -> None: ...
+
def set(self, point: EccPoint) -> EccPoint: ...
def __eq__(self, point: object) -> bool: ...
def __neg__(self) -> EccPoint: ...
@@ -27,6 +39,15 @@ class EccPoint(object):
def __imul__(self, scalar: int) -> EccPoint: ...
def __mul__(self, scalar: int) -> EccPoint: ...
+
+class ExportParams(TypedDict):
+ passphrase: NotRequired[Union[bytes, str]]
+ use_pkcs8: NotRequired[bool]
+ protection: NotRequired[str]
+ compress: NotRequired[bool]
+ prot_params: NotRequired[ProtParams]
+
+
class EccKey(object):
curve: str
def __init__(self, *, curve: str = ..., d: int = ..., point: EccPoint = ...) -> None: ...
@@ -38,7 +59,18 @@ class EccKey(object):
@property
def pointQ(self) -> EccPoint: ...
def public_key(self) -> EccKey: ...
- def export_key(self, **kwargs: Union[str, bytes, bool]) -> Union[str,bytes]: ...
+
+ @overload
+ def export_key(self,
+ *,
+ format: Literal['PEM', 'OpenSSH'],
+ **kwargs: Unpack[ExportParams]) -> str: ...
+
+ @overload
+ def export_key(self,
+ *,
+ format: Literal['DER', 'SEC1', 'raw'],
+ **kwargs: Unpack[ExportParams]) -> bytes: ...
_Curve = NamedTuple("_Curve", [('p', Integer),
@@ -54,13 +86,17 @@ _Curve = NamedTuple("_Curve", [('p', Integer),
('openssh', Union[str, None]),
])
-_curves : Dict[str, _Curve]
+_curves: Dict[str, _Curve]
def generate(**kwargs: Union[str, RNG]) -> EccKey: ...
def construct(**kwargs: Union[str, int]) -> EccKey: ...
+
+
def import_key(encoded: Union[bytes, str],
- passphrase: Optional[str]=None,
- curve_name:Optional[str]=None) -> EccKey: ...
+ passphrase: Optional[str] = None,
+ curve_name: Optional[str] = None) -> EccKey: ...
+
+
def _import_ed25519_public_key(encoded: bytes) -> EccKey: ...
def _import_ed448_public_key(encoded: bytes) -> EccKey: ...
diff --git a/frozen_deps/Cryptodome/PublicKey/RSA.py b/frozen_deps/Cryptodome/PublicKey/RSA.py
index bafe036..9a27c36 100644
--- a/frozen_deps/Cryptodome/PublicKey/RSA.py
+++ b/frozen_deps/Cryptodome/PublicKey/RSA.py
@@ -38,6 +38,7 @@ import struct
from Cryptodome import Random
from Cryptodome.Util.py3compat import tobytes, bord, tostr
from Cryptodome.Util.asn1 import DerSequence, DerNull
+from Cryptodome.Util.number import bytes_to_long
from Cryptodome.Math.Numbers import Integer
from Cryptodome.Math.Primality import (test_probable_prime,
@@ -49,7 +50,7 @@ from Cryptodome.PublicKey import (_expand_subject_public_key_info,
class RsaKey(object):
- r"""Class defining an actual RSA key.
+ r"""Class defining an RSA key, private or public.
Do not instantiate directly.
Use :func:`generate`, :func:`construct` or :func:`import_key` instead.
@@ -68,10 +69,14 @@ class RsaKey(object):
:ivar q: Second factor of the RSA modulus
:vartype q: integer
- :ivar u: Chinese remainder component (:math:`p^{-1} \text{mod } q`)
- :vartype u: integer
+ :ivar invp: Chinese remainder component (:math:`p^{-1} \text{mod } q`)
+ :vartype invp: integer
+
+ :ivar invq: Chinese remainder component (:math:`q^{-1} \text{mod } p`)
+ :vartype invq: integer
- :undocumented: exportKey, publickey
+ :ivar u: Same as ``invp``
+ :vartype u: integer
"""
def __init__(self, **kwargs):
@@ -103,6 +108,7 @@ class RsaKey(object):
if input_set == private_set:
self._dp = self._d % (self._p - 1) # = (e⁻¹) mod (p-1)
self._dq = self._d % (self._q - 1) # = (e⁻¹) mod (q-1)
+ self._invq = None # will be computed on demand
@property
def n(self):
@@ -131,6 +137,30 @@ class RsaKey(object):
return int(self._q)
@property
+ def dp(self):
+ if not self.has_private():
+ raise AttributeError("No CRT component 'dp' available for public keys")
+ return int(self._dp)
+
+ @property
+ def dq(self):
+ if not self.has_private():
+ raise AttributeError("No CRT component 'dq' available for public keys")
+ return int(self._dq)
+
+ @property
+ def invq(self):
+ if not self.has_private():
+ raise AttributeError("No CRT component 'invq' available for public keys")
+ if self._invq is None:
+ self._invq = self._q.inverse(self._p)
+ return int(self._invq)
+
+ @property
+ def invp(self):
+ return self.u
+
+ @property
def u(self):
if not self.has_private():
raise AttributeError("No CRT component 'u' available for public keys")
@@ -149,7 +179,7 @@ class RsaKey(object):
raise ValueError("Plaintext too large")
return int(pow(Integer(plaintext), self._e, self._n))
- def _decrypt(self, ciphertext):
+ def _decrypt_to_bytes(self, ciphertext):
if not 0 <= ciphertext < self._n:
raise ValueError("Ciphertext too large")
if not self.has_private():
@@ -167,12 +197,18 @@ class RsaKey(object):
h = ((m2 - m1) * self._u) % self._q
mp = h * self._p + m1
# Step 4: Compute m = m' * (r**(-1)) mod n
- result = (r.inverse(self._n) * mp) % self._n
- # Verify no faults occurred
- if ciphertext != pow(result, self._e, self._n):
- raise ValueError("Fault detected in RSA decryption")
+ # then encode into a big endian byte string
+ result = Integer._mult_modulo_bytes(
+ r.inverse(self._n),
+ mp,
+ self._n)
return result
+ def _decrypt(self, ciphertext):
+ """Legacy private method"""
+
+ return bytes_to_long(self._decrypt_to_bytes(ciphertext))
+
def has_private(self):
"""Whether this is an RSA private key"""
@@ -225,67 +261,76 @@ class RsaKey(object):
return "%s RSA key at 0x%X" % (key_type, id(self))
def export_key(self, format='PEM', passphrase=None, pkcs=1,
- protection=None, randfunc=None):
+ protection=None, randfunc=None, prot_params=None):
"""Export this RSA key.
- Args:
+ Keyword Args:
format (string):
- The format to use for wrapping the key:
+ The desired output format:
- - *'PEM'*. (*Default*) Text encoding, done according to `RFC1421`_/`RFC1423`_.
- - *'DER'*. Binary encoding.
- - *'OpenSSH'*. Textual encoding, done according to OpenSSH specification.
+ - ``'PEM'``. (default) Text output, according to `RFC1421`_/`RFC1423`_.
+ - ``'DER'``. Binary output.
+ - ``'OpenSSH'``. Text output, according to the OpenSSH specification.
Only suitable for public keys (not private keys).
- passphrase (string):
- (*For private keys only*) The pass phrase used for protecting the output.
+ Note that PEM contains a DER structure.
+
+ passphrase (bytes or string):
+ (*Private keys only*) The passphrase to protect the
+ private key.
pkcs (integer):
- (*For private keys only*) The ASN.1 structure to use for
- serializing the key. Note that even in case of PEM
- encoding, there is an inner ASN.1 DER structure.
+ (*Private keys only*) The standard to use for
+ serializing the key: PKCS#1 or PKCS#8.
- With ``pkcs=1`` (*default*), the private key is encoded in a
- simple `PKCS#1`_ structure (``RSAPrivateKey``).
+ With ``pkcs=1`` (*default*), the private key is encoded with a
+ simple `PKCS#1`_ structure (``RSAPrivateKey``). The key cannot be
+ securely encrypted.
- With ``pkcs=8``, the private key is encoded in a `PKCS#8`_ structure
- (``PrivateKeyInfo``).
+ With ``pkcs=8``, the private key is encoded with a `PKCS#8`_ structure
+ (``PrivateKeyInfo``). PKCS#8 offers the best ways to securely
+ encrypt the key.
.. note::
This parameter is ignored for a public key.
- For DER and PEM, an ASN.1 DER ``SubjectPublicKeyInfo``
- structure is always used.
+ For DER and PEM, the output is always an
+ ASN.1 DER ``SubjectPublicKeyInfo`` structure.
protection (string):
(*For private keys only*)
- The encryption scheme to use for protecting the private key.
+ The encryption scheme to use for protecting the private key
+ using the passphrase.
- If ``None`` (default), the behavior depends on :attr:`format`:
+ You can only specify a value if ``pkcs=8``.
+ For all possible protection schemes,
+ refer to :ref:`the encryption parameters of PKCS#8<enc_params>`.
+ The recommended value is
+ ``'PBKDF2WithHMAC-SHA512AndAES256-CBC'``.
- - For *'DER'*, the *PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC*
- scheme is used. The following operations are performed:
+ If ``None`` (default), the behavior depends on :attr:`format`:
- 1. A 16 byte Triple DES key is derived from the passphrase
- using :func:`Cryptodome.Protocol.KDF.PBKDF2` with 8 bytes salt,
- and 1 000 iterations of :mod:`Cryptodome.Hash.HMAC`.
- 2. The private key is encrypted using CBC.
- 3. The encrypted key is encoded according to PKCS#8.
+ - if ``format='PEM'``, the obsolete PEM encryption scheme is used.
+ It is based on MD5 for key derivation, and 3DES for encryption.
- - For *'PEM'*, the obsolete PEM encryption scheme is used.
- It is based on MD5 for key derivation, and Triple DES for encryption.
+ - if ``format='DER'``, the ``'PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC'``
+ scheme is used.
- Specifying a value for :attr:`protection` is only meaningful for PKCS#8
- (that is, ``pkcs=8``) and only if a pass phrase is present too.
+ prot_params (dict):
+ (*For private keys only*)
- The supported schemes for PKCS#8 are listed in the
- :mod:`Cryptodome.IO.PKCS8` module (see :attr:`wrap_algo` parameter).
+ The parameters to use to derive the encryption key
+ from the passphrase. ``'protection'`` must be also specified.
+ For all possible values,
+ refer to :ref:`the encryption parameters of PKCS#8<enc_params>`.
+ The recommendation is to use ``{'iteration_count':21000}`` for PBKDF2,
+ and ``{'iteration_count':131072}`` for scrypt.
randfunc (callable):
A function that provides random bytes. Only used for PEM encoding.
The default is :func:`Cryptodome.Random.get_random_bytes`.
Returns:
- byte string: the encoded key
+ bytes: the encoded key
Raises:
ValueError:when the format is unknown or when you try to encrypt a private
@@ -344,9 +389,12 @@ class RsaKey(object):
else:
key_type = 'ENCRYPTED PRIVATE KEY'
if not protection:
+ if prot_params:
+ raise ValueError("'protection' parameter must be set")
protection = 'PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC'
binary_key = PKCS8.wrap(binary_key, oid,
passphrase, protection,
+ prot_params=prot_params,
key_params=DerNull())
passphrase = None
else:
@@ -368,29 +416,41 @@ class RsaKey(object):
raise ValueError("Unknown key format '%s'. Cannot export the RSA key." % format)
# Backward compatibility
- exportKey = export_key
- publickey = public_key
+ def exportKey(self, *args, **kwargs):
+ """:meta private:"""
+ return self.export_key(*args, **kwargs)
+
+ def publickey(self):
+ """:meta private:"""
+ return self.public_key()
# Methods defined in PyCryptodome that we don't support anymore
def sign(self, M, K):
+ """:meta private:"""
raise NotImplementedError("Use module Cryptodome.Signature.pkcs1_15 instead")
def verify(self, M, signature):
+ """:meta private:"""
raise NotImplementedError("Use module Cryptodome.Signature.pkcs1_15 instead")
def encrypt(self, plaintext, K):
+ """:meta private:"""
raise NotImplementedError("Use module Cryptodome.Cipher.PKCS1_OAEP instead")
def decrypt(self, ciphertext):
+ """:meta private:"""
raise NotImplementedError("Use module Cryptodome.Cipher.PKCS1_OAEP instead")
def blind(self, M, B):
+ """:meta private:"""
raise NotImplementedError
def unblind(self, M, B):
+ """:meta private:"""
raise NotImplementedError
def size(self):
+ """:meta private:"""
raise NotImplementedError
@@ -408,6 +468,7 @@ def generate(bits, randfunc=None, e=65537):
Key length, or size (in bits) of the RSA modulus.
It must be at least 1024, but **2048 is recommended.**
The FIPS standard only defines 1024, 2048 and 3072.
+ Keyword Args:
randfunc (callable):
Function that returns random bytes.
The default is :func:`Cryptodome.Random.get_random_bytes`.
@@ -505,6 +566,7 @@ def construct(rsa_components, consistency_check=True):
5. Second factor of *n* (*q*). Optional.
6. CRT coefficient *q*, that is :math:`p^{-1} \text{mod }q`. Optional.
+ Keyword Args:
consistency_check (boolean):
If ``True``, the library will verify that the provided components
fulfil the main RSA properties.
diff --git a/frozen_deps/Cryptodome/PublicKey/RSA.pyi b/frozen_deps/Cryptodome/PublicKey/RSA.pyi
index d436acf..85f6c4a 100644
--- a/frozen_deps/Cryptodome/PublicKey/RSA.pyi
+++ b/frozen_deps/Cryptodome/PublicKey/RSA.pyi
@@ -1,4 +1,7 @@
-from typing import Callable, Union, Tuple, Optional
+from typing import Callable, Union, Tuple, Optional, overload, Literal
+
+from Cryptodome.Math.Numbers import Integer
+from Cryptodome.IO._PBES import ProtParams
__all__ = ['generate', 'construct', 'import_key',
'RsaKey', 'oid']
@@ -7,6 +10,7 @@ RNG = Callable[[int], bytes]
class RsaKey(object):
def __init__(self, **kwargs: int) -> None: ...
+
@property
def n(self) -> int: ...
@property
@@ -19,6 +23,11 @@ class RsaKey(object):
def q(self) -> int: ...
@property
def u(self) -> int: ...
+ @property
+ def invp(self) -> int: ...
+ @property
+ def invq(self) -> int: ...
+
def size_in_bits(self) -> int: ...
def size_in_bytes(self) -> int: ...
def has_private(self) -> bool: ...
@@ -30,18 +39,36 @@ class RsaKey(object):
def __getstate__(self) -> None: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
- def export_key(self, format: Optional[str]="PEM", passphrase: Optional[str]=None, pkcs: Optional[int]=1,
- protection: Optional[str]=None, randfunc: Optional[RNG]=None) -> bytes: ...
+
+ @overload
+ def export_key(self,
+ format: Optional[str]="PEM",
+ passphrase: Optional[str]=None,
+ pkcs: Optional[int]=1,
+ protection: Optional[str]=None,
+ randfunc: Optional[RNG]=None
+ ) -> bytes: ...
+ @overload
+ def export_key(self, *,
+ format: Optional[str]="PEM",
+ passphrase: str,
+ pkcs: Literal[8],
+ protection: str,
+ randfunc: Optional[RNG]=None,
+ prot_params: ProtParams,
+ ) -> bytes: ...
# Backward compatibility
exportKey = export_key
publickey = public_key
+Int = Union[int, Integer]
+
def generate(bits: int, randfunc: Optional[RNG]=None, e: Optional[int]=65537) -> RsaKey: ...
-def construct(rsa_components: Union[Tuple[int, int], # n, e
- Tuple[int, int, int], # n, e, d
- Tuple[int, int, int, int, int], # n, e, d, p, q
- Tuple[int, int, int, int, int, int]], # n, e, d, p, q, crt_q
+def construct(rsa_components: Union[Tuple[Int, Int], # n, e
+ Tuple[Int, Int, Int], # n, e, d
+ Tuple[Int, Int, Int, Int, Int], # n, e, d, p, q
+ Tuple[Int, Int, Int, Int, Int, Int]], # n, e, d, p, q, crt_q
consistency_check: Optional[bool]=True) -> RsaKey: ...
def import_key(extern_key: Union[str, bytes], passphrase: Optional[str]=None) -> RsaKey: ...
diff --git a/frozen_deps/Cryptodome/PublicKey/_ec_ws.abi3.so b/frozen_deps/Cryptodome/PublicKey/_ec_ws.abi3.so
index b6fd404..b1272d2 100755
--- a/frozen_deps/Cryptodome/PublicKey/_ec_ws.abi3.so
+++ b/frozen_deps/Cryptodome/PublicKey/_ec_ws.abi3.so
Binary files differ
diff --git a/frozen_deps/Cryptodome/PublicKey/_ec_ws.cpython-39-x86_64-linux-gnu.so b/frozen_deps/Cryptodome/PublicKey/_ec_ws.cpython-39-x86_64-linux-gnu.so
deleted file mode 100755
index 4cb470d..0000000
--- a/frozen_deps/Cryptodome/PublicKey/_ec_ws.cpython-39-x86_64-linux-gnu.so
+++ /dev/null
Binary files differ
diff --git a/frozen_deps/Cryptodome/PublicKey/_ed25519.abi3.so b/frozen_deps/Cryptodome/PublicKey/_ed25519.abi3.so
index bd8bcc5..e047bcb 100755
--- a/frozen_deps/Cryptodome/PublicKey/_ed25519.abi3.so
+++ b/frozen_deps/Cryptodome/PublicKey/_ed25519.abi3.so
Binary files differ
diff --git a/frozen_deps/Cryptodome/PublicKey/_ed448.abi3.so b/frozen_deps/Cryptodome/PublicKey/_ed448.abi3.so
index ee47399..da7209a 100755
--- a/frozen_deps/Cryptodome/PublicKey/_ed448.abi3.so
+++ b/frozen_deps/Cryptodome/PublicKey/_ed448.abi3.so
Binary files differ
diff --git a/frozen_deps/Cryptodome/PublicKey/_x25519.abi3.so b/frozen_deps/Cryptodome/PublicKey/_x25519.abi3.so
index bbdc726..dbb00d5 100755
--- a/frozen_deps/Cryptodome/PublicKey/_x25519.abi3.so
+++ b/frozen_deps/Cryptodome/PublicKey/_x25519.abi3.so
Binary files differ