@pairling/runtime-darwin-arm64 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/pairling-connectd +0 -0
- package/manifest.json +4 -4
- package/package.json +3 -3
- package/python/bin/python3 +0 -0
- package/python/bin/python3.12 +0 -0
- package/python/lib/libpython3.12.dylib +0 -0
- package/python/lib/python3.12/__pycache__/__future__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/_compression.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/_weakrefset.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/base64.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/bisect.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/bz2.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/calendar.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/contextlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/copyreg.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/datetime.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/enum.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/fnmatch.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/functools.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/hashlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/hmac.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/ipaddress.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/keyword.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/locale.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/lzma.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/operator.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/plistlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/pty.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/quopri.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/random.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/reprlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/selectors.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/shutil.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/signal.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/socket.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/ssl.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/string.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/struct.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/subprocess.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/tempfile.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/threading.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/tty.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/types.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/typing.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/warnings.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/weakref.cpython-312.pyc +0 -0
- package/python/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/_encoded_words.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/_parseaddr.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/_policybase.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/base64mime.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/charset.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/encoders.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/errors.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/feedparser.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/header.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/iterators.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/message.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/parser.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/quoprimime.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/utils.cpython-312.pyc +0 -0
- package/python/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc +0 -0
- package/python/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc +0 -0
- package/python/lib/python3.12/http/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/http/__pycache__/client.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/decoder.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/encoder.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/scanner.cpython-312.pyc +0 -0
- package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/re/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/api.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/error.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/lock.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/model.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
- package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
- package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
- package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
- package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
- package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
- package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
- package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
- package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
- package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
- package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
- package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
- package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
- package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
- package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
- package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
- package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
- package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +229 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1087 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
- package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/METADATA +68 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/RECORD +31 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/WHEEL +6 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/entry_points.txt +2 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/licenses/AUTHORS +8 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/licenses/LICENSE +23 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/top_level.txt +2 -0
- package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
- package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
- package/python/lib/python3.12/site-packages/cryptography/__pycache__/__about__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cryptography/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cryptography/__pycache__/utils.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
- package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
- package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
- package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
- package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
- package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
- package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
- package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
- package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
- package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
- package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
- package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
- package/python/lib/python3.12/sqlite3/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/sqlite3/__pycache__/dbapi2.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/error.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/parse.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/request.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/response.cpython-312.pyc +0 -0
- package/python/lib/python3.12/xml/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/xml/parsers/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/xml/parsers/__pycache__/expat.cpython-312.pyc +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import abc
|
|
8
|
+
|
|
9
|
+
from cryptography import utils
|
|
10
|
+
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
|
|
11
|
+
from cryptography.hazmat.primitives._cipheralgorithm import (
|
|
12
|
+
BlockCipherAlgorithm,
|
|
13
|
+
CipherAlgorithm,
|
|
14
|
+
)
|
|
15
|
+
from cryptography.hazmat.primitives.ciphers import algorithms
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Mode(metaclass=abc.ABCMeta):
|
|
19
|
+
@property
|
|
20
|
+
@abc.abstractmethod
|
|
21
|
+
def name(self) -> str:
|
|
22
|
+
"""
|
|
23
|
+
A string naming this mode (e.g. "ECB", "CBC").
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
@abc.abstractmethod
|
|
27
|
+
def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None:
|
|
28
|
+
"""
|
|
29
|
+
Checks that all the necessary invariants of this (mode, algorithm)
|
|
30
|
+
combination are met.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ModeWithInitializationVector(Mode, metaclass=abc.ABCMeta):
|
|
35
|
+
@property
|
|
36
|
+
@abc.abstractmethod
|
|
37
|
+
def initialization_vector(self) -> utils.Buffer:
|
|
38
|
+
"""
|
|
39
|
+
The value of the initialization vector for this mode as bytes.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class ModeWithTweak(Mode, metaclass=abc.ABCMeta):
|
|
44
|
+
@property
|
|
45
|
+
@abc.abstractmethod
|
|
46
|
+
def tweak(self) -> utils.Buffer:
|
|
47
|
+
"""
|
|
48
|
+
The value of the tweak for this mode as bytes.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ModeWithNonce(Mode, metaclass=abc.ABCMeta):
|
|
53
|
+
@property
|
|
54
|
+
@abc.abstractmethod
|
|
55
|
+
def nonce(self) -> utils.Buffer:
|
|
56
|
+
"""
|
|
57
|
+
The value of the nonce for this mode as bytes.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class ModeWithAuthenticationTag(Mode, metaclass=abc.ABCMeta):
|
|
62
|
+
@property
|
|
63
|
+
@abc.abstractmethod
|
|
64
|
+
def tag(self) -> bytes | None:
|
|
65
|
+
"""
|
|
66
|
+
The value of the tag supplied to the constructor of this mode.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _check_aes_key_length(self: Mode, algorithm: CipherAlgorithm) -> None:
|
|
71
|
+
if algorithm.key_size > 256 and algorithm.name == "AES":
|
|
72
|
+
raise ValueError(
|
|
73
|
+
"Only 128, 192, and 256 bit keys are allowed for this AES mode"
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _check_iv_length(
|
|
78
|
+
self: ModeWithInitializationVector, algorithm: BlockCipherAlgorithm
|
|
79
|
+
) -> None:
|
|
80
|
+
iv_len = len(self.initialization_vector)
|
|
81
|
+
if iv_len * 8 != algorithm.block_size:
|
|
82
|
+
raise ValueError(f"Invalid IV size ({iv_len}) for {self.name}.")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _check_nonce_length(
|
|
86
|
+
nonce: utils.Buffer, name: str, algorithm: CipherAlgorithm
|
|
87
|
+
) -> None:
|
|
88
|
+
if not isinstance(algorithm, BlockCipherAlgorithm):
|
|
89
|
+
raise UnsupportedAlgorithm(
|
|
90
|
+
f"{name} requires a block cipher algorithm",
|
|
91
|
+
_Reasons.UNSUPPORTED_CIPHER,
|
|
92
|
+
)
|
|
93
|
+
if len(nonce) * 8 != algorithm.block_size:
|
|
94
|
+
raise ValueError(f"Invalid nonce size ({len(nonce)}) for {name}.")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _check_iv_and_key_length(
|
|
98
|
+
self: ModeWithInitializationVector, algorithm: CipherAlgorithm
|
|
99
|
+
) -> None:
|
|
100
|
+
if not isinstance(algorithm, BlockCipherAlgorithm):
|
|
101
|
+
raise UnsupportedAlgorithm(
|
|
102
|
+
f"{self} requires a block cipher algorithm",
|
|
103
|
+
_Reasons.UNSUPPORTED_CIPHER,
|
|
104
|
+
)
|
|
105
|
+
_check_aes_key_length(self, algorithm)
|
|
106
|
+
_check_iv_length(self, algorithm)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class CBC(ModeWithInitializationVector):
|
|
110
|
+
name = "CBC"
|
|
111
|
+
|
|
112
|
+
def __init__(self, initialization_vector: utils.Buffer):
|
|
113
|
+
utils._check_byteslike("initialization_vector", initialization_vector)
|
|
114
|
+
self._initialization_vector = initialization_vector
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def initialization_vector(self) -> utils.Buffer:
|
|
118
|
+
return self._initialization_vector
|
|
119
|
+
|
|
120
|
+
validate_for_algorithm = _check_iv_and_key_length
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class XTS(ModeWithTweak):
|
|
124
|
+
name = "XTS"
|
|
125
|
+
|
|
126
|
+
def __init__(self, tweak: utils.Buffer):
|
|
127
|
+
utils._check_byteslike("tweak", tweak)
|
|
128
|
+
|
|
129
|
+
if len(tweak) != 16:
|
|
130
|
+
raise ValueError("tweak must be 128-bits (16 bytes)")
|
|
131
|
+
|
|
132
|
+
self._tweak = tweak
|
|
133
|
+
|
|
134
|
+
@property
|
|
135
|
+
def tweak(self) -> utils.Buffer:
|
|
136
|
+
return self._tweak
|
|
137
|
+
|
|
138
|
+
def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None:
|
|
139
|
+
if isinstance(algorithm, (algorithms.AES128, algorithms.AES256)):
|
|
140
|
+
raise TypeError(
|
|
141
|
+
"The AES128 and AES256 classes do not support XTS, please use "
|
|
142
|
+
"the standard AES class instead."
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
if algorithm.key_size not in (256, 512):
|
|
146
|
+
raise ValueError(
|
|
147
|
+
"The XTS specification requires a 256-bit key for AES-128-XTS"
|
|
148
|
+
" and 512-bit key for AES-256-XTS"
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class ECB(Mode):
|
|
153
|
+
name = "ECB"
|
|
154
|
+
|
|
155
|
+
validate_for_algorithm = _check_aes_key_length
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class OFB(ModeWithInitializationVector):
|
|
159
|
+
name = "OFB"
|
|
160
|
+
|
|
161
|
+
def __init__(self, initialization_vector: utils.Buffer):
|
|
162
|
+
utils._check_byteslike("initialization_vector", initialization_vector)
|
|
163
|
+
self._initialization_vector = initialization_vector
|
|
164
|
+
|
|
165
|
+
@property
|
|
166
|
+
def initialization_vector(self) -> utils.Buffer:
|
|
167
|
+
return self._initialization_vector
|
|
168
|
+
|
|
169
|
+
validate_for_algorithm = _check_iv_and_key_length
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class CFB(ModeWithInitializationVector):
|
|
173
|
+
name = "CFB"
|
|
174
|
+
|
|
175
|
+
def __init__(self, initialization_vector: utils.Buffer):
|
|
176
|
+
utils._check_byteslike("initialization_vector", initialization_vector)
|
|
177
|
+
self._initialization_vector = initialization_vector
|
|
178
|
+
|
|
179
|
+
@property
|
|
180
|
+
def initialization_vector(self) -> utils.Buffer:
|
|
181
|
+
return self._initialization_vector
|
|
182
|
+
|
|
183
|
+
validate_for_algorithm = _check_iv_and_key_length
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class CFB8(ModeWithInitializationVector):
|
|
187
|
+
name = "CFB8"
|
|
188
|
+
|
|
189
|
+
def __init__(self, initialization_vector: utils.Buffer):
|
|
190
|
+
utils._check_byteslike("initialization_vector", initialization_vector)
|
|
191
|
+
self._initialization_vector = initialization_vector
|
|
192
|
+
|
|
193
|
+
@property
|
|
194
|
+
def initialization_vector(self) -> utils.Buffer:
|
|
195
|
+
return self._initialization_vector
|
|
196
|
+
|
|
197
|
+
validate_for_algorithm = _check_iv_and_key_length
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class CTR(ModeWithNonce):
|
|
201
|
+
name = "CTR"
|
|
202
|
+
|
|
203
|
+
def __init__(self, nonce: utils.Buffer):
|
|
204
|
+
utils._check_byteslike("nonce", nonce)
|
|
205
|
+
self._nonce = nonce
|
|
206
|
+
|
|
207
|
+
@property
|
|
208
|
+
def nonce(self) -> utils.Buffer:
|
|
209
|
+
return self._nonce
|
|
210
|
+
|
|
211
|
+
def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None:
|
|
212
|
+
_check_aes_key_length(self, algorithm)
|
|
213
|
+
_check_nonce_length(self.nonce, self.name, algorithm)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
class GCM(ModeWithInitializationVector, ModeWithAuthenticationTag):
|
|
217
|
+
name = "GCM"
|
|
218
|
+
_MAX_ENCRYPTED_BYTES = (2**39 - 256) // 8
|
|
219
|
+
_MAX_AAD_BYTES = (2**64) // 8
|
|
220
|
+
|
|
221
|
+
def __init__(
|
|
222
|
+
self,
|
|
223
|
+
initialization_vector: utils.Buffer,
|
|
224
|
+
tag: bytes | None = None,
|
|
225
|
+
min_tag_length: int = 16,
|
|
226
|
+
):
|
|
227
|
+
# OpenSSL 3.0.0 constrains GCM IVs to [64, 1024] bits inclusive
|
|
228
|
+
# This is a sane limit anyway so we'll enforce it here.
|
|
229
|
+
utils._check_byteslike("initialization_vector", initialization_vector)
|
|
230
|
+
if len(initialization_vector) < 8 or len(initialization_vector) > 128:
|
|
231
|
+
raise ValueError(
|
|
232
|
+
"initialization_vector must be between 8 and 128 bytes (64 "
|
|
233
|
+
"and 1024 bits)."
|
|
234
|
+
)
|
|
235
|
+
self._initialization_vector = initialization_vector
|
|
236
|
+
if tag is not None:
|
|
237
|
+
utils._check_bytes("tag", tag)
|
|
238
|
+
if min_tag_length < 4:
|
|
239
|
+
raise ValueError("min_tag_length must be >= 4")
|
|
240
|
+
if len(tag) < min_tag_length:
|
|
241
|
+
raise ValueError(
|
|
242
|
+
f"Authentication tag must be {min_tag_length} bytes or "
|
|
243
|
+
"longer."
|
|
244
|
+
)
|
|
245
|
+
self._tag = tag
|
|
246
|
+
self._min_tag_length = min_tag_length
|
|
247
|
+
|
|
248
|
+
@property
|
|
249
|
+
def tag(self) -> bytes | None:
|
|
250
|
+
return self._tag
|
|
251
|
+
|
|
252
|
+
@property
|
|
253
|
+
def initialization_vector(self) -> utils.Buffer:
|
|
254
|
+
return self._initialization_vector
|
|
255
|
+
|
|
256
|
+
def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None:
|
|
257
|
+
_check_aes_key_length(self, algorithm)
|
|
258
|
+
if not isinstance(algorithm, BlockCipherAlgorithm):
|
|
259
|
+
raise UnsupportedAlgorithm(
|
|
260
|
+
"GCM requires a block cipher algorithm",
|
|
261
|
+
_Reasons.UNSUPPORTED_CIPHER,
|
|
262
|
+
)
|
|
263
|
+
block_size_bytes = algorithm.block_size // 8
|
|
264
|
+
if self._tag is not None and len(self._tag) > block_size_bytes:
|
|
265
|
+
raise ValueError(
|
|
266
|
+
f"Authentication tag cannot be more than {block_size_bytes} "
|
|
267
|
+
"bytes."
|
|
268
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
8
|
+
|
|
9
|
+
__all__ = ["CMAC"]
|
|
10
|
+
CMAC = rust_openssl.cmac.CMAC
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import hmac
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def bytes_eq(a: bytes, b: bytes) -> bool:
|
|
11
|
+
if not isinstance(a, bytes) or not isinstance(b, bytes):
|
|
12
|
+
raise TypeError("a and b must be bytes.")
|
|
13
|
+
|
|
14
|
+
return hmac.compare_digest(a, b)
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import abc
|
|
8
|
+
|
|
9
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
10
|
+
from cryptography.utils import Buffer
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"MD5",
|
|
14
|
+
"SHA1",
|
|
15
|
+
"SHA3_224",
|
|
16
|
+
"SHA3_256",
|
|
17
|
+
"SHA3_384",
|
|
18
|
+
"SHA3_512",
|
|
19
|
+
"SHA224",
|
|
20
|
+
"SHA256",
|
|
21
|
+
"SHA384",
|
|
22
|
+
"SHA512",
|
|
23
|
+
"SHA512_224",
|
|
24
|
+
"SHA512_256",
|
|
25
|
+
"SHAKE128",
|
|
26
|
+
"SHAKE256",
|
|
27
|
+
"SM3",
|
|
28
|
+
"BLAKE2b",
|
|
29
|
+
"BLAKE2s",
|
|
30
|
+
"ExtendableOutputFunction",
|
|
31
|
+
"Hash",
|
|
32
|
+
"HashAlgorithm",
|
|
33
|
+
"HashContext",
|
|
34
|
+
"XOFHash",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class HashAlgorithm(metaclass=abc.ABCMeta):
|
|
39
|
+
@property
|
|
40
|
+
@abc.abstractmethod
|
|
41
|
+
def name(self) -> str:
|
|
42
|
+
"""
|
|
43
|
+
A string naming this algorithm (e.g. "sha256", "md5").
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
@abc.abstractmethod
|
|
48
|
+
def digest_size(self) -> int:
|
|
49
|
+
"""
|
|
50
|
+
The size of the resulting digest in bytes.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
@abc.abstractmethod
|
|
55
|
+
def block_size(self) -> int | None:
|
|
56
|
+
"""
|
|
57
|
+
The internal block size of the hash function, or None if the hash
|
|
58
|
+
function does not use blocks internally (e.g. SHA3).
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class HashContext(metaclass=abc.ABCMeta):
|
|
63
|
+
@property
|
|
64
|
+
@abc.abstractmethod
|
|
65
|
+
def algorithm(self) -> HashAlgorithm:
|
|
66
|
+
"""
|
|
67
|
+
A HashAlgorithm that will be used by this context.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
@abc.abstractmethod
|
|
71
|
+
def update(self, data: Buffer) -> None:
|
|
72
|
+
"""
|
|
73
|
+
Processes the provided bytes through the hash.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
@abc.abstractmethod
|
|
77
|
+
def finalize(self) -> bytes:
|
|
78
|
+
"""
|
|
79
|
+
Finalizes the hash context and returns the hash digest as bytes.
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
@abc.abstractmethod
|
|
83
|
+
def copy(self) -> HashContext:
|
|
84
|
+
"""
|
|
85
|
+
Return a HashContext that is a copy of the current context.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Hash = rust_openssl.hashes.Hash
|
|
90
|
+
HashContext.register(Hash)
|
|
91
|
+
|
|
92
|
+
XOFHash = rust_openssl.hashes.XOFHash
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class ExtendableOutputFunction(metaclass=abc.ABCMeta):
|
|
96
|
+
"""
|
|
97
|
+
An interface for extendable output functions.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class SHA1(HashAlgorithm):
|
|
102
|
+
name = "sha1"
|
|
103
|
+
digest_size = 20
|
|
104
|
+
block_size = 64
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class SHA512_224(HashAlgorithm): # noqa: N801
|
|
108
|
+
name = "sha512-224"
|
|
109
|
+
digest_size = 28
|
|
110
|
+
block_size = 128
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class SHA512_256(HashAlgorithm): # noqa: N801
|
|
114
|
+
name = "sha512-256"
|
|
115
|
+
digest_size = 32
|
|
116
|
+
block_size = 128
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class SHA224(HashAlgorithm):
|
|
120
|
+
name = "sha224"
|
|
121
|
+
digest_size = 28
|
|
122
|
+
block_size = 64
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class SHA256(HashAlgorithm):
|
|
126
|
+
name = "sha256"
|
|
127
|
+
digest_size = 32
|
|
128
|
+
block_size = 64
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class SHA384(HashAlgorithm):
|
|
132
|
+
name = "sha384"
|
|
133
|
+
digest_size = 48
|
|
134
|
+
block_size = 128
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class SHA512(HashAlgorithm):
|
|
138
|
+
name = "sha512"
|
|
139
|
+
digest_size = 64
|
|
140
|
+
block_size = 128
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class SHA3_224(HashAlgorithm): # noqa: N801
|
|
144
|
+
name = "sha3-224"
|
|
145
|
+
digest_size = 28
|
|
146
|
+
block_size = None
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class SHA3_256(HashAlgorithm): # noqa: N801
|
|
150
|
+
name = "sha3-256"
|
|
151
|
+
digest_size = 32
|
|
152
|
+
block_size = None
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class SHA3_384(HashAlgorithm): # noqa: N801
|
|
156
|
+
name = "sha3-384"
|
|
157
|
+
digest_size = 48
|
|
158
|
+
block_size = None
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class SHA3_512(HashAlgorithm): # noqa: N801
|
|
162
|
+
name = "sha3-512"
|
|
163
|
+
digest_size = 64
|
|
164
|
+
block_size = None
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class SHAKE128(HashAlgorithm, ExtendableOutputFunction):
|
|
168
|
+
name = "shake128"
|
|
169
|
+
block_size = None
|
|
170
|
+
|
|
171
|
+
def __init__(self, digest_size: int):
|
|
172
|
+
if not isinstance(digest_size, int):
|
|
173
|
+
raise TypeError("digest_size must be an integer")
|
|
174
|
+
|
|
175
|
+
if digest_size < 1:
|
|
176
|
+
raise ValueError("digest_size must be a positive integer")
|
|
177
|
+
|
|
178
|
+
self._digest_size = digest_size
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
def digest_size(self) -> int:
|
|
182
|
+
return self._digest_size
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class SHAKE256(HashAlgorithm, ExtendableOutputFunction):
|
|
186
|
+
name = "shake256"
|
|
187
|
+
block_size = None
|
|
188
|
+
|
|
189
|
+
def __init__(self, digest_size: int):
|
|
190
|
+
if not isinstance(digest_size, int):
|
|
191
|
+
raise TypeError("digest_size must be an integer")
|
|
192
|
+
|
|
193
|
+
if digest_size < 1:
|
|
194
|
+
raise ValueError("digest_size must be a positive integer")
|
|
195
|
+
|
|
196
|
+
self._digest_size = digest_size
|
|
197
|
+
|
|
198
|
+
@property
|
|
199
|
+
def digest_size(self) -> int:
|
|
200
|
+
return self._digest_size
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class MD5(HashAlgorithm):
|
|
204
|
+
name = "md5"
|
|
205
|
+
digest_size = 16
|
|
206
|
+
block_size = 64
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class BLAKE2b(HashAlgorithm):
|
|
210
|
+
name = "blake2b"
|
|
211
|
+
_max_digest_size = 64
|
|
212
|
+
_min_digest_size = 1
|
|
213
|
+
block_size = 128
|
|
214
|
+
|
|
215
|
+
def __init__(self, digest_size: int):
|
|
216
|
+
if digest_size != 64:
|
|
217
|
+
raise ValueError("Digest size must be 64")
|
|
218
|
+
|
|
219
|
+
self._digest_size = digest_size
|
|
220
|
+
|
|
221
|
+
@property
|
|
222
|
+
def digest_size(self) -> int:
|
|
223
|
+
return self._digest_size
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class BLAKE2s(HashAlgorithm):
|
|
227
|
+
name = "blake2s"
|
|
228
|
+
block_size = 64
|
|
229
|
+
_max_digest_size = 32
|
|
230
|
+
_min_digest_size = 1
|
|
231
|
+
|
|
232
|
+
def __init__(self, digest_size: int):
|
|
233
|
+
if digest_size != 32:
|
|
234
|
+
raise ValueError("Digest size must be 32")
|
|
235
|
+
|
|
236
|
+
self._digest_size = digest_size
|
|
237
|
+
|
|
238
|
+
@property
|
|
239
|
+
def digest_size(self) -> int:
|
|
240
|
+
return self._digest_size
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class SM3(HashAlgorithm):
|
|
244
|
+
name = "sm3"
|
|
245
|
+
digest_size = 32
|
|
246
|
+
block_size = 64
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
8
|
+
from cryptography.hazmat.primitives import hashes
|
|
9
|
+
|
|
10
|
+
__all__ = ["HMAC"]
|
|
11
|
+
|
|
12
|
+
HMAC = rust_openssl.hmac.HMAC
|
|
13
|
+
hashes.HashContext.register(HMAC)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import abc
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class KeyDerivationFunction(metaclass=abc.ABCMeta):
|
|
11
|
+
@abc.abstractmethod
|
|
12
|
+
def derive(self, key_material: bytes) -> bytes:
|
|
13
|
+
"""
|
|
14
|
+
Deterministically generates and returns a new key based on the existing
|
|
15
|
+
key material.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
@abc.abstractmethod
|
|
19
|
+
def verify(self, key_material: bytes, expected_key: bytes) -> None:
|
|
20
|
+
"""
|
|
21
|
+
Checks whether the key generated by the key material matches the
|
|
22
|
+
expected derived key. Raises an exception if they do not match.
|
|
23
|
+
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
8
|
+
from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
|
|
9
|
+
|
|
10
|
+
Argon2id = rust_openssl.kdf.Argon2id
|
|
11
|
+
KeyDerivationFunction.register(Argon2id)
|
|
12
|
+
|
|
13
|
+
__all__ = ["Argon2id"]
|