react-native-nitro-bsx 0.0.0-stage → 0.2.35
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/LICENSE +20 -0
- package/README.md +7 -2
- package/android/CMakeLists.txt +28 -0
- package/android/build.gradle +99 -0
- package/android/src/main/AndroidManifest.xml +35 -0
- package/android/src/main/cpp/cpp-adapter.cpp +12 -0
- package/android/src/main/java/com/nitrobsx/BSXAlarmReceiver.kt +29 -0
- package/android/src/main/java/com/nitrobsx/BSXAlarmScheduler.kt +112 -0
- package/android/src/main/java/com/nitrobsx/BSXForegroundService.kt +78 -0
- package/android/src/main/java/com/nitrobsx/BSXNotifications.kt +47 -0
- package/android/src/main/java/com/nitrobsx/BSXServiceController.kt +90 -0
- package/android/src/main/java/com/nitrobsx/BSXWakeWorker.kt +136 -0
- package/android/src/main/java/com/nitrobsx/HeadlessJsTaskSupportShim.kt +41 -0
- package/android/src/main/java/com/nitrobsx/NitroBSXPackage.kt +28 -0
- package/android/src/main/res/drawable/bsx_ic_stat_swap.xml +9 -0
- package/cpp/BSXContext.cpp +263 -0
- package/cpp/BSXContext.h +49 -0
- package/cpp/BSXModule.cpp +21191 -0
- package/cpp/BSXModule.h +1523 -0
- package/cpp/CMakeLists.txt +463 -0
- package/cpp/HybridNitroBSX.cpp +1483 -0
- package/cpp/HybridNitroBSX.hpp +173 -0
- package/cpp/arith_uint256.cpp +232 -0
- package/cpp/arith_uint256.h +277 -0
- package/cpp/bsx/event.cpp +48 -0
- package/cpp/bsx/event.h +29 -0
- package/cpp/bsx/swap.h +293 -0
- package/cpp/bsx/types.cpp +486 -0
- package/cpp/bsx/types.h +308 -0
- package/cpp/bsx_db.cpp +4951 -0
- package/cpp/bsx_db.h +465 -0
- package/cpp/chain_client.h +143 -0
- package/cpp/cmake/GenVersion.cmake +52 -0
- package/cpp/coin_config.h.in +12 -0
- package/cpp/coins/block_index.cpp +33 -0
- package/cpp/coins/block_index.h +35 -0
- package/cpp/coins/btc/chainparams.cpp +70 -0
- package/cpp/coins/btc/chainparams.h +23 -0
- package/cpp/coins/btc/interface.h +30 -0
- package/cpp/coins/btc_base/interface.cpp +2200 -0
- package/cpp/coins/btc_base/interface.h +225 -0
- package/cpp/coins/btc_base/primitives.cpp +560 -0
- package/cpp/coins/btc_base/primitives.h +157 -0
- package/cpp/coins/btc_base/psbt.cpp +150 -0
- package/cpp/coins/btc_base/psbt.h +52 -0
- package/cpp/coins/btc_base/script.cpp +304 -0
- package/cpp/coins/btc_base/script.h +181 -0
- package/cpp/coins/chainparams.cpp +47 -0
- package/cpp/coins/chainparams.h +58 -0
- package/cpp/coins/firo/chainparams.cpp +52 -0
- package/cpp/coins/firo/chainparams.h +24 -0
- package/cpp/coins/firo/firo.cpp +118 -0
- package/cpp/coins/firo/firo.h +79 -0
- package/cpp/coins/firo/primitives.cpp +109 -0
- package/cpp/coins/firo/primitives.h +47 -0
- package/cpp/coins/interface.cpp +1815 -0
- package/cpp/coins/interface.h +554 -0
- package/cpp/coins/ltc/chainparams.cpp +70 -0
- package/cpp/coins/ltc/chainparams.h +22 -0
- package/cpp/coins/ltc/ltc.cpp +69 -0
- package/cpp/coins/ltc/ltc.h +82 -0
- package/cpp/coins/ltc/primitives.cpp +20 -0
- package/cpp/coins/ltc/primitives.h +18 -0
- package/cpp/coins/part/chainparams.cpp +89 -0
- package/cpp/coins/part/chainparams.h +47 -0
- package/cpp/coins/part/part.cpp +905 -0
- package/cpp/coins/part/part.h +164 -0
- package/cpp/coins/part/primitives.cpp +548 -0
- package/cpp/coins/part/primitives.h +187 -0
- package/cpp/coins/part/stake.cpp +330 -0
- package/cpp/coins/part/stake.h +92 -0
- package/cpp/coins/primitives.h +125 -0
- package/cpp/coins/registry.cpp +99 -0
- package/cpp/coins/registry.h +32 -0
- package/cpp/coins/script.h +18 -0
- package/cpp/coins/types.cpp +60 -0
- package/cpp/coins/types.h +41 -0
- package/cpp/coins/xmr/chainparams.cpp +28 -0
- package/cpp/coins/xmr/chainparams.h +24 -0
- package/cpp/coins/xmr/tx.cpp +670 -0
- package/cpp/coins/xmr/tx.h +77 -0
- package/cpp/coins/xmr/xmr.cpp +639 -0
- package/cpp/coins/xmr/xmr.h +223 -0
- package/cpp/compat/byteswap.h +74 -0
- package/cpp/compat/endian.h +98 -0
- package/cpp/compat/mbedtls/threading_alt.h +20 -0
- package/cpp/compat/sockets.h +160 -0
- package/cpp/contrib/mbedtls/CMakeLists.txt +566 -0
- package/cpp/contrib/mbedtls/LICENSE +553 -0
- package/cpp/contrib/mbedtls/cmake/MbedTLSConfig.cmake.in +3 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_encdec.h +52 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_hashing.h +30 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_mainpage.h +52 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_rng.h +27 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_ssltls.h +37 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_tcpip.h +32 -0
- package/cpp/contrib/mbedtls/doxygen/input/doc_x509.h +31 -0
- package/cpp/contrib/mbedtls/doxygen/mbedtls.doxyfile +56 -0
- package/cpp/contrib/mbedtls/framework/CMakeLists.txt +1 -0
- package/cpp/contrib/mbedtls/framework/LICENSE +553 -0
- package/cpp/contrib/mbedtls/include/CMakeLists.txt +21 -0
- package/cpp/contrib/mbedtls/include/mbedtls/build_info.h +93 -0
- package/cpp/contrib/mbedtls/include/mbedtls/debug.h +120 -0
- package/cpp/contrib/mbedtls/include/mbedtls/error.h +39 -0
- package/cpp/contrib/mbedtls/include/mbedtls/mbedtls_config.h +1189 -0
- package/cpp/contrib/mbedtls/include/mbedtls/net_sockets.h +299 -0
- package/cpp/contrib/mbedtls/include/mbedtls/oid.h +304 -0
- package/cpp/contrib/mbedtls/include/mbedtls/pkcs7.h +250 -0
- package/cpp/contrib/mbedtls/include/mbedtls/private/config_adjust_ssl.h +84 -0
- package/cpp/contrib/mbedtls/include/mbedtls/private/config_adjust_x509.h +35 -0
- package/cpp/contrib/mbedtls/include/mbedtls/ssl.h +5622 -0
- package/cpp/contrib/mbedtls/include/mbedtls/ssl_cache.h +187 -0
- package/cpp/contrib/mbedtls/include/mbedtls/ssl_ciphersuites.h +303 -0
- package/cpp/contrib/mbedtls/include/mbedtls/ssl_cookie.h +90 -0
- package/cpp/contrib/mbedtls/include/mbedtls/ssl_ticket.h +186 -0
- package/cpp/contrib/mbedtls/include/mbedtls/timing.h +105 -0
- package/cpp/contrib/mbedtls/include/mbedtls/version.h +69 -0
- package/cpp/contrib/mbedtls/include/mbedtls/x509.h +503 -0
- package/cpp/contrib/mbedtls/include/mbedtls/x509_crl.h +180 -0
- package/cpp/contrib/mbedtls/include/mbedtls/x509_crt.h +1174 -0
- package/cpp/contrib/mbedtls/include/mbedtls/x509_csr.h +368 -0
- package/cpp/contrib/mbedtls/library/CMakeLists.txt +375 -0
- package/cpp/contrib/mbedtls/library/Makefile +334 -0
- package/cpp/contrib/mbedtls/library/debug.c +285 -0
- package/cpp/contrib/mbedtls/library/debug_internal.h +108 -0
- package/cpp/contrib/mbedtls/library/error.c +505 -0
- package/cpp/contrib/mbedtls/library/mbedtls_check_config.h +376 -0
- package/cpp/contrib/mbedtls/library/mbedtls_common.h +51 -0
- package/cpp/contrib/mbedtls/library/mbedtls_config.c +40 -0
- package/cpp/contrib/mbedtls/library/mbedtls_config_check_before.h +1769 -0
- package/cpp/contrib/mbedtls/library/mbedtls_config_check_final.h +12 -0
- package/cpp/contrib/mbedtls/library/mbedtls_config_check_user.h +2436 -0
- package/cpp/contrib/mbedtls/library/mbedtls_platform_requirements.h +55 -0
- package/cpp/contrib/mbedtls/library/mbedtls_utils.h +23 -0
- package/cpp/contrib/mbedtls/library/mps_common.h +181 -0
- package/cpp/contrib/mbedtls/library/mps_error.h +89 -0
- package/cpp/contrib/mbedtls/library/mps_reader.c +538 -0
- package/cpp/contrib/mbedtls/library/mps_reader.h +366 -0
- package/cpp/contrib/mbedtls/library/mps_trace.c +112 -0
- package/cpp/contrib/mbedtls/library/mps_trace.h +154 -0
- package/cpp/contrib/mbedtls/library/net_sockets.c +684 -0
- package/cpp/contrib/mbedtls/library/pkcs7.c +784 -0
- package/cpp/contrib/mbedtls/library/ssl_cache.c +409 -0
- package/cpp/contrib/mbedtls/library/ssl_ciphersuites.c +996 -0
- package/cpp/contrib/mbedtls/library/ssl_ciphersuites_internal.h +108 -0
- package/cpp/contrib/mbedtls/library/ssl_client.c +1019 -0
- package/cpp/contrib/mbedtls/library/ssl_client.h +18 -0
- package/cpp/contrib/mbedtls/library/ssl_cookie.c +251 -0
- package/cpp/contrib/mbedtls/library/ssl_debug_helpers.h +83 -0
- package/cpp/contrib/mbedtls/library/ssl_debug_helpers_generated.c +243 -0
- package/cpp/contrib/mbedtls/library/ssl_misc.h +2851 -0
- package/cpp/contrib/mbedtls/library/ssl_msg.c +6275 -0
- package/cpp/contrib/mbedtls/library/ssl_ticket.c +453 -0
- package/cpp/contrib/mbedtls/library/ssl_tls.c +9048 -0
- package/cpp/contrib/mbedtls/library/ssl_tls12_client.c +3054 -0
- package/cpp/contrib/mbedtls/library/ssl_tls12_server.c +3546 -0
- package/cpp/contrib/mbedtls/library/ssl_tls13_client.c +3202 -0
- package/cpp/contrib/mbedtls/library/ssl_tls13_generic.c +1773 -0
- package/cpp/contrib/mbedtls/library/ssl_tls13_invasive.h +23 -0
- package/cpp/contrib/mbedtls/library/ssl_tls13_keys.c +1860 -0
- package/cpp/contrib/mbedtls/library/ssl_tls13_keys.h +668 -0
- package/cpp/contrib/mbedtls/library/ssl_tls13_server.c +3602 -0
- package/cpp/contrib/mbedtls/library/timing.c +76 -0
- package/cpp/contrib/mbedtls/library/version.c +30 -0
- package/cpp/contrib/mbedtls/library/version_features.c +244 -0
- package/cpp/contrib/mbedtls/library/x509.c +1848 -0
- package/cpp/contrib/mbedtls/library/x509_create.c +747 -0
- package/cpp/contrib/mbedtls/library/x509_crl.c +701 -0
- package/cpp/contrib/mbedtls/library/x509_crt.c +3278 -0
- package/cpp/contrib/mbedtls/library/x509_csr.c +642 -0
- package/cpp/contrib/mbedtls/library/x509_internal.h +97 -0
- package/cpp/contrib/mbedtls/library/x509_oid.c +603 -0
- package/cpp/contrib/mbedtls/library/x509_oid.h +150 -0
- package/cpp/contrib/mbedtls/library/x509write.c +171 -0
- package/cpp/contrib/mbedtls/library/x509write_crt.c +637 -0
- package/cpp/contrib/mbedtls/library/x509write_csr.c +317 -0
- package/cpp/contrib/mbedtls/pkgconfig/CMakeLists.txt +25 -0
- package/cpp/contrib/mbedtls/pkgconfig/JoinPaths.cmake +27 -0
- package/cpp/contrib/mbedtls/pkgconfig/mbedcrypto.pc.in +10 -0
- package/cpp/contrib/mbedtls/pkgconfig/mbedtls.pc.in +11 -0
- package/cpp/contrib/mbedtls/pkgconfig/mbedx509.pc.in +11 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/CMakeLists.txt +584 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/LICENSE +552 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/cmake/TF-PSA-CryptoConfig.cmake.in +3 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/CMakeLists.txt +193 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/alignment.h +700 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/check_crypto_config.h +111 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/crypto-library.make +57 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto.c +9820 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_client.c +22 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_core.h +972 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_core_common.h +52 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_driver_wrappers.h +3395 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_driver_wrappers_no_static.c +247 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_invasive.h +85 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_its.h +131 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_random.c +168 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_random.h +72 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_random_impl.h +215 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_slot_management.c +998 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_slot_management.h +330 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_storage.c +400 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_crypto_storage.h +201 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_its_file.c +254 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/psa_util.c +295 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_check_config.h +598 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_common.h +628 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_config.c +72 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_config_check_before.h +12 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_config_check_final.h +12 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_config_check_user.h +1220 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_platform_requirements.h +62 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/core/tf_psa_crypto_version.c +28 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/dispatch/psa_crypto_driver_wrappers_no_static.h +31 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/doxygen/input/doc_mainpage.h.in +51 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/doxygen/tfpsacrypto.doxyfile.in +54 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/CMakeLists.txt +142 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/CMakeLists.txt +3 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/aes.h +607 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/aria.h +342 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/bignum.h +1137 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/block_cipher.h +76 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/camellia.h +302 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/ccm.h +523 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/chacha20.h +230 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/chachapoly.h +339 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/cipher.h +1173 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/cmac.h +209 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/config_adjust_test_accelerators.h +111 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/crypto_adjust_config_enable_builtins.h +820 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/crypto_adjust_config_tweak_builtins.h +203 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/crypto_builtin_composites.h +278 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/crypto_builtin_key_derivation.h +120 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/crypto_builtin_primitives.h +136 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/ctr_drbg.h +554 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/ecdsa.h +667 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/ecjpake.h +296 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/ecp.h +1452 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/entropy.h +253 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/error_common.h +79 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/gcm.h +382 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/hmac_drbg.h +426 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/md5.h +169 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/pkcs5.h +123 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/poly1305.h +165 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/ripemd160.h +120 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/rsa.h +821 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/sha1.h +196 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/sha256.h +180 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/sha3.h +189 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private/sha512.h +188 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/include/mbedtls/private_access.h +53 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/aes.c +2236 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/aesce.c +624 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/aesce.h +135 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/aesni.c +846 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/aesni.h +162 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/aria.c +966 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum.c +2635 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_core.c +1242 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_core.h +885 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_core_invasive.h +38 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_internal.h +164 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_mod.c +394 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_mod.h +452 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_mod_raw.c +276 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_mod_raw.h +416 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bignum_mod_raw_invasive.h +34 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/block_cipher.c +207 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/block_cipher_internal.h +99 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/bn_mul.h +1094 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/camellia.c +1055 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ccm.c +773 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/chacha20.c +576 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/chacha20_neon.c +294 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/chacha20_neon.h +62 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/chachapoly.c +479 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/cipher.c +1126 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/cipher_invasive.h +28 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/cipher_wrap.c +1937 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/cipher_wrap.h +173 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/cmac.c +911 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ctr.h +35 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ctr_drbg.c +1017 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ecdsa.c +826 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ecjpake.c +1206 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ecp.c +3478 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ecp_curves.c +4798 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ecp_invasive.h +220 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/entropy.c +677 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/entropy_poll.c +89 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/entropy_poll.h +44 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/gcm.c +1314 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/hmac_drbg.c +639 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/md5.c +419 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/md_psa.h +26 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/poly1305.c +488 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_aead.c +648 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_aead.h +499 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_cipher.c +752 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_cipher.h +314 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_ecp.c +921 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_ecp.h +516 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_ffdh.c +781 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_ffdh.h +131 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_hash.c +458 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_hash.h +211 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_mac.c +495 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_mac.h +264 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_pake.c +568 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_pake.h +159 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_rsa.c +698 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_rsa.h +321 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_xof.c +149 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_crypto_xof.h +155 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_util_internal.c +282 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/psa_util_internal.h +132 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/ripemd160.c +482 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/rsa.c +2720 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/rsa_alt_helpers.c +294 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/rsa_alt_helpers.h +185 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/rsa_internal.h +172 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/rsa_invasive.h +57 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/sha1.c +473 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/sha256.c +956 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/sha3.c +951 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/builtin/src/sha512.c +1089 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/driver.cmake +54 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/CMakeLists.txt +45 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/Makefile.inc +5 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/README.md +5 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/Hacl_Curve25519.h +25 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlib/FStar_UInt128.h +124 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.h +280 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlib.h +29 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/c_endianness.h +206 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/builtin.h +16 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/callconv.h +48 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/compat.h +34 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/debug.h +57 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/target.h +102 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/types.h +61 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/kremlin/internal/wasmsupport.h +5 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/vs2013/Hacl_Curve25519.h +21 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/include/tf-psa-crypto/private/everest/x25519.h +48 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/library/Hacl_Curve25519.c +760 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/library/Hacl_Curve25519_joined.c +50 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/library/kremlib/FStar_UInt128_extracted.c +413 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c +100 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/library/legacy/Hacl_Curve25519.c +805 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/everest/library/x25519.c +52 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/CMakeLists.txt +36 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/Makefile.inc +5 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/README.md +4 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/p256-m/README.md +544 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/p256-m/p256-m.c +1514 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/p256-m/p256-m.h +135 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/p256-m_driver_entrypoints.c +312 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/p256-m/p256-m_driver_entrypoints.h +219 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/CMakeLists.txt +14 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/Makefile.inc +6 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/include/tf-psa-crypto/private/crypto_struct_pqcp.h +52 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/src/fips202_psa.h +117 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/src/pqcp-config.h +68 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/src/psa_crypto_mldsa.c +528 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/src/psa_crypto_mldsa.h +301 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/src/wrap_mldsa_native.c +66 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/drivers/pqcp/src/wrap_mldsa_native.h +37 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/CMakeLists.txt +3 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/lmots.c +768 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/lmots.h +272 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/lms.c +772 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/md.c +1182 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/md_wrap.h +46 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/nist_kw.c +458 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pk.c +1464 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pk_ecc.c +175 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pk_internal.h +188 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pk_rsa.c +106 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pk_wrap.c +667 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pk_wrap.h +101 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pkparse.c +1351 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pkwrite.c +574 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/extras/pkwrite.h +101 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/framework/CMakeLists.txt +1 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/framework/LICENSE +553 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/CMakeLists.txt +41 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/asn1.h +623 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/asn1write.h +397 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/base64.h +81 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/compat-3-crypto.h +43 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/constant_time.h +36 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/lms.h +431 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/md.h +538 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/memory_buffer_alloc.h +142 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/nist_kw.h +106 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/pem.h +157 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/pk.h +888 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/platform.h +513 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/platform_time.h +79 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/platform_util.h +197 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/private/pk_private.h +150 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/psa_util.h +199 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/mbedtls/threading.h +412 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto.h +6082 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_compat.h +74 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_config.h +2073 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_driver_common.h +42 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_driver_contexts_composites.h +182 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_driver_contexts_key_derivation.h +54 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_driver_contexts_primitives.h +135 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_driver_random.h +49 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_extra.h +2115 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_platform.h +94 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_sizes.h +1301 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_struct.h +682 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_types.h +466 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/psa/crypto_values.h +2827 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/build_info.h +193 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/private/crypto_adjust_config_auto_enabled.h +23 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/private/crypto_adjust_config_dependencies.h +58 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/private/crypto_adjust_config_derived.h +135 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/private/crypto_adjust_config_key_pair_types.h +93 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/private/crypto_adjust_config_support.h +211 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/private/crypto_adjust_config_synonyms.h +41 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/include/tf-psa-crypto/version.h +44 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/objlib.cmake +71 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/pkgconfig/CMakeLists.txt +15 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/pkgconfig/JoinPaths.cmake +27 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/pkgconfig/tfpsacrypto.pc.in +10 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/platform/CMakeLists.txt +3 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/platform/memory_buffer_alloc.c +751 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/platform/platform.c +362 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/platform/platform_util.c +428 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/platform/threading.c +311 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/platform/threading_internal.h +75 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/CMakeLists.txt +3 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/asn1parse.c +483 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/asn1write.c +465 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/base64.c +322 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/base64_internal.h +45 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/constant_time.c +247 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/constant_time_impl.h +514 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/constant_time_internal.h +540 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/crypto_oid.h +354 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/oid.c +469 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/pem.c +458 -0
- package/cpp/contrib/mbedtls/tf-psa-crypto/utilities/pkcs5.c +475 -0
- package/cpp/contrib/monero/LICENSE +41 -0
- package/cpp/contrib/monero/bsx/common/perf_timer.h +15 -0
- package/cpp/contrib/monero/bsx/common/threadpool.h +43 -0
- package/cpp/contrib/monero/bsx/hex.h +25 -0
- package/cpp/contrib/monero/bsx/misc_log_ex.h +61 -0
- package/cpp/contrib/monero/bsx/random.cpp +20 -0
- package/cpp/contrib/monero/contrib/epee/include/int-util.h +320 -0
- package/cpp/contrib/monero/contrib/epee/include/memwipe.h +81 -0
- package/cpp/contrib/monero/contrib/epee/include/misc_language.h +109 -0
- package/cpp/contrib/monero/contrib/epee/include/mlocker.h +89 -0
- package/cpp/contrib/monero/contrib/epee/include/span.h +189 -0
- package/cpp/contrib/monero/contrib/epee/include/warnings.h +31 -0
- package/cpp/contrib/monero/contrib/epee/src/memwipe.c +115 -0
- package/cpp/contrib/monero/contrib/epee/src/mlocker.cpp +197 -0
- package/cpp/contrib/monero/src/common/aligned.c +139 -0
- package/cpp/contrib/monero/src/common/aligned.h +42 -0
- package/cpp/contrib/monero/src/common/base58.cpp +259 -0
- package/cpp/contrib/monero/src/common/base58.h +46 -0
- package/cpp/contrib/monero/src/common/pod-class.h +43 -0
- package/cpp/contrib/monero/src/common/varint.h +138 -0
- package/cpp/contrib/monero/src/crypto/chacha.h +96 -0
- package/cpp/contrib/monero/src/crypto/crypto-ops-data.c +881 -0
- package/cpp/contrib/monero/src/crypto/crypto-ops.c +3891 -0
- package/cpp/contrib/monero/src/crypto/crypto-ops.h +167 -0
- package/cpp/contrib/monero/src/crypto/crypto.cpp +792 -0
- package/cpp/contrib/monero/src/crypto/crypto.h +359 -0
- package/cpp/contrib/monero/src/crypto/generic-ops.h +103 -0
- package/cpp/contrib/monero/src/crypto/hash-ops.h +105 -0
- package/cpp/contrib/monero/src/crypto/hash.c +57 -0
- package/cpp/contrib/monero/src/crypto/hash.h +110 -0
- package/cpp/contrib/monero/src/crypto/keccak.c +239 -0
- package/cpp/contrib/monero/src/crypto/keccak.h +40 -0
- package/cpp/contrib/monero/src/crypto/random.h +46 -0
- package/cpp/contrib/monero/src/crypto/tree-hash.c +257 -0
- package/cpp/contrib/monero/src/crypto/wallet/crypto.h +57 -0
- package/cpp/contrib/monero/src/crypto/wallet/ops.h +32 -0
- package/cpp/contrib/monero/src/cryptonote_config.h +365 -0
- package/cpp/contrib/monero/src/device/device.cpp +105 -0
- package/cpp/contrib/monero/src/device/device.hpp +274 -0
- package/cpp/contrib/monero/src/device/device_default.cpp +343 -0
- package/cpp/contrib/monero/src/device/device_default.hpp +156 -0
- package/cpp/contrib/monero/src/ringct/bulletproofs.cc +1097 -0
- package/cpp/contrib/monero/src/ringct/bulletproofs.h +51 -0
- package/cpp/contrib/monero/src/ringct/bulletproofs_plus.cc +1120 -0
- package/cpp/contrib/monero/src/ringct/bulletproofs_plus.h +49 -0
- package/cpp/contrib/monero/src/ringct/multiexp.cc +708 -0
- package/cpp/contrib/monero/src/ringct/multiexp.h +72 -0
- package/cpp/contrib/monero/src/ringct/rctCryptoOps.c +221 -0
- package/cpp/contrib/monero/src/ringct/rctCryptoOps.h +37 -0
- package/cpp/contrib/monero/src/ringct/rctOps.cpp +727 -0
- package/cpp/contrib/monero/src/ringct/rctOps.h +191 -0
- package/cpp/contrib/monero/src/ringct/rctSigs.cpp +1652 -0
- package/cpp/contrib/monero/src/ringct/rctSigs.h +143 -0
- package/cpp/contrib/monero/src/ringct/rctTypes.cpp +338 -0
- package/cpp/contrib/monero/src/ringct/rctTypes.h +842 -0
- package/cpp/contrib/monero/src/serialization/binary_archive.h +243 -0
- package/cpp/contrib/monero/src/serialization/container.h +146 -0
- package/cpp/contrib/monero/src/serialization/containers.h +127 -0
- package/cpp/contrib/monero/src/serialization/crypto.h +97 -0
- package/cpp/contrib/monero/src/serialization/debug_archive.h +53 -0
- package/cpp/contrib/monero/src/serialization/json_archive.h +193 -0
- package/cpp/contrib/monero/src/serialization/serialization.h +328 -0
- package/cpp/contrib/monero/src/serialization/variant.h +50 -0
- package/cpp/contrib/nlohmann/LICENSE.MIT +21 -0
- package/cpp/contrib/nlohmann/json.hpp +25526 -0
- package/cpp/contrib/nlohmann/json_fwd.hpp +187 -0
- package/cpp/contrib/notes.txt +96 -0
- package/cpp/contrib/secp256k1/CHANGELOG.md +214 -0
- package/cpp/contrib/secp256k1/CMakeLists.txt +392 -0
- package/cpp/contrib/secp256k1/CMakePresets.json +18 -0
- package/cpp/contrib/secp256k1/CONTRIBUTING.md +111 -0
- package/cpp/contrib/secp256k1/COPYING +19 -0
- package/cpp/contrib/secp256k1/Makefile.am +332 -0
- package/cpp/contrib/secp256k1/README.md +176 -0
- package/cpp/contrib/secp256k1/SECURITY.md +15 -0
- package/cpp/contrib/secp256k1/autogen.sh +3 -0
- package/cpp/contrib/secp256k1/ci/ci.sh +147 -0
- package/cpp/contrib/secp256k1/ci/linux-debian.Dockerfile +84 -0
- package/cpp/contrib/secp256k1/ci/travis.sh +68 -0
- package/cpp/contrib/secp256k1/cmake/CheckArm32Assembly.cmake +6 -0
- package/cpp/contrib/secp256k1/cmake/CheckMemorySanitizer.cmake +18 -0
- package/cpp/contrib/secp256k1/cmake/CheckStringOptionValue.cmake +10 -0
- package/cpp/contrib/secp256k1/cmake/CheckX86_64Assembly.cmake +15 -0
- package/cpp/contrib/secp256k1/cmake/DiscoverTests.cmake +71 -0
- package/cpp/contrib/secp256k1/cmake/FindValgrind.cmake +41 -0
- package/cpp/contrib/secp256k1/cmake/GeneratePkgConfigFile.cmake +8 -0
- package/cpp/contrib/secp256k1/cmake/TryAppendCFlags.cmake +24 -0
- package/cpp/contrib/secp256k1/cmake/arm-linux-gnueabihf.toolchain.cmake +3 -0
- package/cpp/contrib/secp256k1/cmake/config.cmake.in +5 -0
- package/cpp/contrib/secp256k1/cmake/source_arm32.s +9 -0
- package/cpp/contrib/secp256k1/cmake/x86_64-w64-mingw32.toolchain.cmake +3 -0
- package/cpp/contrib/secp256k1/configure.ac +590 -0
- package/cpp/contrib/secp256k1/contrib/lax_der_parsing.c +148 -0
- package/cpp/contrib/secp256k1/contrib/lax_der_parsing.h +97 -0
- package/cpp/contrib/secp256k1/contrib/lax_der_privatekey_parsing.c +112 -0
- package/cpp/contrib/secp256k1/contrib/lax_der_privatekey_parsing.h +95 -0
- package/cpp/contrib/secp256k1/doc/ellswift.md +483 -0
- package/cpp/contrib/secp256k1/doc/musig.md +54 -0
- package/cpp/contrib/secp256k1/doc/release-process.md +94 -0
- package/cpp/contrib/secp256k1/doc/safegcd_implementation.md +819 -0
- package/cpp/contrib/secp256k1/examples/CMakeLists.txt +33 -0
- package/cpp/contrib/secp256k1/examples/EXAMPLES_COPYING +121 -0
- package/cpp/contrib/secp256k1/examples/ecdh.c +121 -0
- package/cpp/contrib/secp256k1/examples/ecdsa.c +138 -0
- package/cpp/contrib/secp256k1/examples/ellswift.c +122 -0
- package/cpp/contrib/secp256k1/examples/examples_util.h +108 -0
- package/cpp/contrib/secp256k1/examples/musig.c +261 -0
- package/cpp/contrib/secp256k1/examples/schnorr.c +154 -0
- package/cpp/contrib/secp256k1/include/secp256k1.h +877 -0
- package/cpp/contrib/secp256k1/include/secp256k1_dleag.h +150 -0
- package/cpp/contrib/secp256k1/include/secp256k1_ecdh.h +63 -0
- package/cpp/contrib/secp256k1/include/secp256k1_ecdsaotves.h +55 -0
- package/cpp/contrib/secp256k1/include/secp256k1_ed25519.h +239 -0
- package/cpp/contrib/secp256k1/include/secp256k1_ellswift.h +200 -0
- package/cpp/contrib/secp256k1/include/secp256k1_extrakeys.h +250 -0
- package/cpp/contrib/secp256k1/include/secp256k1_generator.h +106 -0
- package/cpp/contrib/secp256k1/include/secp256k1_hash.h +45 -0
- package/cpp/contrib/secp256k1/include/secp256k1_musig.h +588 -0
- package/cpp/contrib/secp256k1/include/secp256k1_preallocated.h +134 -0
- package/cpp/contrib/secp256k1/include/secp256k1_recovery.h +123 -0
- package/cpp/contrib/secp256k1/include/secp256k1_schnorrsig.h +190 -0
- package/cpp/contrib/secp256k1/include/visibility.h +58 -0
- package/cpp/contrib/secp256k1/libsecp256k1.pc.in +12 -0
- package/cpp/contrib/secp256k1/sage/gen_exhaustive_groups.sage +156 -0
- package/cpp/contrib/secp256k1/sage/gen_split_lambda_constants.sage +123 -0
- package/cpp/contrib/secp256k1/sage/group_prover.sage +353 -0
- package/cpp/contrib/secp256k1/sage/prove_group_implementations.sage +285 -0
- package/cpp/contrib/secp256k1/sage/secp256k1_params.sage +39 -0
- package/cpp/contrib/secp256k1/sage/weierstrass_prover.sage +275 -0
- package/cpp/contrib/secp256k1/src/CMakeLists.txt +253 -0
- package/cpp/contrib/secp256k1/src/asm/field_10x26_arm.s +916 -0
- package/cpp/contrib/secp256k1/src/assumptions.h +87 -0
- package/cpp/contrib/secp256k1/src/checkmem.h +117 -0
- package/cpp/contrib/secp256k1/src/ecdsa.h +21 -0
- package/cpp/contrib/secp256k1/src/ecdsa_impl.h +312 -0
- package/cpp/contrib/secp256k1/src/eckey.h +28 -0
- package/cpp/contrib/secp256k1/src/eckey_impl.h +94 -0
- package/cpp/contrib/secp256k1/src/ecmult.h +64 -0
- package/cpp/contrib/secp256k1/src/ecmult_compute_table.h +16 -0
- package/cpp/contrib/secp256k1/src/ecmult_compute_table_impl.h +49 -0
- package/cpp/contrib/secp256k1/src/ecmult_const.h +38 -0
- package/cpp/contrib/secp256k1/src/ecmult_const_impl.h +402 -0
- package/cpp/contrib/secp256k1/src/ecmult_gen.h +144 -0
- package/cpp/contrib/secp256k1/src/ecmult_gen_compute_table.h +14 -0
- package/cpp/contrib/secp256k1/src/ecmult_gen_compute_table_impl.h +108 -0
- package/cpp/contrib/secp256k1/src/ecmult_gen_impl.h +341 -0
- package/cpp/contrib/secp256k1/src/ecmult_impl.h +869 -0
- package/cpp/contrib/secp256k1/src/field.h +354 -0
- package/cpp/contrib/secp256k1/src/field_10x26.h +57 -0
- package/cpp/contrib/secp256k1/src/field_10x26_impl.h +1234 -0
- package/cpp/contrib/secp256k1/src/field_5x52.h +62 -0
- package/cpp/contrib/secp256k1/src/field_5x52_impl.h +524 -0
- package/cpp/contrib/secp256k1/src/field_5x52_int128_impl.h +274 -0
- package/cpp/contrib/secp256k1/src/field_impl.h +462 -0
- package/cpp/contrib/secp256k1/src/group.h +224 -0
- package/cpp/contrib/secp256k1/src/group_impl.h +1024 -0
- package/cpp/contrib/secp256k1/src/hash.h +54 -0
- package/cpp/contrib/secp256k1/src/hash_impl.h +360 -0
- package/cpp/contrib/secp256k1/src/hsort.h +33 -0
- package/cpp/contrib/secp256k1/src/hsort_impl.h +125 -0
- package/cpp/contrib/secp256k1/src/int128.h +90 -0
- package/cpp/contrib/secp256k1/src/int128_impl.h +18 -0
- package/cpp/contrib/secp256k1/src/int128_native.h +19 -0
- package/cpp/contrib/secp256k1/src/int128_native_impl.h +94 -0
- package/cpp/contrib/secp256k1/src/int128_struct.h +14 -0
- package/cpp/contrib/secp256k1/src/int128_struct_impl.h +205 -0
- package/cpp/contrib/secp256k1/src/modinv32.h +43 -0
- package/cpp/contrib/secp256k1/src/modinv32_impl.h +725 -0
- package/cpp/contrib/secp256k1/src/modinv64.h +47 -0
- package/cpp/contrib/secp256k1/src/modinv64_impl.h +780 -0
- package/cpp/contrib/secp256k1/src/modules/dleag/Makefile.am.include +3 -0
- package/cpp/contrib/secp256k1/src/modules/dleag/main_impl.h +1073 -0
- package/cpp/contrib/secp256k1/src/modules/dleag/tests_impl.h +68 -0
- package/cpp/contrib/secp256k1/src/modules/ecdh/Makefile.am.include +5 -0
- package/cpp/contrib/secp256k1/src/modules/ecdh/bench_impl.h +54 -0
- package/cpp/contrib/secp256k1/src/modules/ecdh/main_impl.h +79 -0
- package/cpp/contrib/secp256k1/src/modules/ecdh/tests_impl.h +218 -0
- package/cpp/contrib/secp256k1/src/modules/ecdsaotves/Makefile.am.include +3 -0
- package/cpp/contrib/secp256k1/src/modules/ecdsaotves/main_impl.h +365 -0
- package/cpp/contrib/secp256k1/src/modules/ecdsaotves/tests_impl.h +49 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/Makefile.am.include +16 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/common.h +68 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/core_ed25519.h +229 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/main_impl.h +98 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/common.h +21 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/ed25519_ref10.h +2698 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/ed25519_ref10_fe_25_5.h +1056 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/ed25519_ref10_fe_51.h +518 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/fe_25_5/base.h +1344 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/fe_25_5/base2.h +40 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/fe_25_5/constants.h +40 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/ref10/fe_25_5/fe.h +220 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/scalarmult_ed25519_ref10.h +417 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/sha512/hash_sha512.h +14 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/sha512/hash_sha512_cp.h +287 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/tests_impl.h +109 -0
- package/cpp/contrib/secp256k1/src/modules/ed25519/utils.h +97 -0
- package/cpp/contrib/secp256k1/src/modules/ellswift/Makefile.am.include +5 -0
- package/cpp/contrib/secp256k1/src/modules/ellswift/bench_impl.h +106 -0
- package/cpp/contrib/secp256k1/src/modules/ellswift/main_impl.h +581 -0
- package/cpp/contrib/secp256k1/src/modules/ellswift/tests_exhaustive_impl.h +39 -0
- package/cpp/contrib/secp256k1/src/modules/ellswift/tests_impl.h +544 -0
- package/cpp/contrib/secp256k1/src/modules/extrakeys/Makefile.am.include +4 -0
- package/cpp/contrib/secp256k1/src/modules/extrakeys/main_impl.h +285 -0
- package/cpp/contrib/secp256k1/src/modules/extrakeys/tests_exhaustive_impl.h +68 -0
- package/cpp/contrib/secp256k1/src/modules/extrakeys/tests_impl.h +484 -0
- package/cpp/contrib/secp256k1/src/modules/generator/Makefile.am.include +9 -0
- package/cpp/contrib/secp256k1/src/modules/generator/main_impl.h +271 -0
- package/cpp/contrib/secp256k1/src/modules/generator/tests_impl.h +227 -0
- package/cpp/contrib/secp256k1/src/modules/musig/Makefile.am.include +8 -0
- package/cpp/contrib/secp256k1/src/modules/musig/keyagg.h +32 -0
- package/cpp/contrib/secp256k1/src/modules/musig/keyagg_impl.h +275 -0
- package/cpp/contrib/secp256k1/src/modules/musig/main_impl.h +12 -0
- package/cpp/contrib/secp256k1/src/modules/musig/session.h +24 -0
- package/cpp/contrib/secp256k1/src/modules/musig/session_impl.h +795 -0
- package/cpp/contrib/secp256k1/src/modules/musig/tests_impl.h +1161 -0
- package/cpp/contrib/secp256k1/src/modules/musig/vectors.h +346 -0
- package/cpp/contrib/secp256k1/src/modules/recovery/Makefile.am.include +5 -0
- package/cpp/contrib/secp256k1/src/modules/recovery/bench_impl.h +62 -0
- package/cpp/contrib/secp256k1/src/modules/recovery/main_impl.h +159 -0
- package/cpp/contrib/secp256k1/src/modules/recovery/tests_exhaustive_impl.h +148 -0
- package/cpp/contrib/secp256k1/src/modules/recovery/tests_impl.h +339 -0
- package/cpp/contrib/secp256k1/src/modules/schnorrsig/Makefile.am.include +5 -0
- package/cpp/contrib/secp256k1/src/modules/schnorrsig/bench_impl.h +104 -0
- package/cpp/contrib/secp256k1/src/modules/schnorrsig/main_impl.h +263 -0
- package/cpp/contrib/secp256k1/src/modules/schnorrsig/tests_exhaustive_impl.h +214 -0
- package/cpp/contrib/secp256k1/src/modules/schnorrsig/tests_impl.h +1010 -0
- package/cpp/contrib/secp256k1/src/precompute_ecmult.c +91 -0
- package/cpp/contrib/secp256k1/src/precompute_ecmult_gen.c +101 -0
- package/cpp/contrib/secp256k1/src/precomputed_ecmult.c +16456 -0
- package/cpp/contrib/secp256k1/src/precomputed_ecmult.h +40 -0
- package/cpp/contrib/secp256k1/src/precomputed_ecmult_gen.c +1779 -0
- package/cpp/contrib/secp256k1/src/precomputed_ecmult_gen.h +28 -0
- package/cpp/contrib/secp256k1/src/scalar.h +108 -0
- package/cpp/contrib/secp256k1/src/scalar_4x64.h +19 -0
- package/cpp/contrib/secp256k1/src/scalar_4x64_impl.h +1010 -0
- package/cpp/contrib/secp256k1/src/scalar_8x32.h +19 -0
- package/cpp/contrib/secp256k1/src/scalar_8x32_impl.h +830 -0
- package/cpp/contrib/secp256k1/src/scalar_impl.h +321 -0
- package/cpp/contrib/secp256k1/src/scalar_low.h +24 -0
- package/cpp/contrib/secp256k1/src/scalar_low_impl.h +215 -0
- package/cpp/contrib/secp256k1/src/scratch.h +44 -0
- package/cpp/contrib/secp256k1/src/scratch_impl.h +99 -0
- package/cpp/contrib/secp256k1/src/secp256k1.c +896 -0
- package/cpp/contrib/secp256k1/src/selftest.h +35 -0
- package/cpp/contrib/secp256k1/src/testrand.h +45 -0
- package/cpp/contrib/secp256k1/src/testrand_impl.h +162 -0
- package/cpp/contrib/secp256k1/src/testutil.h +161 -0
- package/cpp/contrib/secp256k1/src/unit_test.c +479 -0
- package/cpp/contrib/secp256k1/src/unit_test.h +147 -0
- package/cpp/contrib/secp256k1/src/util.h +469 -0
- package/cpp/contrib/secp256k1/src/util_local_visibility.h +12 -0
- package/cpp/contrib/secp256k1/tools/check-abi.sh +67 -0
- package/cpp/contrib/secp256k1/tools/symbol-check.py +72 -0
- package/cpp/contrib/secp256k1/tools/test_vectors_musig2_generate.py +656 -0
- package/cpp/contrib/secp256k1/tools/tests_wycheproof_generate_ecdh.py +166 -0
- package/cpp/contrib/secp256k1/tools/tests_wycheproof_generate_ecdsa.py +111 -0
- package/cpp/contrib/secp256k1/tools/wycheproof_utils.py +12 -0
- package/cpp/contrib/secp256k1/wasm/test_module.html +320 -0
- package/cpp/contrib/secp256k1/wasm/wrap.cpp +331 -0
- package/cpp/contrib/sqlite3.h +14349 -0
- package/cpp/contrib/sqlite3mc_amalgamation.c +369890 -0
- package/cpp/contrib/sqlite3mc_amalgamation.h +15548 -0
- package/cpp/contrib/unilib/uninorms.cpp +393 -0
- package/cpp/contrib/unilib/uninorms.h +56 -0
- package/cpp/contrib/unilib/utf8.cpp +78 -0
- package/cpp/contrib/unilib/utf8.h +260 -0
- package/cpp/contrib/update_mbedtls.sh +85 -0
- package/cpp/crypto/aes.cpp +141 -0
- package/cpp/crypto/aes.h +67 -0
- package/cpp/crypto/chacha20.cpp +342 -0
- package/cpp/crypto/chacha20.h +82 -0
- package/cpp/crypto/chacha20poly1305.cpp +91 -0
- package/cpp/crypto/chacha20poly1305.h +46 -0
- package/cpp/crypto/common.h +85 -0
- package/cpp/crypto/ctaes/COPYING +21 -0
- package/cpp/crypto/ctaes/README.md +41 -0
- package/cpp/crypto/ctaes/bench.c +170 -0
- package/cpp/crypto/ctaes/ctaes.c +556 -0
- package/cpp/crypto/ctaes/ctaes.h +41 -0
- package/cpp/crypto/ctaes/test.c +110 -0
- package/cpp/crypto/extkey.cpp +257 -0
- package/cpp/crypto/extkey.h +66 -0
- package/cpp/crypto/hmac_sha512.cpp +37 -0
- package/cpp/crypto/hmac_sha512.h +32 -0
- package/cpp/crypto/merkle.cpp +47 -0
- package/cpp/crypto/merkle.h +20 -0
- package/cpp/crypto/poly1305.cpp +223 -0
- package/cpp/crypto/poly1305.h +59 -0
- package/cpp/crypto/ripemd160.cpp +292 -0
- package/cpp/crypto/ripemd160.h +28 -0
- package/cpp/crypto/scrypt-sse2.cpp +141 -0
- package/cpp/crypto/scrypt.cpp +336 -0
- package/cpp/crypto/scrypt.h +49 -0
- package/cpp/crypto/sealed_key.cpp +62 -0
- package/cpp/crypto/sealed_key.h +34 -0
- package/cpp/crypto/secure_bytes.h +16 -0
- package/cpp/crypto/sha512.cpp +206 -0
- package/cpp/crypto/sha512.h +29 -0
- package/cpp/crypto/util.cpp +77 -0
- package/cpp/crypto/util.h +32 -0
- package/cpp/debug_rpc.cpp +703 -0
- package/cpp/debug_rpc.h +63 -0
- package/cpp/electrum.cpp +931 -0
- package/cpp/electrum.h +169 -0
- package/cpp/engine/xmr_engine.cpp +463 -0
- package/cpp/engine/xmr_engine.h +84 -0
- package/cpp/engine/xmr_engine_c.cpp +141 -0
- package/cpp/engine/xmr_engine_c.h +35 -0
- package/cpp/fees.cpp +270 -0
- package/cpp/fees.h +60 -0
- package/cpp/height_search.cpp +64 -0
- package/cpp/height_search.h +27 -0
- package/cpp/main.cpp +146 -0
- package/cpp/messages_npb.cpp +701 -0
- package/cpp/messages_npb.h +667 -0
- package/cpp/mnemonic/mnemonic.cpp +715 -0
- package/cpp/mnemonic/mnemonic.h +52 -0
- package/cpp/mnemonic/wordlists/english.h +1103 -0
- package/cpp/mnemonic/wordlists/japanese.h +2212 -0
- package/cpp/network/bridge.cpp +232 -0
- package/cpp/network/bridge.h +115 -0
- package/cpp/network/ca_roots.cpp +114 -0
- package/cpp/network/ca_roots.h +12 -0
- package/cpp/network/http_client.cpp +261 -0
- package/cpp/network/http_client.h +33 -0
- package/cpp/network/pem.cpp +84 -0
- package/cpp/network/pem.h +22 -0
- package/cpp/network/psa_user_config.h +15 -0
- package/cpp/network/socks5.cpp +180 -0
- package/cpp/network/socks5.h +26 -0
- package/cpp/network/tls_transport.cpp +502 -0
- package/cpp/network/tls_transport.h +62 -0
- package/cpp/network/transport.cpp +169 -0
- package/cpp/network/transport.h +115 -0
- package/cpp/network/url.cpp +88 -0
- package/cpp/network/url.h +25 -0
- package/cpp/network/websocket.cpp +253 -0
- package/cpp/network/websocket.h +68 -0
- package/cpp/network/ws_transport.cpp +361 -0
- package/cpp/network/ws_transport.h +72 -0
- package/cpp/node_client.cpp +1196 -0
- package/cpp/node_client.h +209 -0
- package/cpp/node_scan.h +35 -0
- package/cpp/schema.cpp +1249 -0
- package/cpp/schema.h +132 -0
- package/cpp/smsg.cpp +453 -0
- package/cpp/smsg.h +43 -0
- package/cpp/support/allocators/secure.h +85 -0
- package/cpp/support/cleanse.cpp +35 -0
- package/cpp/support/cleanse.h +15 -0
- package/cpp/support/coop.cpp +319 -0
- package/cpp/support/coop.h +157 -0
- package/cpp/support/lockedpool.cpp +406 -0
- package/cpp/support/lockedpool.h +240 -0
- package/cpp/uint256.cpp +62 -0
- package/cpp/uint256.h +121 -0
- package/cpp/util/base58.cpp +181 -0
- package/cpp/util/base58.h +45 -0
- package/cpp/util/bech32.cpp +578 -0
- package/cpp/util/bech32.h +96 -0
- package/cpp/util/debug.cpp +23 -0
- package/cpp/util/debug.h +12 -0
- package/cpp/util/int.cpp +118 -0
- package/cpp/util/int.h +18 -0
- package/cpp/util/json.h +26 -0
- package/cpp/util/log.cpp +137 -0
- package/cpp/util/log.h +37 -0
- package/cpp/util/mutex.h +89 -0
- package/cpp/util/platform.cpp +90 -0
- package/cpp/util/platform.h +17 -0
- package/cpp/util/random.cpp +136 -0
- package/cpp/util/random.h +28 -0
- package/cpp/util/rpc.cpp +192 -0
- package/cpp/util/rpc.h +454 -0
- package/cpp/util/str.cpp +254 -0
- package/cpp/util/str.h +54 -0
- package/cpp/util/thread.cpp +17 -0
- package/cpp/util/thread.h +12 -0
- package/cpp/util/time.cpp +30 -0
- package/cpp/util/time.h +30 -0
- package/cpp/util/tinyformat.h +1163 -0
- package/cpp/util/vector.h +83 -0
- package/cpp/version.h.in +12 -0
- package/cpp/view_key_chain.h +283 -0
- package/cpp/wallet/account_wallet.cpp +668 -0
- package/cpp/wallet/account_wallet.h +136 -0
- package/cpp/wallet/base_wallet.cpp +302 -0
- package/cpp/wallet/base_wallet.h +129 -0
- package/cpp/wallet/debug_wallet.cpp +40 -0
- package/cpp/wallet/debug_wallet.h +36 -0
- package/cpp/wallet/encrypted_seed.cpp +96 -0
- package/cpp/wallet/encrypted_seed.h +41 -0
- package/cpp/wallet/host_wallet.cpp +85 -0
- package/cpp/wallet/host_wallet.h +51 -0
- package/cpp/wallet/native_wallet.cpp +34 -0
- package/cpp/wallet/native_wallet.h +28 -0
- package/cpp/wallet/xmr/account_wallet.cpp +803 -0
- package/cpp/wallet/xmr/account_wallet.h +139 -0
- package/cpp/wallet/xmr/builder.cpp +568 -0
- package/cpp/wallet/xmr/builder.h +65 -0
- package/cpp/wallet/xmr/chain.cpp +1437 -0
- package/cpp/wallet/xmr/chain.h +213 -0
- package/cpp/wallet/xmr/daemon.cpp +583 -0
- package/cpp/wallet/xmr/daemon.h +153 -0
- package/cpp/wallet/xmr/decoys.cpp +197 -0
- package/cpp/wallet/xmr/decoys.h +64 -0
- package/cpp/wallet/xmr/epee.cpp +448 -0
- package/cpp/wallet/xmr/epee.h +25 -0
- package/cpp/wallet/xmr/fee.cpp +169 -0
- package/cpp/wallet/xmr/fee.h +61 -0
- package/cpp/wallet/xmr/reserve_proof.cpp +169 -0
- package/cpp/wallet/xmr/reserve_proof.h +24 -0
- package/cpp/wallet/xmr/scanner.cpp +860 -0
- package/cpp/wallet/xmr/scanner.h +239 -0
- package/lib/commonjs/NativeNitroBSX.js +128 -0
- package/lib/commonjs/NativeNitroBSX.js.map +1 -0
- package/lib/commonjs/format.js +21 -0
- package/lib/commonjs/format.js.map +1 -0
- package/lib/commonjs/index.js +50 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/service.js +75 -0
- package/lib/commonjs/service.js.map +1 -0
- package/lib/commonjs/specs/NitroBSX.nitro.js +6 -0
- package/lib/commonjs/specs/NitroBSX.nitro.js.map +1 -0
- package/lib/module/NativeNitroBSX.js +124 -0
- package/lib/module/NativeNitroBSX.js.map +1 -0
- package/lib/module/format.js +15 -0
- package/lib/module/format.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/service.js +66 -0
- package/lib/module/service.js.map +1 -0
- package/lib/module/specs/NitroBSX.nitro.js +4 -0
- package/lib/module/specs/NitroBSX.nitro.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeNitroBSX.d.ts +94 -0
- package/lib/typescript/commonjs/src/NativeNitroBSX.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/format.d.ts +3 -0
- package/lib/typescript/commonjs/src/format.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/service.d.ts +28 -0
- package/lib/typescript/commonjs/src/service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/specs/NitroBSX.nitro.d.ts +251 -0
- package/lib/typescript/commonjs/src/specs/NitroBSX.nitro.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeNitroBSX.d.ts +94 -0
- package/lib/typescript/module/src/NativeNitroBSX.d.ts.map +1 -0
- package/lib/typescript/module/src/format.d.ts +3 -0
- package/lib/typescript/module/src/format.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +5 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/service.d.ts +28 -0
- package/lib/typescript/module/src/service.d.ts.map +1 -0
- package/lib/typescript/module/src/specs/NitroBSX.nitro.d.ts +251 -0
- package/lib/typescript/module/src/specs/NitroBSX.nitro.d.ts.map +1 -0
- package/nitro.json +19 -0
- package/nitrogen/generated/android/NitroBSX+autolinking.cmake +81 -0
- package/nitrogen/generated/android/NitroBSX+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroBSXOnLoad.cpp +49 -0
- package/nitrogen/generated/android/NitroBSXOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrobsx/NitroBSXOnLoad.kt +35 -0
- package/nitrogen/generated/ios/NitroBSX+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroBSX-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/NitroBSX-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/NitroBSX-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/NitroBSXAutolinking.mm +35 -0
- package/nitrogen/generated/ios/NitroBSXAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/HybridNitroBSXSpec.cpp +91 -0
- package/nitrogen/generated/shared/c++/HybridNitroBSXSpec.hpp +142 -0
- package/nitrogen/generated/shared/c++/NotificationPair.hpp +87 -0
- package/nitrogen/generated/shared/c++/SignOutcome.hpp +80 -0
- package/nitrogen/generated/shared/c++/SignTxResult.hpp +89 -0
- package/package.json +172 -4
- package/react-native-nitro-bsx.podspec +33 -0
- package/react-native.config.js +26 -0
- package/scripts/build-ios.sh +49 -0
- package/src/NativeNitroBSX.ts +203 -0
- package/src/format.ts +14 -0
- package/src/index.ts +4 -0
- package/src/service.ts +77 -0
- package/src/specs/NitroBSX.nitro.ts +300 -0
|
@@ -0,0 +1,2073 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* \file psa/crypto_config.h
|
|
3
|
+
* \brief PSA crypto configuration options (set of defines)
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* This file determines which cryptographic mechanisms are enabled
|
|
8
|
+
* through the PSA Cryptography API (\c psa_xxx() functions).
|
|
9
|
+
*
|
|
10
|
+
* To enable a cryptographic mechanism, uncomment the definition of
|
|
11
|
+
* the corresponding \c PSA_WANT_xxx preprocessor symbol.
|
|
12
|
+
* To disable a cryptographic mechanism, comment out the definition of
|
|
13
|
+
* the corresponding \c PSA_WANT_xxx preprocessor symbol.
|
|
14
|
+
* The names of cryptographic mechanisms correspond to values
|
|
15
|
+
* defined in psa/crypto_values.h, with the prefix \c PSA_WANT_ instead
|
|
16
|
+
* of \c PSA_.
|
|
17
|
+
*
|
|
18
|
+
* Note that many cryptographic mechanisms involve two symbols: one for
|
|
19
|
+
* the key type (\c PSA_WANT_KEY_TYPE_xxx) and one for the algorithm
|
|
20
|
+
* (\c PSA_WANT_ALG_xxx). Mechanisms with additional parameters may involve
|
|
21
|
+
* additional symbols.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Copyright The Mbed TLS Contributors
|
|
26
|
+
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
#ifndef PSA_CRYPTO_CONFIG_H
|
|
30
|
+
#define PSA_CRYPTO_CONFIG_H
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This is an optional version symbol that enables compatibility handling of
|
|
34
|
+
* config files.
|
|
35
|
+
*
|
|
36
|
+
* It is equal to the #TF_PSA_CRYPTO_VERSION_NUMBER of the TF-PSA-Crypto
|
|
37
|
+
* version introduced the config format we want to be compatible with.
|
|
38
|
+
*/
|
|
39
|
+
#define TF_PSA_CRYPTO_CONFIG_VERSION 0x01000000
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* \name SECTION: SECTION Cryptographic mechanism selection (PSA API)
|
|
43
|
+
*
|
|
44
|
+
* This section sets PSA API settings.
|
|
45
|
+
* \{
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
#define PSA_WANT_ALG_CBC_NO_PADDING 1
|
|
49
|
+
#define PSA_WANT_ALG_CBC_PKCS7 1
|
|
50
|
+
#define PSA_WANT_ALG_CCM 1
|
|
51
|
+
#define PSA_WANT_ALG_CCM_STAR_NO_TAG 1
|
|
52
|
+
#define PSA_WANT_ALG_CMAC 1
|
|
53
|
+
#define PSA_WANT_ALG_CFB 1
|
|
54
|
+
#define PSA_WANT_ALG_CHACHA20_POLY1305 1
|
|
55
|
+
#define PSA_WANT_ALG_CTR 1
|
|
56
|
+
#define PSA_WANT_ALG_DETERMINISTIC_ECDSA 1
|
|
57
|
+
#define PSA_WANT_ALG_ECB_NO_PADDING 1
|
|
58
|
+
#define PSA_WANT_ALG_ECDH 1
|
|
59
|
+
#define PSA_WANT_ALG_FFDH 1
|
|
60
|
+
#define PSA_WANT_ALG_ECDSA 1
|
|
61
|
+
#define PSA_WANT_ALG_JPAKE 1
|
|
62
|
+
#define PSA_WANT_ALG_GCM 1
|
|
63
|
+
#define PSA_WANT_ALG_HKDF 1
|
|
64
|
+
#define PSA_WANT_ALG_HKDF_EXTRACT 1
|
|
65
|
+
#define PSA_WANT_ALG_HKDF_EXPAND 1
|
|
66
|
+
#define PSA_WANT_ALG_HMAC 1
|
|
67
|
+
#define PSA_WANT_ALG_MD5 1
|
|
68
|
+
#define PSA_WANT_ALG_OFB 1
|
|
69
|
+
#define PSA_WANT_ALG_PBKDF2_HMAC 1
|
|
70
|
+
#define PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 1
|
|
71
|
+
#define PSA_WANT_ALG_RIPEMD160 1
|
|
72
|
+
#define PSA_WANT_ALG_RSA_OAEP 1
|
|
73
|
+
#define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT 1
|
|
74
|
+
#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN 1
|
|
75
|
+
#define PSA_WANT_ALG_RSA_PSS 1
|
|
76
|
+
#define PSA_WANT_ALG_SHA_1 1
|
|
77
|
+
#define PSA_WANT_ALG_SHA_224 1
|
|
78
|
+
#define PSA_WANT_ALG_SHA_256 1
|
|
79
|
+
#define PSA_WANT_ALG_SHA_384 1
|
|
80
|
+
#define PSA_WANT_ALG_SHA_512 1
|
|
81
|
+
#define PSA_WANT_ALG_SHA3_224 1
|
|
82
|
+
#define PSA_WANT_ALG_SHA3_256 1
|
|
83
|
+
#define PSA_WANT_ALG_SHA3_384 1
|
|
84
|
+
#define PSA_WANT_ALG_SHA3_512 1
|
|
85
|
+
#define PSA_WANT_ALG_STREAM_CIPHER 1
|
|
86
|
+
#define PSA_WANT_ALG_TLS12_PRF 1
|
|
87
|
+
#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1
|
|
88
|
+
#define PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS 1
|
|
89
|
+
#define PSA_WANT_ALG_SHAKE128 1
|
|
90
|
+
#define PSA_WANT_ALG_SHAKE256 1
|
|
91
|
+
|
|
92
|
+
#define PSA_WANT_ECC_BRAINPOOL_P_R1_256 1
|
|
93
|
+
#define PSA_WANT_ECC_BRAINPOOL_P_R1_384 1
|
|
94
|
+
#define PSA_WANT_ECC_BRAINPOOL_P_R1_512 1
|
|
95
|
+
#define PSA_WANT_ECC_MONTGOMERY_255 1
|
|
96
|
+
#define PSA_WANT_ECC_MONTGOMERY_448 1
|
|
97
|
+
#define PSA_WANT_ECC_SECP_K1_256 1
|
|
98
|
+
/* For secp256r1, consider enabling #MBEDTLS_PSA_P256M_DRIVER_ENABLED
|
|
99
|
+
* (see the description in psa/crypto_config.h for details). */
|
|
100
|
+
#define PSA_WANT_ECC_SECP_R1_256 1
|
|
101
|
+
#define PSA_WANT_ECC_SECP_R1_384 1
|
|
102
|
+
#define PSA_WANT_ECC_SECP_R1_521 1
|
|
103
|
+
|
|
104
|
+
#define PSA_WANT_DH_RFC7919_2048 1
|
|
105
|
+
#define PSA_WANT_DH_RFC7919_3072 1
|
|
106
|
+
#define PSA_WANT_DH_RFC7919_4096 1
|
|
107
|
+
#define PSA_WANT_DH_RFC7919_6144 1
|
|
108
|
+
#define PSA_WANT_DH_RFC7919_8192 1
|
|
109
|
+
|
|
110
|
+
#define PSA_WANT_KEY_TYPE_DERIVE 1
|
|
111
|
+
#define PSA_WANT_KEY_TYPE_PASSWORD 1
|
|
112
|
+
#define PSA_WANT_KEY_TYPE_PASSWORD_HASH 1
|
|
113
|
+
#define PSA_WANT_KEY_TYPE_HMAC 1
|
|
114
|
+
#define PSA_WANT_KEY_TYPE_AES 1
|
|
115
|
+
#define PSA_WANT_KEY_TYPE_ARIA 1
|
|
116
|
+
#define PSA_WANT_KEY_TYPE_CAMELLIA 1
|
|
117
|
+
#define PSA_WANT_KEY_TYPE_CHACHA20 1
|
|
118
|
+
#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1
|
|
119
|
+
#define PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY 1
|
|
120
|
+
#define PSA_WANT_KEY_TYPE_RAW_DATA 1
|
|
121
|
+
#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY 1
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* The following symbols extend and deprecate the legacy
|
|
125
|
+
* PSA_WANT_KEY_TYPE_xxx_KEY_PAIR ones. They include the usage of that key in
|
|
126
|
+
* the name's suffix. "_USE" is the most generic and it can be used to describe
|
|
127
|
+
* a generic suport, whereas other ones add more features on top of that and
|
|
128
|
+
* they are more specific.
|
|
129
|
+
*/
|
|
130
|
+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1
|
|
131
|
+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1
|
|
132
|
+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT 1
|
|
133
|
+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE 1
|
|
134
|
+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE 1
|
|
135
|
+
|
|
136
|
+
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC 1
|
|
137
|
+
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT 1
|
|
138
|
+
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT 1
|
|
139
|
+
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE 1
|
|
140
|
+
//#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE 1 /* Not supported */
|
|
141
|
+
|
|
142
|
+
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC 1
|
|
143
|
+
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT 1
|
|
144
|
+
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT 1
|
|
145
|
+
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE 1
|
|
146
|
+
//#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_DERIVE 1 /* Not supported */
|
|
147
|
+
/** \} name SECTION Cryptographic mechanism selection (PSA API) */
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* \name SECTION: Platform abstraction layer
|
|
151
|
+
*
|
|
152
|
+
* This section sets platform specific settings.
|
|
153
|
+
* \{
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
|
158
|
+
*
|
|
159
|
+
* Enable the buffer allocator implementation that makes use of a (stack)
|
|
160
|
+
* based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
|
|
161
|
+
* calls)
|
|
162
|
+
*
|
|
163
|
+
* Module: platform/memory_buffer_alloc.c
|
|
164
|
+
*
|
|
165
|
+
* Requires: MBEDTLS_PLATFORM_C
|
|
166
|
+
* MBEDTLS_PLATFORM_MEMORY (to use it within Mbed TLS)
|
|
167
|
+
*
|
|
168
|
+
* Enable this module to enable the buffer memory allocator.
|
|
169
|
+
*/
|
|
170
|
+
//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* \def MBEDTLS_FS_IO
|
|
174
|
+
*
|
|
175
|
+
* Enable functions that use the filesystem.
|
|
176
|
+
*/
|
|
177
|
+
#define MBEDTLS_FS_IO
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* \def MBEDTLS_HAVE_TIME
|
|
181
|
+
*
|
|
182
|
+
* System has time.h and time().
|
|
183
|
+
* The time does not need to be correct, only time differences are used,
|
|
184
|
+
* by contrast with MBEDTLS_HAVE_TIME_DATE
|
|
185
|
+
*
|
|
186
|
+
* Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT,
|
|
187
|
+
* MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and
|
|
188
|
+
* MBEDTLS_PLATFORM_STD_TIME.
|
|
189
|
+
*
|
|
190
|
+
* Comment if your system does not support time functions.
|
|
191
|
+
*/
|
|
192
|
+
#define MBEDTLS_HAVE_TIME
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* \def MBEDTLS_HAVE_TIME_DATE
|
|
196
|
+
*
|
|
197
|
+
* System has time.h, time(), and an implementation for
|
|
198
|
+
* mbedtls_platform_gmtime_r() (see below).
|
|
199
|
+
* The time needs to be correct (not necessarily very accurate, but at least
|
|
200
|
+
* the date should be correct). This is used to verify the validity period of
|
|
201
|
+
* X.509 certificates.
|
|
202
|
+
*
|
|
203
|
+
* Comment if your system does not have a correct clock.
|
|
204
|
+
*
|
|
205
|
+
* \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that
|
|
206
|
+
* behaves similarly to the gmtime_r() function from the C standard. Refer to
|
|
207
|
+
* the documentation for mbedtls_platform_gmtime_r() for more information.
|
|
208
|
+
*
|
|
209
|
+
* \note It is possible to configure an implementation for
|
|
210
|
+
* mbedtls_platform_gmtime_r() at compile-time by using the macro
|
|
211
|
+
* MBEDTLS_PLATFORM_GMTIME_R_ALT.
|
|
212
|
+
*/
|
|
213
|
+
#define MBEDTLS_HAVE_TIME_DATE
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* \def MBEDTLS_MEMORY_DEBUG
|
|
217
|
+
*
|
|
218
|
+
* Enable debugging of buffer allocator memory issues. Automatically prints
|
|
219
|
+
* (to stderr) all (fatal) messages on memory allocation issues. Enables
|
|
220
|
+
* function for 'debug output' of allocated memory.
|
|
221
|
+
*
|
|
222
|
+
* Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
|
223
|
+
*
|
|
224
|
+
* Uncomment this macro to let the buffer allocator print out error messages.
|
|
225
|
+
*/
|
|
226
|
+
//#define MBEDTLS_MEMORY_DEBUG
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* \def MBEDTLS_MEMORY_BACKTRACE
|
|
230
|
+
*
|
|
231
|
+
* Include backtrace information with each allocated block.
|
|
232
|
+
*
|
|
233
|
+
* Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
|
234
|
+
* GLIBC-compatible backtrace() and backtrace_symbols() support
|
|
235
|
+
*
|
|
236
|
+
* Uncomment this macro to include backtrace information
|
|
237
|
+
*/
|
|
238
|
+
//#define MBEDTLS_MEMORY_BACKTRACE
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* \def MBEDTLS_PLATFORM_C
|
|
242
|
+
*
|
|
243
|
+
* Enable the platform abstraction layer that allows you to re-assign
|
|
244
|
+
* functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
|
|
245
|
+
*
|
|
246
|
+
* Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
|
|
247
|
+
* or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
|
|
248
|
+
* above to be specified at runtime or compile time respectively.
|
|
249
|
+
*
|
|
250
|
+
* \note This abstraction layer must be enabled on Windows (including MSYS2)
|
|
251
|
+
* as other modules rely on it for a fixed snprintf implementation.
|
|
252
|
+
*
|
|
253
|
+
* Module: platform/platform.c
|
|
254
|
+
* Caller: Most other .c files
|
|
255
|
+
*
|
|
256
|
+
* This module enables abstraction of common (libc) functions.
|
|
257
|
+
*/
|
|
258
|
+
#define MBEDTLS_PLATFORM_C
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* \def MBEDTLS_PLATFORM_EXIT_ALT
|
|
262
|
+
*
|
|
263
|
+
* MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let Mbed TLS support the
|
|
264
|
+
* function in the platform abstraction layer.
|
|
265
|
+
*
|
|
266
|
+
* Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, Mbed TLS will
|
|
267
|
+
* provide a function "mbedtls_platform_set_printf()" that allows you to set an
|
|
268
|
+
* alternative printf function pointer.
|
|
269
|
+
*
|
|
270
|
+
* All these define require MBEDTLS_PLATFORM_C to be defined!
|
|
271
|
+
*
|
|
272
|
+
* \note MBEDTLS_PLATFORM_SNPRINTF_ALT and MBEDTLS_PLATFORM_VSNPRINTF_ALT
|
|
273
|
+
* are required on some Windows C runtimes.
|
|
274
|
+
* They will be enabled automatically by build_info.h when building with
|
|
275
|
+
* older versions of MSVC or with MinGW32.
|
|
276
|
+
*
|
|
277
|
+
* \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
|
|
278
|
+
* MBEDTLS_PLATFORM_XXX_MACRO!
|
|
279
|
+
*
|
|
280
|
+
* Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
|
|
281
|
+
*
|
|
282
|
+
* Uncomment a macro to enable alternate implementation of specific base
|
|
283
|
+
* platform function
|
|
284
|
+
*/
|
|
285
|
+
//#define MBEDTLS_PLATFORM_SETBUF_ALT
|
|
286
|
+
//#define MBEDTLS_PLATFORM_EXIT_ALT
|
|
287
|
+
//#define MBEDTLS_PLATFORM_TIME_ALT
|
|
288
|
+
//#define MBEDTLS_PLATFORM_FPRINTF_ALT
|
|
289
|
+
//#define MBEDTLS_PLATFORM_PRINTF_ALT
|
|
290
|
+
//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
|
|
291
|
+
//#define MBEDTLS_PLATFORM_VSNPRINTF_ALT
|
|
292
|
+
//#define MBEDTLS_PLATFORM_NV_SEED_ALT
|
|
293
|
+
//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
|
|
294
|
+
//#define MBEDTLS_PLATFORM_MS_TIME_ALT
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Uncomment the macro to let Mbed TLS use your alternate implementation of
|
|
298
|
+
* mbedtls_platform_gmtime_r(). This replaces the default implementation in
|
|
299
|
+
* platform_util.c.
|
|
300
|
+
*
|
|
301
|
+
* gmtime() is not a thread-safe function as defined in the C standard. The
|
|
302
|
+
* library will try to use safer implementations of this function, such as
|
|
303
|
+
* gmtime_r() when available. However, if Mbed TLS cannot identify the target
|
|
304
|
+
* system, the implementation of mbedtls_platform_gmtime_r() will default to
|
|
305
|
+
* using the standard gmtime(). In this case, calls from the library to
|
|
306
|
+
* gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex
|
|
307
|
+
* if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the
|
|
308
|
+
* library are also guarded with this mutex to avoid race conditions. However,
|
|
309
|
+
* if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will
|
|
310
|
+
* unconditionally use the implementation for mbedtls_platform_gmtime_r()
|
|
311
|
+
* supplied at compile time.
|
|
312
|
+
*/
|
|
313
|
+
//#define MBEDTLS_PLATFORM_GMTIME_R_ALT
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* \def MBEDTLS_PLATFORM_MEMORY
|
|
317
|
+
*
|
|
318
|
+
* Enable the memory allocation layer.
|
|
319
|
+
*
|
|
320
|
+
* By default Mbed TLS uses the system-provided calloc() and free().
|
|
321
|
+
* This allows different allocators (self-implemented or provided) to be
|
|
322
|
+
* provided to the platform abstraction layer.
|
|
323
|
+
*
|
|
324
|
+
* Enabling #MBEDTLS_PLATFORM_MEMORY without the
|
|
325
|
+
* MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
|
|
326
|
+
* "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
|
|
327
|
+
* free() function pointer at runtime.
|
|
328
|
+
*
|
|
329
|
+
* Enabling #MBEDTLS_PLATFORM_MEMORY and specifying
|
|
330
|
+
* MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
|
|
331
|
+
* alternate function at compile time.
|
|
332
|
+
*
|
|
333
|
+
* An overview of how the value of mbedtls_calloc is determined:
|
|
334
|
+
*
|
|
335
|
+
* - if !MBEDTLS_PLATFORM_MEMORY
|
|
336
|
+
* - mbedtls_calloc = calloc
|
|
337
|
+
* - if MBEDTLS_PLATFORM_MEMORY
|
|
338
|
+
* - if (MBEDTLS_PLATFORM_CALLOC_MACRO && MBEDTLS_PLATFORM_FREE_MACRO):
|
|
339
|
+
* - mbedtls_calloc = MBEDTLS_PLATFORM_CALLOC_MACRO
|
|
340
|
+
* - if !(MBEDTLS_PLATFORM_CALLOC_MACRO && MBEDTLS_PLATFORM_FREE_MACRO):
|
|
341
|
+
* - Dynamic setup via mbedtls_platform_set_calloc_free is now possible with a default value MBEDTLS_PLATFORM_STD_CALLOC.
|
|
342
|
+
* - How is MBEDTLS_PLATFORM_STD_CALLOC handled?
|
|
343
|
+
* - if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS:
|
|
344
|
+
* - MBEDTLS_PLATFORM_STD_CALLOC is not set to anything;
|
|
345
|
+
* - MBEDTLS_PLATFORM_STD_MEM_HDR can be included if present;
|
|
346
|
+
* - if !MBEDTLS_PLATFORM_NO_STD_FUNCTIONS:
|
|
347
|
+
* - if MBEDTLS_PLATFORM_STD_CALLOC is present:
|
|
348
|
+
* - User-defined MBEDTLS_PLATFORM_STD_CALLOC is respected;
|
|
349
|
+
* - if !MBEDTLS_PLATFORM_STD_CALLOC:
|
|
350
|
+
* - MBEDTLS_PLATFORM_STD_CALLOC = calloc
|
|
351
|
+
*
|
|
352
|
+
* - At this point the presence of MBEDTLS_PLATFORM_STD_CALLOC is checked.
|
|
353
|
+
* - if !MBEDTLS_PLATFORM_STD_CALLOC
|
|
354
|
+
* - MBEDTLS_PLATFORM_STD_CALLOC = uninitialized_calloc
|
|
355
|
+
*
|
|
356
|
+
* - mbedtls_calloc = MBEDTLS_PLATFORM_STD_CALLOC.
|
|
357
|
+
*
|
|
358
|
+
* Defining MBEDTLS_PLATFORM_CALLOC_MACRO and #MBEDTLS_PLATFORM_STD_CALLOC at the same time is not possible.
|
|
359
|
+
* MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_FREE_MACRO must both be defined or undefined at the same time.
|
|
360
|
+
* #MBEDTLS_PLATFORM_STD_CALLOC and #MBEDTLS_PLATFORM_STD_FREE do not have to be defined at the same time, as, if they are used,
|
|
361
|
+
* dynamic setup of these functions is possible. See the tree above to see how are they handled in all cases.
|
|
362
|
+
* An uninitialized #MBEDTLS_PLATFORM_STD_CALLOC always fails, returning a null pointer.
|
|
363
|
+
* An uninitialized #MBEDTLS_PLATFORM_STD_FREE does not do anything.
|
|
364
|
+
*
|
|
365
|
+
* Requires: MBEDTLS_PLATFORM_C
|
|
366
|
+
*
|
|
367
|
+
* Enable this layer to allow use of alternative memory allocators.
|
|
368
|
+
*/
|
|
369
|
+
//#define MBEDTLS_PLATFORM_MEMORY
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
|
373
|
+
*
|
|
374
|
+
* Do not assign standard functions in the platform layer (e.g. calloc() to
|
|
375
|
+
* MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
|
|
376
|
+
*
|
|
377
|
+
* This makes sure there are no linking errors on platforms that do not support
|
|
378
|
+
* these functions. You will HAVE to provide alternatives, either at runtime
|
|
379
|
+
* via the platform_set_xxx() functions or at compile time by setting
|
|
380
|
+
* the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
|
|
381
|
+
* MBEDTLS_PLATFORM_XXX_MACRO.
|
|
382
|
+
*
|
|
383
|
+
* Requires: MBEDTLS_PLATFORM_C
|
|
384
|
+
*
|
|
385
|
+
* Uncomment to prevent default assignment of standard functions in the
|
|
386
|
+
* platform layer.
|
|
387
|
+
*/
|
|
388
|
+
//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Uncomment the macro to let Mbed TLS use your alternate implementation of
|
|
392
|
+
* mbedtls_platform_zeroize(), to wipe sensitive data in memory. This replaces
|
|
393
|
+
* the default implementation in platform_util.c.
|
|
394
|
+
*
|
|
395
|
+
* By default, the library uses a system function such as memset_s()
|
|
396
|
+
* (optional feature of C11), explicit_bzero() (BSD and compatible), or
|
|
397
|
+
* SecureZeroMemory (Windows). If no such function is detected, the library
|
|
398
|
+
* falls back to a plain C implementation. Compilers are technically
|
|
399
|
+
* permitted to optimize this implementation out, meaning that the memory is
|
|
400
|
+
* not actually wiped. The library tries to prevent that, but the C language
|
|
401
|
+
* makes it impossible to guarantee that the memory will always be wiped.
|
|
402
|
+
*
|
|
403
|
+
* If your platform provides a guaranteed method to wipe memory which
|
|
404
|
+
* `platform_util.c` does not detect, define this macro to the name of
|
|
405
|
+
* a function that takes two arguments, a `void *` pointer and a length,
|
|
406
|
+
* and wipes that many bytes starting at the specified address. For example,
|
|
407
|
+
* if your platform has explicit_bzero() but `platform_util.c` does not
|
|
408
|
+
* detect its presence, define `MBEDTLS_PLATFORM_ZEROIZE_ALT` to be
|
|
409
|
+
* `explicit_bzero` to use that function as mbedtls_platform_zeroize().
|
|
410
|
+
*/
|
|
411
|
+
//#define MBEDTLS_PLATFORM_ZEROIZE_ALT
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* \def MBEDTLS_THREADING_ALT
|
|
415
|
+
*
|
|
416
|
+
* Provide your own alternate implementation of threading primitives:
|
|
417
|
+
* mutexes and condition variables. If you enable this option:
|
|
418
|
+
*
|
|
419
|
+
* - Provide a header file `"threading_alt.h"`, defining the following
|
|
420
|
+
* elements:
|
|
421
|
+
* - The type `mbedtls_platform_mutex_t` of mutex objects.
|
|
422
|
+
* - The type `mbedtls_platform_condition_variable_t` of
|
|
423
|
+
* condition variable objects.
|
|
424
|
+
*
|
|
425
|
+
* - Call the function mbedtls_threading_set_alt() in your application
|
|
426
|
+
* before calling any other library function (in particular before
|
|
427
|
+
* calling psa_crypto_init()).
|
|
428
|
+
*
|
|
429
|
+
* See mbedtls/threading.h for more details, especially the documentation
|
|
430
|
+
* of mbedtls_threading_set_alt().
|
|
431
|
+
*
|
|
432
|
+
* Requires: MBEDTLS_THREADING_C
|
|
433
|
+
*
|
|
434
|
+
* Uncomment this to allow your own alternate threading implementation.
|
|
435
|
+
*/
|
|
436
|
+
//#define MBEDTLS_THREADING_ALT
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* \def MBEDTLS_THREADING_PTHREAD
|
|
440
|
+
*
|
|
441
|
+
* Enable the pthread wrapper layer for the threading layer.
|
|
442
|
+
*
|
|
443
|
+
* Requires: MBEDTLS_THREADING_C
|
|
444
|
+
*
|
|
445
|
+
* Uncomment this to enable pthread mutexes.
|
|
446
|
+
*/
|
|
447
|
+
//#define MBEDTLS_THREADING_PTHREAD
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* \def MBEDTLS_THREADING_C
|
|
451
|
+
*
|
|
452
|
+
* Enable the threading abstraction layer.
|
|
453
|
+
*
|
|
454
|
+
* \note You must enable this option if TF-PSA-Crypto runs in a
|
|
455
|
+
* multithreaded environment. Otherwise the PSA cryptography subsystem is
|
|
456
|
+
* not thread-safe. As an exception, this option can be disabled if all
|
|
457
|
+
* PSA crypto functions are ever called from a single thread. Note that
|
|
458
|
+
* this includes indirect calls, for example through PK.
|
|
459
|
+
*
|
|
460
|
+
* Module: platform/threading.c
|
|
461
|
+
*
|
|
462
|
+
* This allows different threading implementations (built-in or
|
|
463
|
+
* provided externally).
|
|
464
|
+
*
|
|
465
|
+
* You will have to enable either #MBEDTLS_THREADING_ALT or
|
|
466
|
+
* #MBEDTLS_THREADING_PTHREAD.
|
|
467
|
+
*
|
|
468
|
+
* Enable this layer to allow use of mutexes within Mbed TLS
|
|
469
|
+
*/
|
|
470
|
+
//#define MBEDTLS_THREADING_C
|
|
471
|
+
|
|
472
|
+
/* Memory buffer allocator options */
|
|
473
|
+
//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
|
|
474
|
+
|
|
475
|
+
/* To use the following function macros, MBEDTLS_PLATFORM_C must be enabled. */
|
|
476
|
+
/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
|
|
477
|
+
//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined. See MBEDTLS_PLATFORM_STD_CALLOC for requirements. */
|
|
478
|
+
//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
|
|
479
|
+
//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined. See MBEDTLS_PLATFORM_STD_FREE for requirements. */
|
|
480
|
+
//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
|
|
481
|
+
//#define MBEDTLS_PLATFORM_MS_TIME_TYPE_MACRO int64_t //#define MBEDTLS_PLATFORM_MS_TIME_TYPE_MACRO int64_t /**< Default milliseconds time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled. It must be signed, and at least 64 bits. If it is changed from the default, MBEDTLS_PRINTF_MS_TIME must be updated to match.*/
|
|
482
|
+
//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
|
|
483
|
+
//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
|
|
484
|
+
//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
|
|
485
|
+
//#define MBEDTLS_PLATFORM_SETBUF_MACRO setbuf /**< Default setbuf macro to use, can be undefined */
|
|
486
|
+
/* Note: your snprintf must correctly zero-terminate the buffer! */
|
|
487
|
+
//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
|
|
488
|
+
|
|
489
|
+
/** \def MBEDTLS_PLATFORM_STD_CALLOC
|
|
490
|
+
*
|
|
491
|
+
* Default allocator to use, can be undefined.
|
|
492
|
+
* It must initialize the allocated buffer memory to zeroes.
|
|
493
|
+
* The size of the buffer is the product of the two parameters.
|
|
494
|
+
* The calloc function returns either a null pointer or a pointer to the allocated space.
|
|
495
|
+
* If the product is 0, the function may either return NULL or a valid pointer to an array of size 0 which is a valid input to the deallocation function.
|
|
496
|
+
* An uninitialized #MBEDTLS_PLATFORM_STD_CALLOC always fails, returning a null pointer.
|
|
497
|
+
* See the description of #MBEDTLS_PLATFORM_MEMORY for more details.
|
|
498
|
+
* The corresponding deallocation function is #MBEDTLS_PLATFORM_STD_FREE.
|
|
499
|
+
*/
|
|
500
|
+
//#define MBEDTLS_PLATFORM_STD_CALLOC calloc
|
|
501
|
+
|
|
502
|
+
//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
|
|
503
|
+
//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
|
|
504
|
+
//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
|
|
505
|
+
//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
|
|
506
|
+
|
|
507
|
+
/** \def MBEDTLS_PLATFORM_STD_FREE
|
|
508
|
+
*
|
|
509
|
+
* Default free to use, can be undefined.
|
|
510
|
+
* NULL is a valid parameter, and the function must do nothing.
|
|
511
|
+
* A non-null parameter will always be a pointer previously returned by #MBEDTLS_PLATFORM_STD_CALLOC and not yet freed.
|
|
512
|
+
* An uninitialized #MBEDTLS_PLATFORM_STD_FREE does not do anything.
|
|
513
|
+
* See the description of #MBEDTLS_PLATFORM_MEMORY for more details (same principles as for MBEDTLS_PLATFORM_STD_CALLOC apply).
|
|
514
|
+
*/
|
|
515
|
+
//#define MBEDTLS_PLATFORM_STD_FREE free
|
|
516
|
+
|
|
517
|
+
//#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
|
|
518
|
+
//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
|
|
519
|
+
//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
|
|
520
|
+
//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
|
|
521
|
+
//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
|
|
522
|
+
//#define MBEDTLS_PLATFORM_STD_SETBUF setbuf /**< Default setbuf to use, can be undefined */
|
|
523
|
+
/* Note: your snprintf must correctly zero-terminate the buffer! */
|
|
524
|
+
//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
|
|
525
|
+
//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
|
|
526
|
+
//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
|
|
527
|
+
//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
|
|
528
|
+
//#define MBEDTLS_PLATFORM_VSNPRINTF_MACRO vsnprintf /**< Default vsnprintf macro to use, can be undefined */
|
|
529
|
+
//#define MBEDTLS_PRINTF_MS_TIME PRId64 /**< Default fmt for printf. That's avoid compiler warning if mbedtls_ms_time_t is redefined */
|
|
530
|
+
|
|
531
|
+
/** \def MBEDTLS_PLATFORM_DEV_RANDOM
|
|
532
|
+
*
|
|
533
|
+
* Path to a special file that returns cryptographic-quality random bytes
|
|
534
|
+
* when read. This is used by the default platform entropy source on
|
|
535
|
+
* non-Windows platforms unless a dedicated system call is available
|
|
536
|
+
* (see #MBEDTLS_PSA_BUILTIN_GET_ENTROPY).
|
|
537
|
+
*
|
|
538
|
+
* The default value is `/dev/random`, which is suitable on most platforms
|
|
539
|
+
* other than Linux. On Linux, either `/dev/random` or `/dev/urandom`
|
|
540
|
+
* may be the right choice, depending on the circumstances:
|
|
541
|
+
*
|
|
542
|
+
* - If possible, the library will use the getrandom() system call,
|
|
543
|
+
* which is preferable, and #MBEDTLS_PLATFORM_DEV_RANDOM is not used.
|
|
544
|
+
* - If there is a dedicated hardware entropy source (e.g. RDRAND on x86
|
|
545
|
+
* processors), then both `/dev/random` and `/dev/urandom` are fine.
|
|
546
|
+
* - `/dev/random` is always secure. However, with kernels older than 5.6,
|
|
547
|
+
* `/dev/random` often blocks unnecessarily if there is no dedicated
|
|
548
|
+
* hardware entropy source.
|
|
549
|
+
* - `/dev/urandom` never blocks. However, it may return predictable data
|
|
550
|
+
* if it is used early after the kernel boots, especially on embedded
|
|
551
|
+
* devices without an interactive user.
|
|
552
|
+
*
|
|
553
|
+
* Thus you should change the value to `/dev/urandom` if your application
|
|
554
|
+
* definitely won't be used on a device running Linux without a dedicated
|
|
555
|
+
* entropy source early during or after boot.
|
|
556
|
+
*
|
|
557
|
+
*
|
|
558
|
+
* This is the default value of ::mbedtls_platform_dev_random, which
|
|
559
|
+
* can be changed at run time.
|
|
560
|
+
*/
|
|
561
|
+
//#define MBEDTLS_PLATFORM_DEV_RANDOM "/dev/random"
|
|
562
|
+
|
|
563
|
+
/** \} name SECTION: Platform abstraction layer */
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* \name SECTION: General and test configuration options
|
|
567
|
+
*
|
|
568
|
+
* This section sets test specific settings.
|
|
569
|
+
* \{
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* \def MBEDTLS_CHECK_RETURN_WARNING
|
|
574
|
+
*
|
|
575
|
+
* If this macro is defined, emit a compile-time warning if application code
|
|
576
|
+
* calls a function without checking its return value, but the return value
|
|
577
|
+
* should generally be checked in portable applications.
|
|
578
|
+
*
|
|
579
|
+
* This is only supported on platforms where #MBEDTLS_CHECK_RETURN is
|
|
580
|
+
* implemented. Otherwise this option has no effect.
|
|
581
|
+
*
|
|
582
|
+
* Uncomment to get warnings on using fallible functions without checking
|
|
583
|
+
* their return value.
|
|
584
|
+
*
|
|
585
|
+
* \note This feature is a work in progress.
|
|
586
|
+
* Warnings will be added to more functions in the future.
|
|
587
|
+
*
|
|
588
|
+
* \note A few functions are considered critical, and ignoring the return
|
|
589
|
+
* value of these functions will trigger a warning even if this
|
|
590
|
+
* macro is not defined. To completely disable return value check
|
|
591
|
+
* warnings, define #MBEDTLS_CHECK_RETURN with an empty expansion.
|
|
592
|
+
*/
|
|
593
|
+
//#define MBEDTLS_CHECK_RETURN_WARNING
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* \def MBEDTLS_DEPRECATED_WARNING
|
|
597
|
+
*
|
|
598
|
+
* Mark deprecated functions and features so that they generate a warning if
|
|
599
|
+
* used. Functionality deprecated in one version will usually be removed in the
|
|
600
|
+
* next version. You can enable this to help you prepare the transition to a
|
|
601
|
+
* new major version by making sure your code is not using this functionality.
|
|
602
|
+
*
|
|
603
|
+
* This only works with GCC and Clang. With other compilers, you may want to
|
|
604
|
+
* use MBEDTLS_DEPRECATED_REMOVED
|
|
605
|
+
*
|
|
606
|
+
* Uncomment to get warnings on using deprecated functions and features.
|
|
607
|
+
*/
|
|
608
|
+
//#define MBEDTLS_DEPRECATED_WARNING
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* \def MBEDTLS_DEPRECATED_REMOVED
|
|
612
|
+
*
|
|
613
|
+
* Remove deprecated functions and features so that they generate an error if
|
|
614
|
+
* used. Functionality deprecated in one version will usually be removed in the
|
|
615
|
+
* next version. You can enable this to help you prepare the transition to a
|
|
616
|
+
* new major version by making sure your code is not using this functionality.
|
|
617
|
+
*
|
|
618
|
+
* Uncomment to get errors on using deprecated functions and features.
|
|
619
|
+
*/
|
|
620
|
+
//#define MBEDTLS_DEPRECATED_REMOVED
|
|
621
|
+
|
|
622
|
+
/** \def MBEDTLS_CHECK_RETURN
|
|
623
|
+
*
|
|
624
|
+
* This macro is used at the beginning of the declaration of a function
|
|
625
|
+
* to indicate that its return value should be checked. It should
|
|
626
|
+
* instruct the compiler to emit a warning or an error if the function
|
|
627
|
+
* is called without checking its return value.
|
|
628
|
+
*
|
|
629
|
+
* There is a default implementation for popular compilers in platform_util.h.
|
|
630
|
+
* You can override the default implementation by defining your own here.
|
|
631
|
+
*
|
|
632
|
+
* If the implementation here is empty, this will effectively disable the
|
|
633
|
+
* checking of functions' return values.
|
|
634
|
+
*/
|
|
635
|
+
//#define MBEDTLS_CHECK_RETURN __attribute__((__warn_unused_result__))
|
|
636
|
+
|
|
637
|
+
/** \def MBEDTLS_IGNORE_RETURN
|
|
638
|
+
*
|
|
639
|
+
* This macro requires one argument, which should be a C function call.
|
|
640
|
+
* If that function call would cause a #MBEDTLS_CHECK_RETURN warning, this
|
|
641
|
+
* warning is suppressed.
|
|
642
|
+
*/
|
|
643
|
+
//#define MBEDTLS_IGNORE_RETURN( result ) ((void) !(result))
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* \def TF_PSA_CRYPTO_CONFIG_FILE
|
|
647
|
+
*
|
|
648
|
+
* If defined, this is a header which will be included instead of
|
|
649
|
+
* `"psa/crypto_config.h"`.
|
|
650
|
+
* This header file specifies which cryptographic mechanisms are available
|
|
651
|
+
* through the PSA API.
|
|
652
|
+
*
|
|
653
|
+
* This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
|
|
654
|
+
* non-standard feature of the C language, so this feature is only available
|
|
655
|
+
* with compilers that perform macro expansion on an <tt>\#include</tt> line.
|
|
656
|
+
*
|
|
657
|
+
* The value of this symbol is typically a path in double quotes, either
|
|
658
|
+
* absolute or relative to a directory on the include search path.
|
|
659
|
+
*/
|
|
660
|
+
//#define TF_PSA_CRYPTO_CONFIG_FILE "psa/crypto_config.h"
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* \def TF_PSA_CRYPTO_USER_CONFIG_FILE
|
|
664
|
+
*
|
|
665
|
+
* If defined, this is a header which will be included after
|
|
666
|
+
* `"psa/crypto_config.h"` or #TF_PSA_CRYPTO_CONFIG_FILE.
|
|
667
|
+
* This allows you to modify the default configuration, including the ability
|
|
668
|
+
* to undefine options that are enabled by default.
|
|
669
|
+
*
|
|
670
|
+
* This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
|
|
671
|
+
* non-standard feature of the C language, so this feature is only available
|
|
672
|
+
* with compilers that perform macro expansion on an <tt>\#include</tt> line.
|
|
673
|
+
*
|
|
674
|
+
* The value of this symbol is typically a path in double quotes, either
|
|
675
|
+
* absolute or relative to a directory on the include search path.
|
|
676
|
+
*/
|
|
677
|
+
//#define TF_PSA_CRYPTO_USER_CONFIG_FILE "/dev/null"
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* \def MBEDTLS_SELF_TEST
|
|
681
|
+
*
|
|
682
|
+
* Enable the checkup functions (*_self_test).
|
|
683
|
+
*/
|
|
684
|
+
#define MBEDTLS_SELF_TEST
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
|
|
688
|
+
*
|
|
689
|
+
* Enable testing of the constant-flow nature of some sensitive functions with
|
|
690
|
+
* clang's MemorySanitizer. This causes some existing tests to also test
|
|
691
|
+
* this non-functional property of the code under test.
|
|
692
|
+
*
|
|
693
|
+
* This setting requires compiling with clang -fsanitize=memory. The test
|
|
694
|
+
* suites can then be run normally.
|
|
695
|
+
*
|
|
696
|
+
* \warning This macro is only used for extended testing; it is not considered
|
|
697
|
+
* part of the library's API, so it may change or disappear at any time.
|
|
698
|
+
*
|
|
699
|
+
* Uncomment to enable testing of the constant-flow nature of selected code.
|
|
700
|
+
*/
|
|
701
|
+
//#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
|
|
705
|
+
*
|
|
706
|
+
* Enable testing of the constant-flow nature of some sensitive functions with
|
|
707
|
+
* valgrind's memcheck tool. This causes some existing tests to also test
|
|
708
|
+
* this non-functional property of the code under test.
|
|
709
|
+
*
|
|
710
|
+
* This setting requires valgrind headers for building, and is only useful for
|
|
711
|
+
* testing if the tests suites are run with valgrind's memcheck. This can be
|
|
712
|
+
* done for an individual test suite with 'valgrind ./test_suite_xxx', or when
|
|
713
|
+
* using CMake, this can be done for all test suites with 'make memcheck'.
|
|
714
|
+
*
|
|
715
|
+
* \warning This macro is only used for extended testing; it is not considered
|
|
716
|
+
* part of the library's API, so it may change or disappear at any time.
|
|
717
|
+
*
|
|
718
|
+
* Uncomment to enable testing of the constant-flow nature of selected code.
|
|
719
|
+
*/
|
|
720
|
+
//#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* \def MBEDTLS_TEST_HOOKS
|
|
724
|
+
*
|
|
725
|
+
* Enable features for invasive testing such as introspection functions and
|
|
726
|
+
* hooks for fault injection. This enables additional unit tests.
|
|
727
|
+
*
|
|
728
|
+
* Merely enabling this feature should not change the behavior of the product.
|
|
729
|
+
* It only adds new code, and new branching points where the default behavior
|
|
730
|
+
* is the same as when this feature is disabled.
|
|
731
|
+
* However, this feature increases the attack surface: there is an added
|
|
732
|
+
* risk of vulnerabilities, and more gadgets that can make exploits easier.
|
|
733
|
+
* Therefore this feature must never be enabled in production.
|
|
734
|
+
*
|
|
735
|
+
* See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more
|
|
736
|
+
* information.
|
|
737
|
+
*
|
|
738
|
+
* Uncomment to enable invasive tests.
|
|
739
|
+
*/
|
|
740
|
+
//#define MBEDTLS_TEST_HOOKS
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* \def TF_PSA_CRYPTO_VERSION
|
|
744
|
+
*
|
|
745
|
+
* Enable run-time version information.
|
|
746
|
+
*
|
|
747
|
+
* This option enables functions for getting the version of TF-PSA-Crypto
|
|
748
|
+
* at runtime defined in include/tf-psa-crypto/version.h.
|
|
749
|
+
*/
|
|
750
|
+
#define TF_PSA_CRYPTO_VERSION
|
|
751
|
+
|
|
752
|
+
/** \} name SECTION: General and test configuration options */
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* \name SECTION: Cryptographic mechanism selection (extended API)
|
|
756
|
+
*
|
|
757
|
+
* This section sets cryptographic mechanism settings.
|
|
758
|
+
* \{
|
|
759
|
+
*/
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* \def MBEDTLS_LMS_C
|
|
763
|
+
*
|
|
764
|
+
* Enable the LMS stateful-hash asymmetric signature algorithm.
|
|
765
|
+
*
|
|
766
|
+
* Module: extras/lms.c
|
|
767
|
+
* Caller:
|
|
768
|
+
*
|
|
769
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C
|
|
770
|
+
*
|
|
771
|
+
* Uncomment to enable the LMS verification algorithm and public key operations.
|
|
772
|
+
*/
|
|
773
|
+
#define MBEDTLS_LMS_C
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* \def MBEDTLS_LMS_PRIVATE
|
|
777
|
+
*
|
|
778
|
+
* Enable LMS private-key operations and signing code. Functions enabled by this
|
|
779
|
+
* option are experimental, and should not be used in production.
|
|
780
|
+
*
|
|
781
|
+
* Requires: MBEDTLS_LMS_C
|
|
782
|
+
*
|
|
783
|
+
* Uncomment to enable the LMS signature algorithm and private key operations.
|
|
784
|
+
*/
|
|
785
|
+
//#define MBEDTLS_LMS_PRIVATE
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* \def MBEDTLS_MD_C
|
|
789
|
+
*
|
|
790
|
+
* Enable the generic layer for message digest (hashing).
|
|
791
|
+
*
|
|
792
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C with at least one hash.
|
|
793
|
+
* Module: extras/md.c
|
|
794
|
+
* Caller: drivers/builtin/src/ecdsa.c
|
|
795
|
+
* drivers/builtin/src/ecjpake.c
|
|
796
|
+
* drivers/builtin/src/hmac_drbg.c
|
|
797
|
+
* drivers/builtin/src/psa_crypto_ecp.c
|
|
798
|
+
* drivers/builtin/src/psa_crypto_rsa.c
|
|
799
|
+
* drivers/builtin/src/rsa.c
|
|
800
|
+
* extras/pk.c
|
|
801
|
+
* utilities/constant_time.c
|
|
802
|
+
* utilities/pkcs5.c
|
|
803
|
+
*
|
|
804
|
+
* Uncomment to enable generic message digest wrappers.
|
|
805
|
+
*/
|
|
806
|
+
#define MBEDTLS_MD_C
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* \def MBEDTLS_NIST_KW_C
|
|
810
|
+
*
|
|
811
|
+
* Enable the 128-bit key wrapping modes from NIST SP 800-38F:
|
|
812
|
+
* KW (also known as RFC 3394) and KWP (RFC 5649).
|
|
813
|
+
* Currently these modes are only supported with AES.
|
|
814
|
+
*
|
|
815
|
+
* Module: extras/nist_kw.c
|
|
816
|
+
*
|
|
817
|
+
* Auto enables: PSA_WANT_ALG_ECB_NO_PADDING
|
|
818
|
+
*/
|
|
819
|
+
#define MBEDTLS_NIST_KW_C
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* \def MBEDTLS_PK_C
|
|
823
|
+
*
|
|
824
|
+
* Enable the generic public (asymmetric) key layer.
|
|
825
|
+
*
|
|
826
|
+
* Module: extras/pk.c
|
|
827
|
+
* Caller: drivers/builtin/src/psa_crypto_rsa.c
|
|
828
|
+
*
|
|
829
|
+
* Requires: #MBEDTLS_PSA_CRYPTO_CLIENT and at least one between
|
|
830
|
+
* #PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY and
|
|
831
|
+
* #PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY.
|
|
832
|
+
*
|
|
833
|
+
* Uncomment to enable generic public key wrappers.
|
|
834
|
+
*/
|
|
835
|
+
#define MBEDTLS_PK_C
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* \def MBEDTLS_PKCS5_C
|
|
839
|
+
*
|
|
840
|
+
* Enable PKCS#5 functions.
|
|
841
|
+
*
|
|
842
|
+
* Module: utilities/pkcs5.c
|
|
843
|
+
*
|
|
844
|
+
* Auto-enables: MBEDTLS_MD_C
|
|
845
|
+
*
|
|
846
|
+
* This module adds support for the PKCS#5 functions.
|
|
847
|
+
*/
|
|
848
|
+
#define MBEDTLS_PKCS5_C
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* \def MBEDTLS_PK_PARSE_C
|
|
852
|
+
*
|
|
853
|
+
* Enable the generic public (asymmetric) key parser.
|
|
854
|
+
*
|
|
855
|
+
* Module: extras/pkparse.c
|
|
856
|
+
*
|
|
857
|
+
* Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_PK_C
|
|
858
|
+
*
|
|
859
|
+
* Uncomment to enable generic public key parse functions.
|
|
860
|
+
*/
|
|
861
|
+
#define MBEDTLS_PK_PARSE_C
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* \def MBEDTLS_PK_PARSE_EC_EXTENDED
|
|
865
|
+
*
|
|
866
|
+
* Enhance support for reading EC keys using variants of SEC1 not allowed by
|
|
867
|
+
* RFC 5915 and RFC 5480.
|
|
868
|
+
*
|
|
869
|
+
* Currently this means parsing the SpecifiedECDomain choice of EC
|
|
870
|
+
* parameters (only known groups are supported, not arbitrary domains, to
|
|
871
|
+
* avoid validation issues).
|
|
872
|
+
*
|
|
873
|
+
* Disable if you only need to support RFC 5915 + 5480 key formats.
|
|
874
|
+
*/
|
|
875
|
+
#define MBEDTLS_PK_PARSE_EC_EXTENDED
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* \def MBEDTLS_PK_PARSE_EC_COMPRESSED
|
|
879
|
+
*
|
|
880
|
+
* Enable the support for parsing public keys of type Short Weierstrass
|
|
881
|
+
* (PSA_ECC_FAMILY_SECP_XXX and PSA_ECC_FAMILY_BRAINPOOL_XXX) which are using the
|
|
882
|
+
* compressed point format.
|
|
883
|
+
*/
|
|
884
|
+
#define MBEDTLS_PK_PARSE_EC_COMPRESSED
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* \def MBEDTLS_PK_WRITE_C
|
|
888
|
+
*
|
|
889
|
+
* Enable the generic public (asymmetric) key writer.
|
|
890
|
+
*
|
|
891
|
+
* Module: extras/pkwrite.c
|
|
892
|
+
*
|
|
893
|
+
* Requires: MBEDTLS_ASN1_WRITE_C, MBEDTLS_PK_C
|
|
894
|
+
*
|
|
895
|
+
* Uncomment to enable generic public key write functions.
|
|
896
|
+
*/
|
|
897
|
+
#define MBEDTLS_PK_WRITE_C
|
|
898
|
+
|
|
899
|
+
/** \} name SECTION: Cryptographic mechanism selection (extended API) */
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* \name SECTION: Data format support
|
|
903
|
+
*
|
|
904
|
+
* This section sets data-format specific settings.
|
|
905
|
+
* \{
|
|
906
|
+
*/
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* \def MBEDTLS_ASN1_PARSE_C
|
|
910
|
+
*
|
|
911
|
+
* Enable the generic ASN1 parser.
|
|
912
|
+
*
|
|
913
|
+
* Module: utilities/asn1parse.c
|
|
914
|
+
* Caller: extras/pkparse.c
|
|
915
|
+
* utilities/pkcs5.c
|
|
916
|
+
*/
|
|
917
|
+
#define MBEDTLS_ASN1_PARSE_C
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* \def MBEDTLS_ASN1_WRITE_C
|
|
921
|
+
*
|
|
922
|
+
* Enable the generic ASN1 writer.
|
|
923
|
+
*
|
|
924
|
+
* Module: utilities/asn1write.c
|
|
925
|
+
* Caller: drivers/builtin/src/ecdsa.c
|
|
926
|
+
* extras/pkwrite.c
|
|
927
|
+
*/
|
|
928
|
+
#define MBEDTLS_ASN1_WRITE_C
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* \def MBEDTLS_BASE64_C
|
|
932
|
+
*
|
|
933
|
+
* Enable the Base64 module.
|
|
934
|
+
*
|
|
935
|
+
* Module: utilities/base64.c
|
|
936
|
+
* Caller: utilities/pem.c
|
|
937
|
+
*
|
|
938
|
+
* This module is required for PEM support (required by X.509).
|
|
939
|
+
*/
|
|
940
|
+
#define MBEDTLS_BASE64_C
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* \def MBEDTLS_PEM_PARSE_C
|
|
944
|
+
*
|
|
945
|
+
* Enable PEM decoding / parsing.
|
|
946
|
+
*
|
|
947
|
+
* Module: utilities/pem.c
|
|
948
|
+
* Caller: extras/pkparse.c
|
|
949
|
+
*
|
|
950
|
+
* Requires: MBEDTLS_BASE64_C
|
|
951
|
+
* optionally PSA_WANT_ALG_MD5
|
|
952
|
+
*
|
|
953
|
+
* This modules adds support for decoding / parsing PEM files.
|
|
954
|
+
*/
|
|
955
|
+
#define MBEDTLS_PEM_PARSE_C
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* \def MBEDTLS_PEM_WRITE_C
|
|
959
|
+
*
|
|
960
|
+
* Enable PEM encoding / writing.
|
|
961
|
+
*
|
|
962
|
+
* Module: utilities/pem.c
|
|
963
|
+
* Caller: extras/pkwrite.c
|
|
964
|
+
*
|
|
965
|
+
* Requires: MBEDTLS_BASE64_C
|
|
966
|
+
*
|
|
967
|
+
* This modules adds support for encoding / writing PEM files.
|
|
968
|
+
*/
|
|
969
|
+
#define MBEDTLS_PEM_WRITE_C
|
|
970
|
+
|
|
971
|
+
/** \} name SECTION: Data format support */
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* \name SECTION: PSA core
|
|
975
|
+
*
|
|
976
|
+
* This section sets PSA specific settings.
|
|
977
|
+
* \{
|
|
978
|
+
*/
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* \def MBEDTLS_CTR_DRBG_C
|
|
982
|
+
*
|
|
983
|
+
* Enable the CTR_DRBG AES-based random generator.
|
|
984
|
+
* The CTR_DRBG generator uses AES-256 by default.
|
|
985
|
+
* To use AES-128 instead, set #MBEDTLS_PSA_CRYPTO_RNG_STRENGTH to 128.
|
|
986
|
+
*
|
|
987
|
+
* AES support can either be achieved through built-in AES or PSA. Built-in is
|
|
988
|
+
* the default option when present otherwise PSA is used.
|
|
989
|
+
*
|
|
990
|
+
* Module: drivers/builtin/src/ctr_drbg.c
|
|
991
|
+
*
|
|
992
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C, PSA_WANT_KEY_TYPE_AES and
|
|
993
|
+
* PSA_WANT_ALG_ECB_NO_PADDING
|
|
994
|
+
*
|
|
995
|
+
* This module provides the CTR_DRBG AES random number generator.
|
|
996
|
+
*/
|
|
997
|
+
#define MBEDTLS_CTR_DRBG_C
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* \def MBEDTLS_ENTROPY_NO_SOURCES_OK
|
|
1001
|
+
*
|
|
1002
|
+
* Normally, TF-PSA-Crypto requires at least one "true" entropy source, such
|
|
1003
|
+
* #MBEDTLS_PSA_BUILTIN_GET_ENTROPY or #MBEDTLS_PSA_DRIVER_GET_ENTROPY.
|
|
1004
|
+
*
|
|
1005
|
+
* It is possible to build the library with a seed injected during device
|
|
1006
|
+
* provisioning, thanks to #MBEDTLS_ENTROPY_NV_SEED.
|
|
1007
|
+
* This is only an initial entropy input: without a true entropy source,
|
|
1008
|
+
* the device will not obtain additional entropy during its lifetime.
|
|
1009
|
+
* Thus, if the seed value is leaked, it is impossible to recover from
|
|
1010
|
+
* this compromise.
|
|
1011
|
+
*
|
|
1012
|
+
* Enable this option if this loss of security is acceptable to you.
|
|
1013
|
+
*/
|
|
1014
|
+
//#define MBEDTLS_ENTROPY_NO_SOURCES_OK
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* \def MBEDTLS_ENTROPY_NV_SEED
|
|
1018
|
+
*
|
|
1019
|
+
* Enable the non-volatile (NV) seed file-based entropy source.
|
|
1020
|
+
* (Also enables the NV seed read/write functions in the platform layer)
|
|
1021
|
+
*
|
|
1022
|
+
* This is crucial (if not required) on systems that do not have a
|
|
1023
|
+
* cryptographic entropy source (in hardware or kernel) available.
|
|
1024
|
+
*
|
|
1025
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C,
|
|
1026
|
+
* !MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
|
1027
|
+
* MBEDTLS_PLATFORM_C
|
|
1028
|
+
*
|
|
1029
|
+
* \note The read/write functions that are used by the entropy source are
|
|
1030
|
+
* determined in the platform layer, and can be modified at runtime and/or
|
|
1031
|
+
* compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
|
|
1032
|
+
*
|
|
1033
|
+
* \note If you use the default implementation functions that read a seedfile
|
|
1034
|
+
* with regular fopen(), please make sure you make a seedfile with the
|
|
1035
|
+
* proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
|
|
1036
|
+
* least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
|
|
1037
|
+
* and written to or you will get an entropy source error! The default
|
|
1038
|
+
* implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
|
|
1039
|
+
* bytes from the file.
|
|
1040
|
+
*
|
|
1041
|
+
* \note The entropy collector will write to the seed file before entropy is
|
|
1042
|
+
* given to an external source, to update it.
|
|
1043
|
+
*/
|
|
1044
|
+
//#define MBEDTLS_ENTROPY_NV_SEED
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* \def MBEDTLS_HMAC_DRBG_C
|
|
1048
|
+
*
|
|
1049
|
+
* Enable the HMAC_DRBG random generator.
|
|
1050
|
+
*
|
|
1051
|
+
* Module: drivers/builtin/src/hmac_drbg.c
|
|
1052
|
+
* Caller:
|
|
1053
|
+
*
|
|
1054
|
+
* Requires: MBEDTLS_MD_C
|
|
1055
|
+
*
|
|
1056
|
+
* Uncomment to enable the HMAC_DRBG random number generator.
|
|
1057
|
+
*/
|
|
1058
|
+
#define MBEDTLS_HMAC_DRBG_C
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* \def MBEDTLS_PSA_CRYPTO_C
|
|
1062
|
+
*
|
|
1063
|
+
* Enable the Platform Security Architecture cryptography API.
|
|
1064
|
+
*
|
|
1065
|
+
* Module: core/psa_crypto.c
|
|
1066
|
+
*
|
|
1067
|
+
* Requires: one of the following:
|
|
1068
|
+
* - MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
|
1069
|
+
* - MBEDTLS_CTR_DRBG_C
|
|
1070
|
+
* - MBEDTLS_HMAC_DRBG_C
|
|
1071
|
+
*
|
|
1072
|
+
* If MBEDTLS_CTR_DRBG_C or MBEDTLS_HMAC_DRBG_C is used as the PSA
|
|
1073
|
+
* random generator, then either PSA_WANT_ALG_SHA_256 or
|
|
1074
|
+
* PSA_WANT_ALG_SHA_512 must be enabled for the entropy module.
|
|
1075
|
+
*
|
|
1076
|
+
* \note The PSA crypto subsystem prioritizes DRBG mechanisms as follows:
|
|
1077
|
+
* - #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG, if enabled
|
|
1078
|
+
* - CTR_DRBG (AES), seeded by the entropy module, if
|
|
1079
|
+
* #MBEDTLS_CTR_DRBG_C is enabled
|
|
1080
|
+
* - HMAC_DRBG, seeded by the entropy module, if
|
|
1081
|
+
* #MBEDTLS_HMAC_DRBG_C is enabled
|
|
1082
|
+
*
|
|
1083
|
+
* A future version may reevaluate the prioritization of DRBG mechanisms.
|
|
1084
|
+
*/
|
|
1085
|
+
#define MBEDTLS_PSA_CRYPTO_C
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* \def MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
|
|
1089
|
+
*
|
|
1090
|
+
* Assume all buffers passed to PSA functions are owned exclusively by the
|
|
1091
|
+
* PSA function and are not stored in shared memory.
|
|
1092
|
+
*
|
|
1093
|
+
* This option may be enabled if all buffers passed to any PSA function reside
|
|
1094
|
+
* in memory that is accessible only to the PSA function during its execution.
|
|
1095
|
+
*
|
|
1096
|
+
* This option MUST be disabled whenever buffer arguments are in memory shared
|
|
1097
|
+
* with an untrusted party, for example where arguments to PSA calls are passed
|
|
1098
|
+
* across a trust boundary.
|
|
1099
|
+
*
|
|
1100
|
+
* \note Enabling this option reduces memory usage and code size.
|
|
1101
|
+
*
|
|
1102
|
+
* \note Enabling this option causes overlap of input and output buffers
|
|
1103
|
+
* not to be supported by PSA functions.
|
|
1104
|
+
*/
|
|
1105
|
+
//#define MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* \def MBEDTLS_PSA_BUILTIN_GET_ENTROPY
|
|
1109
|
+
*
|
|
1110
|
+
* Enable entropy sources for which the library has a built-in driver.
|
|
1111
|
+
*
|
|
1112
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C, !MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
|
1113
|
+
*
|
|
1114
|
+
* These are:
|
|
1115
|
+
* - getrandom() on Linux (if syscall() is available at compile time);
|
|
1116
|
+
* - getrandom() on FreeBSD and DragonFlyBSD (if available at compile time);
|
|
1117
|
+
* - `sysctl(KERN_ARND)` on FreeBSD and NetBSD;
|
|
1118
|
+
* - #MBEDTLS_PLATFORM_DEV_RANDOM on Unix-like platforms (unless one of the
|
|
1119
|
+
* above is used);
|
|
1120
|
+
* - BCryptGenRandom() on Windows.
|
|
1121
|
+
*
|
|
1122
|
+
* You should enable this option if your platform has one of these. If not:
|
|
1123
|
+
*
|
|
1124
|
+
* - You can enable #MBEDTLS_PSA_DRIVER_GET_ENTROPY instead, and provide
|
|
1125
|
+
* an entropy source callback for your platform.
|
|
1126
|
+
* - If your platform has a fast cryptographic-quality random generator,
|
|
1127
|
+
* enable #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and provide a random generator
|
|
1128
|
+
* callback instead.
|
|
1129
|
+
* - If your platform has no source of entropy at all, you can enable
|
|
1130
|
+
* #MBEDTLS_ENTROPY_NV_SEED and provide a seed in nonvolatile memory
|
|
1131
|
+
* during the provisioning of the device.
|
|
1132
|
+
* - The random generator requires a random generator callback,
|
|
1133
|
+
* an entropy source or a seed in nonvolatile memory.
|
|
1134
|
+
* Builds with no random generator are not officially supported yet, except
|
|
1135
|
+
* client-only builds (#MBEDTLS_PSA_CRYPTO_CLIENT enabled and
|
|
1136
|
+
* #MBEDTLS_PSA_CRYPTO_C disabled).
|
|
1137
|
+
*/
|
|
1138
|
+
#define MBEDTLS_PSA_BUILTIN_GET_ENTROPY
|
|
1139
|
+
|
|
1140
|
+
/** \def MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
|
|
1141
|
+
*
|
|
1142
|
+
* Enable support for platform built-in keys. If you enable this feature,
|
|
1143
|
+
* you must implement the function mbedtls_psa_platform_get_builtin_key().
|
|
1144
|
+
* See the documentation of that function for more information.
|
|
1145
|
+
*
|
|
1146
|
+
* Built-in keys are typically derived from a hardware unique key or
|
|
1147
|
+
* stored in a secure element.
|
|
1148
|
+
*
|
|
1149
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C.
|
|
1150
|
+
*
|
|
1151
|
+
* \warning This interface is experimental and may change or be removed
|
|
1152
|
+
* without notice.
|
|
1153
|
+
*/
|
|
1154
|
+
//#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
|
|
1155
|
+
|
|
1156
|
+
/** \def MBEDTLS_PSA_CRYPTO_CLIENT
|
|
1157
|
+
*
|
|
1158
|
+
* Enable support for PSA crypto client.
|
|
1159
|
+
*
|
|
1160
|
+
* \note This option allows to include the code necessary for a PSA
|
|
1161
|
+
* crypto client when the PSA crypto implementation is not included in
|
|
1162
|
+
* the library (MBEDTLS_PSA_CRYPTO_C disabled). The code included is the
|
|
1163
|
+
* code to set and get PSA key attributes.
|
|
1164
|
+
* The development of PSA drivers partially relying on the library to
|
|
1165
|
+
* fulfill the hardware gaps is another possible usage of this option.
|
|
1166
|
+
*
|
|
1167
|
+
* \warning This interface is experimental and may change or be removed
|
|
1168
|
+
* without notice.
|
|
1169
|
+
*/
|
|
1170
|
+
//#define MBEDTLS_PSA_CRYPTO_CLIENT
|
|
1171
|
+
|
|
1172
|
+
/** \def MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
|
1173
|
+
*
|
|
1174
|
+
* Make the PSA Crypto module use an external random generator provided
|
|
1175
|
+
* by a driver, instead of Mbed TLS's entropy and DRBG modules.
|
|
1176
|
+
*
|
|
1177
|
+
* \note This random generator must deliver random numbers with cryptographic
|
|
1178
|
+
* quality and high performance. It must supply unpredictable numbers
|
|
1179
|
+
* with a uniform distribution. The implementation of this function
|
|
1180
|
+
* is responsible for ensuring that the random generator is seeded
|
|
1181
|
+
* with sufficient entropy. If you have a hardware TRNG which is slow
|
|
1182
|
+
* or delivers non-uniform output, declare it as an entropy source
|
|
1183
|
+
* with mbedtls_entropy_add_source() instead of enabling this option.
|
|
1184
|
+
*
|
|
1185
|
+
* If you enable this option, you must configure the type
|
|
1186
|
+
* ::mbedtls_psa_external_random_context_t in psa/crypto_platform.h
|
|
1187
|
+
* and define a function called mbedtls_psa_external_get_random()
|
|
1188
|
+
* with the following prototype:
|
|
1189
|
+
* ```
|
|
1190
|
+
* psa_status_t mbedtls_psa_external_get_random(
|
|
1191
|
+
* mbedtls_psa_external_random_context_t *context,
|
|
1192
|
+
* uint8_t *output, size_t output_size, size_t *output_length);
|
|
1193
|
+
* );
|
|
1194
|
+
* ```
|
|
1195
|
+
* The \c context value is initialized to 0 before the first call.
|
|
1196
|
+
* The function must fill the \c output buffer with \c output_size bytes
|
|
1197
|
+
* of random data and set \c *output_length to \c output_size.
|
|
1198
|
+
*
|
|
1199
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C
|
|
1200
|
+
*
|
|
1201
|
+
* \warning If you enable this option, code that uses the PSA cryptography
|
|
1202
|
+
* interface will not use any of the entropy sources set up for
|
|
1203
|
+
* the entropy module, nor the NV seed that MBEDTLS_ENTROPY_NV_SEED
|
|
1204
|
+
* enables.
|
|
1205
|
+
*
|
|
1206
|
+
* \note This option is experimental and may be removed without notice.
|
|
1207
|
+
*/
|
|
1208
|
+
//#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
|
1209
|
+
|
|
1210
|
+
/* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
|
|
1211
|
+
*
|
|
1212
|
+
* Enable key identifiers that encode a key owner identifier.
|
|
1213
|
+
*
|
|
1214
|
+
* The owner of a key is identified by a value of type ::mbedtls_key_owner_id_t
|
|
1215
|
+
* which is currently hard-coded to be int32_t.
|
|
1216
|
+
*
|
|
1217
|
+
* Note that this option is meant for internal use only and may be removed
|
|
1218
|
+
* without notice.
|
|
1219
|
+
*/
|
|
1220
|
+
//#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* \def MBEDTLS_PSA_CRYPTO_SPM
|
|
1224
|
+
*
|
|
1225
|
+
* When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure
|
|
1226
|
+
* Partition Manager) integration which separates the code into two parts: a
|
|
1227
|
+
* NSPE (Non-Secure Process Environment) and an SPE (Secure Process
|
|
1228
|
+
* Environment).
|
|
1229
|
+
*
|
|
1230
|
+
* If you enable this option, your build environment must include a header
|
|
1231
|
+
* file `"crypto_spe.h"` (either in the `psa` subdirectory of the Mbed TLS
|
|
1232
|
+
* header files, or in another directory on the compiler's include search
|
|
1233
|
+
* path). Alternatively, your platform may customize the header
|
|
1234
|
+
* `psa/crypto_platform.h`, in which case it can skip or replace the
|
|
1235
|
+
* inclusion of `"crypto_spe.h"`.
|
|
1236
|
+
*
|
|
1237
|
+
* Module: core/psa_crypto.c
|
|
1238
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C
|
|
1239
|
+
*
|
|
1240
|
+
*/
|
|
1241
|
+
//#define MBEDTLS_PSA_CRYPTO_SPM
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* \def MBEDTLS_PSA_CRYPTO_STORAGE_C
|
|
1245
|
+
*
|
|
1246
|
+
* Enable the Platform Security Architecture persistent key storage.
|
|
1247
|
+
*
|
|
1248
|
+
* Module: core/psa_crypto_storage.c
|
|
1249
|
+
*
|
|
1250
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C,
|
|
1251
|
+
* either MBEDTLS_PSA_ITS_FILE_C or a native implementation of
|
|
1252
|
+
* the PSA ITS interface
|
|
1253
|
+
*/
|
|
1254
|
+
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* \def MBEDTLS_PSA_DRIVER_GET_ENTROPY
|
|
1258
|
+
*
|
|
1259
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C, !MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
|
|
1260
|
+
*
|
|
1261
|
+
* Enable the custom entropy callback mbedtls_platform_get_entropy()
|
|
1262
|
+
* (declared in mbedtls/platform.h). You need to provide this callback
|
|
1263
|
+
* if you need an entropy source and the built-in entropy callback
|
|
1264
|
+
* provided by #MBEDTLS_PSA_BUILTIN_GET_ENTROPY does not work on your platform.
|
|
1265
|
+
*
|
|
1266
|
+
* Enabling both #MBEDTLS_PSA_BUILTIN_GET_ENTROPY and
|
|
1267
|
+
* #MBEDTLS_PSA_DRIVER_GET_ENTROPY is currently not supported.
|
|
1268
|
+
*
|
|
1269
|
+
* You do not need any entropy source in the following circumstances:
|
|
1270
|
+
*
|
|
1271
|
+
* - If your platform has a fast cryptographic-quality random generator, and
|
|
1272
|
+
* you enable #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and provide a random generator
|
|
1273
|
+
* callback instead.
|
|
1274
|
+
* - If your platform has no source of entropy at all, and you enable
|
|
1275
|
+
* #MBEDTLS_ENTROPY_NV_SEED and provide a seed in nonvolatile memory
|
|
1276
|
+
* during the provisioning of the device.
|
|
1277
|
+
* - If you build the library with no random generator.
|
|
1278
|
+
* Builds with no random generator are not officially supported yet, except
|
|
1279
|
+
* client-only builds (#MBEDTLS_PSA_CRYPTO_CLIENT enabled and
|
|
1280
|
+
* #MBEDTLS_PSA_CRYPTO_C disabled).
|
|
1281
|
+
*/
|
|
1282
|
+
//#define MBEDTLS_PSA_DRIVER_GET_ENTROPY
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* \def MBEDTLS_PSA_ITS_FILE_C
|
|
1286
|
+
*
|
|
1287
|
+
* Enable the emulation of the Platform Security Architecture
|
|
1288
|
+
* Internal Trusted Storage (PSA ITS) over files.
|
|
1289
|
+
*
|
|
1290
|
+
* Module: core/psa_its_file.c
|
|
1291
|
+
*
|
|
1292
|
+
* Requires: MBEDTLS_FS_IO
|
|
1293
|
+
*/
|
|
1294
|
+
#define MBEDTLS_PSA_ITS_FILE_C
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* \def MBEDTLS_PSA_KEY_STORE_DYNAMIC
|
|
1298
|
+
*
|
|
1299
|
+
* Dynamically resize the PSA key store to accommodate any number of
|
|
1300
|
+
* volatile keys (until the heap memory is exhausted).
|
|
1301
|
+
*
|
|
1302
|
+
* If this option is disabled, the key store has a fixed size
|
|
1303
|
+
* #MBEDTLS_PSA_KEY_SLOT_COUNT for volatile keys and loaded persistent keys
|
|
1304
|
+
* together.
|
|
1305
|
+
*
|
|
1306
|
+
* This option has no effect when #MBEDTLS_PSA_CRYPTO_C is disabled.
|
|
1307
|
+
*
|
|
1308
|
+
* Module: core/psa_crypto.c
|
|
1309
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C
|
|
1310
|
+
*/
|
|
1311
|
+
#define MBEDTLS_PSA_KEY_STORE_DYNAMIC
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* \def MBEDTLS_PSA_STATIC_KEY_SLOTS
|
|
1315
|
+
*
|
|
1316
|
+
* Statically preallocate memory to store keys' material in PSA instead
|
|
1317
|
+
* of allocating it dynamically when required. This allows builds without a
|
|
1318
|
+
* heap, if none of the enabled cryptographic implementations or other features
|
|
1319
|
+
* require it.
|
|
1320
|
+
* This feature affects both volatile and persistent keys which means that
|
|
1321
|
+
* it's not possible to persistently store a key which is larger than
|
|
1322
|
+
* #MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE.
|
|
1323
|
+
*
|
|
1324
|
+
* \note This feature comes with a (potentially) higher RAM usage since:
|
|
1325
|
+
* - All the key slots are allocated no matter if they are used or not.
|
|
1326
|
+
* - Each key buffer's length is #MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE bytes.
|
|
1327
|
+
*
|
|
1328
|
+
* Requires: MBEDTLS_PSA_CRYPTO_C
|
|
1329
|
+
*
|
|
1330
|
+
*/
|
|
1331
|
+
//#define MBEDTLS_PSA_STATIC_KEY_SLOTS
|
|
1332
|
+
|
|
1333
|
+
/* Entropy options */
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* \def MBEDTLS_PSA_CRYPTO_PLATFORM_FILE
|
|
1337
|
+
*
|
|
1338
|
+
* If defined, this is a header which will be included instead of
|
|
1339
|
+
* `"psa/crypto_platform.h"`. This file should declare the same identifiers
|
|
1340
|
+
* as the one in Mbed TLS, but with definitions adapted to the platform on
|
|
1341
|
+
* which the library code will run.
|
|
1342
|
+
*
|
|
1343
|
+
* \note The required content of this header can vary from one version of
|
|
1344
|
+
* Mbed TLS to the next. Integrators who provide an alternative file
|
|
1345
|
+
* should review the changes in the original file whenever they
|
|
1346
|
+
* upgrade Mbed TLS.
|
|
1347
|
+
*
|
|
1348
|
+
* This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
|
|
1349
|
+
* non-standard feature of the C language, so this feature is only available
|
|
1350
|
+
* with compilers that perform macro expansion on an <tt>\#include</tt> line.
|
|
1351
|
+
*
|
|
1352
|
+
* The value of this symbol is typically a path in double quotes, either
|
|
1353
|
+
* absolute or relative to a directory on the include search path.
|
|
1354
|
+
*/
|
|
1355
|
+
//#define MBEDTLS_PSA_CRYPTO_PLATFORM_FILE "psa/crypto_platform_alt.h"
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* \def MBEDTLS_PSA_CRYPTO_STRUCT_FILE
|
|
1359
|
+
*
|
|
1360
|
+
* If defined, this is a header which will be included instead of
|
|
1361
|
+
* `"psa/crypto_struct.h"`. This file should declare the same identifiers
|
|
1362
|
+
* as the one in Mbed TLS, but with definitions adapted to the environment
|
|
1363
|
+
* in which the library code will run. The typical use for this feature
|
|
1364
|
+
* is to provide alternative type definitions on the client side in
|
|
1365
|
+
* client-server integrations of PSA crypto, where operation structures
|
|
1366
|
+
* contain handles instead of cryptographic data.
|
|
1367
|
+
*
|
|
1368
|
+
* \note The required content of this header can vary from one version of
|
|
1369
|
+
* Mbed TLS to the next. Integrators who provide an alternative file
|
|
1370
|
+
* should review the changes in the original file whenever they
|
|
1371
|
+
* upgrade Mbed TLS.
|
|
1372
|
+
*
|
|
1373
|
+
* This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
|
|
1374
|
+
* non-standard feature of the C language, so this feature is only available
|
|
1375
|
+
* with compilers that perform macro expansion on an <tt>\#include</tt> line.
|
|
1376
|
+
*
|
|
1377
|
+
* The value of this symbol is typically a path in double quotes, either
|
|
1378
|
+
* absolute or relative to a directory on the include search path.
|
|
1379
|
+
*/
|
|
1380
|
+
//#define MBEDTLS_PSA_CRYPTO_STRUCT_FILE "psa/crypto_struct_alt.h"
|
|
1381
|
+
|
|
1382
|
+
/** \def MBEDTLS_PSA_KEY_SLOT_COUNT
|
|
1383
|
+
*
|
|
1384
|
+
* When #MBEDTLS_PSA_KEY_STORE_DYNAMIC is disabled,
|
|
1385
|
+
* the maximum amount of PSA keys simultaneously in memory. This counts all
|
|
1386
|
+
* volatile keys, plus loaded persistent keys.
|
|
1387
|
+
*
|
|
1388
|
+
* When #MBEDTLS_PSA_KEY_STORE_DYNAMIC is enabled,
|
|
1389
|
+
* the maximum number of loaded persistent keys.
|
|
1390
|
+
*
|
|
1391
|
+
* Currently, persistent keys do not need to be loaded all the time while
|
|
1392
|
+
* a multipart operation is in progress, only while the operation is being
|
|
1393
|
+
* set up. This may change in future versions of the library.
|
|
1394
|
+
*
|
|
1395
|
+
* Currently, the library traverses of the whole table on each access to a
|
|
1396
|
+
* persistent key. Therefore large values may cause poor performance.
|
|
1397
|
+
*
|
|
1398
|
+
* This option has no effect when #MBEDTLS_PSA_CRYPTO_C is disabled.
|
|
1399
|
+
*/
|
|
1400
|
+
//#define MBEDTLS_PSA_KEY_SLOT_COUNT 32
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* \def MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
|
|
1404
|
+
*
|
|
1405
|
+
* Define the size (in bytes) of each static key buffer when
|
|
1406
|
+
* #MBEDTLS_PSA_STATIC_KEY_SLOTS is set. If not
|
|
1407
|
+
* explicitly defined then it's automatically guessed from available PSA keys
|
|
1408
|
+
* enabled in the build through PSA_WANT_xxx symbols.
|
|
1409
|
+
* If required by the application this parameter can be set to higher values
|
|
1410
|
+
* in order to store larger objects (ex: raw keys), but please note that this
|
|
1411
|
+
* will increase RAM usage.
|
|
1412
|
+
*/
|
|
1413
|
+
//#define MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE 256
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* \def MBEDTLS_PSA_CRYPTO_RNG_STRENGTH
|
|
1417
|
+
*
|
|
1418
|
+
* Minimum security strength (in bits) of the PSA RNG.
|
|
1419
|
+
*
|
|
1420
|
+
* \note Valid values: 128 or default of 256.
|
|
1421
|
+
*/
|
|
1422
|
+
//#define MBEDTLS_PSA_CRYPTO_RNG_STRENGTH 256
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* \def MBEDTLS_PSA_CRYPTO_RNG_HASH
|
|
1426
|
+
*
|
|
1427
|
+
* \brief Hash algorithm to use for the entropy module and for HMAC_DRBG if configured.
|
|
1428
|
+
*
|
|
1429
|
+
* The hash size (in bits) must be at least #MBEDTLS_PSA_CRYPTO_RNG_STRENGTH.
|
|
1430
|
+
*
|
|
1431
|
+
* In addition, if the entropy module is enabled (#MBEDTLS_PSA_CRYPTO_C is enabled
|
|
1432
|
+
* and #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is disabled):
|
|
1433
|
+
* - The hash size must be at least 32 bytes (i.e., 256 bits).
|
|
1434
|
+
* - Only two values are currently allowed: PSA_ALG_SHA_256 and PSA_ALG_SHA_512.
|
|
1435
|
+
* A future version may lift this limitation.
|
|
1436
|
+
*
|
|
1437
|
+
* If #MBEDTLS_PSA_CRYPTO_RNG_HASH is not explicitly set in the configuration,
|
|
1438
|
+
* a default hash that satisfies the above constraints is selected automatically.
|
|
1439
|
+
* If no suitable default can be selected, this will result in a build error.
|
|
1440
|
+
*/
|
|
1441
|
+
//#define MBEDTLS_PSA_CRYPTO_RNG_HASH PSA_ALG_SHA_256
|
|
1442
|
+
|
|
1443
|
+
/**
|
|
1444
|
+
* \def MBEDTLS_PSA_RNG_RESEED_INTERVAL
|
|
1445
|
+
*
|
|
1446
|
+
* In CTR_DRBG and HMAC_DRBG, the interval before the DRBG is reseeded from entropy.
|
|
1447
|
+
* The interval is the number of requests to the random generator, for any purpose.
|
|
1448
|
+
*
|
|
1449
|
+
* \note Requests have a maximum size (which depends on the library configuration
|
|
1450
|
+
* and is currently unspecified), so the maximum number of bytes before a reseed
|
|
1451
|
+
* is the interval multiplied by the maximum request size.
|
|
1452
|
+
*/
|
|
1453
|
+
//#define MBEDTLS_PSA_RNG_RESEED_INTERVAL 1000
|
|
1454
|
+
|
|
1455
|
+
/** \} name SECTION: PSA core */
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* \name SECTION: Builtin drivers
|
|
1459
|
+
*
|
|
1460
|
+
* This section sets driver specific settings.
|
|
1461
|
+
* \{
|
|
1462
|
+
*/
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* \def MBEDTLS_AESNI_C
|
|
1466
|
+
*
|
|
1467
|
+
* Enable AES-NI support on x86-64 or x86-32.
|
|
1468
|
+
*
|
|
1469
|
+
* \note AESNI is only supported with certain compilers and target options:
|
|
1470
|
+
* - Visual Studio: supported
|
|
1471
|
+
* - GCC, x86-64, target not explicitly supporting AESNI:
|
|
1472
|
+
* requires MBEDTLS_HAVE_ASM.
|
|
1473
|
+
* - GCC, x86-32, target not explicitly supporting AESNI:
|
|
1474
|
+
* not supported.
|
|
1475
|
+
* - GCC, x86-64 or x86-32, target supporting AESNI: supported.
|
|
1476
|
+
* For this assembly-less implementation, you must currently compile
|
|
1477
|
+
* `drivers/builtin/src/aesni.c` and `drivers/builtin/src/aes.c` with machine
|
|
1478
|
+
* options to enable SSE2 and AESNI instructions: `gcc -msse2 -maes -mpclmul`
|
|
1479
|
+
* or `clang -maes -mpclmul`.
|
|
1480
|
+
* - Non-x86 targets: this option is silently ignored.
|
|
1481
|
+
* - Other compilers: this option is silently ignored.
|
|
1482
|
+
*
|
|
1483
|
+
* \note
|
|
1484
|
+
* Above, "GCC" includes compatible compilers such as Clang.
|
|
1485
|
+
* The limitations on target support are likely to be relaxed in the future.
|
|
1486
|
+
*
|
|
1487
|
+
* Module: drivers/builtin/src/aesni.c
|
|
1488
|
+
* Caller: drivers/builtin/src/aes.c
|
|
1489
|
+
*
|
|
1490
|
+
* Requires: MBEDTLS_HAVE_ASM (on some platforms, see note)
|
|
1491
|
+
*
|
|
1492
|
+
* This modules adds support for the AES-NI instructions on x86.
|
|
1493
|
+
*/
|
|
1494
|
+
#define MBEDTLS_AESNI_C
|
|
1495
|
+
|
|
1496
|
+
/**
|
|
1497
|
+
* \def MBEDTLS_AESCE_C
|
|
1498
|
+
*
|
|
1499
|
+
* Enable AES cryptographic extension support on Armv8.
|
|
1500
|
+
*
|
|
1501
|
+
* Module: drivers/builtin/src/aesce.c
|
|
1502
|
+
* Caller: drivers/builtin/src/aes.c
|
|
1503
|
+
*
|
|
1504
|
+
* Requires: The AES built-in implementation
|
|
1505
|
+
*
|
|
1506
|
+
* \warning Runtime detection only works on Linux. For non-Linux operating
|
|
1507
|
+
* system, Armv8-A Cryptographic Extensions must be supported by
|
|
1508
|
+
* the CPU when this option is enabled.
|
|
1509
|
+
*
|
|
1510
|
+
* \note Minimum compiler versions for this feature when targeting aarch64
|
|
1511
|
+
* are Clang 4.0; armclang 6.6; GCC 6.0; or MSVC 2019 version 16.11.2.
|
|
1512
|
+
* Minimum compiler versions for this feature when targeting 32-bit
|
|
1513
|
+
* Arm or Thumb are Clang 11.0; armclang 6.20; or GCC 6.0.
|
|
1514
|
+
*
|
|
1515
|
+
* \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for
|
|
1516
|
+
* armclang <= 6.9
|
|
1517
|
+
*
|
|
1518
|
+
* This module adds support for the AES Armv8-A Cryptographic Extensions on Armv8 systems.
|
|
1519
|
+
*/
|
|
1520
|
+
#define MBEDTLS_AESCE_C
|
|
1521
|
+
|
|
1522
|
+
/**
|
|
1523
|
+
* \def MBEDTLS_AES_ROM_TABLES
|
|
1524
|
+
*
|
|
1525
|
+
* Use precomputed AES tables stored in ROM.
|
|
1526
|
+
*
|
|
1527
|
+
* Uncomment this macro to use precomputed AES tables stored in ROM.
|
|
1528
|
+
* Comment this macro to generate AES tables in RAM at runtime.
|
|
1529
|
+
*
|
|
1530
|
+
* Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
|
|
1531
|
+
* (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
|
|
1532
|
+
* initialization time before the first AES operation can be performed.
|
|
1533
|
+
* It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
|
|
1534
|
+
* MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
|
|
1535
|
+
* performance if ROM access is slower than RAM access.
|
|
1536
|
+
*
|
|
1537
|
+
* This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
|
|
1538
|
+
*/
|
|
1539
|
+
//#define MBEDTLS_AES_ROM_TABLES
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* \def MBEDTLS_AES_FEWER_TABLES
|
|
1543
|
+
*
|
|
1544
|
+
* Use less ROM/RAM for AES tables.
|
|
1545
|
+
*
|
|
1546
|
+
* Uncommenting this macro omits 75% of the AES tables from
|
|
1547
|
+
* ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
|
|
1548
|
+
* by computing their values on the fly during operations
|
|
1549
|
+
* (the tables are entry-wise rotations of one another).
|
|
1550
|
+
*
|
|
1551
|
+
* Tradeoff: Uncommenting this reduces the RAM / ROM footprint
|
|
1552
|
+
* by ~6kb but at the cost of more arithmetic operations during
|
|
1553
|
+
* runtime. Specifically, one has to compare 4 accesses within
|
|
1554
|
+
* different tables to 4 accesses with additional arithmetic
|
|
1555
|
+
* operations within the same table. The performance gain/loss
|
|
1556
|
+
* depends on the system and memory details.
|
|
1557
|
+
*
|
|
1558
|
+
* This option is independent of \c MBEDTLS_AES_ROM_TABLES.
|
|
1559
|
+
*/
|
|
1560
|
+
//#define MBEDTLS_AES_FEWER_TABLES
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* \def MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH
|
|
1564
|
+
*
|
|
1565
|
+
* Use only 128-bit keys in AES operations to save ROM.
|
|
1566
|
+
*
|
|
1567
|
+
* Uncomment this macro to remove support for AES operations that use 192-
|
|
1568
|
+
* or 256-bit keys.
|
|
1569
|
+
*
|
|
1570
|
+
* Uncommenting this macro reduces the size of AES code by ~300 bytes
|
|
1571
|
+
* on v8-M/Thumb2.
|
|
1572
|
+
*
|
|
1573
|
+
* Module: drivers/builtin/src/aes.c
|
|
1574
|
+
*
|
|
1575
|
+
* Requires: The AES built-in implementation
|
|
1576
|
+
*/
|
|
1577
|
+
//#define MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH
|
|
1578
|
+
|
|
1579
|
+
/*
|
|
1580
|
+
* Disable plain C implementation for AES.
|
|
1581
|
+
*
|
|
1582
|
+
* When the plain C implementation is enabled, and an implementation using a
|
|
1583
|
+
* special CPU feature (such as MBEDTLS_AESCE_C) is also enabled, runtime
|
|
1584
|
+
* detection will be used to select between them.
|
|
1585
|
+
*
|
|
1586
|
+
* If only one implementation is present, runtime detection will not be used.
|
|
1587
|
+
* This configuration will crash at runtime if running on a CPU without the
|
|
1588
|
+
* necessary features. It will not build unless at least one of MBEDTLS_AESCE_C
|
|
1589
|
+
* and/or MBEDTLS_AESNI_C is enabled & present in the build.
|
|
1590
|
+
*/
|
|
1591
|
+
//#define MBEDTLS_AES_USE_HARDWARE_ONLY
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* \def MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
|
|
1595
|
+
*
|
|
1596
|
+
* Remove decryption operation for AES, ARIA and Camellia block cipher.
|
|
1597
|
+
*
|
|
1598
|
+
* \note This feature is incompatible with PSA_WANT_ALG_ECB_NO_PADDING,
|
|
1599
|
+
* PSA_WANT_ALG_CBC_NO_PADDING, PSA_WANT_ALG_CBC_PKCS7 and
|
|
1600
|
+
* MBEDTLS_NIST_KW_C.
|
|
1601
|
+
*
|
|
1602
|
+
* Module: drivers/builtin/src/aes.c
|
|
1603
|
+
* drivers/builtin/src/aesce.c
|
|
1604
|
+
* drivers/builtin/src/aesni.c
|
|
1605
|
+
* drivers/builtin/src/aria.c
|
|
1606
|
+
* drivers/builtin/src/camellia.c
|
|
1607
|
+
* drivers/builtin/src/cipher.c
|
|
1608
|
+
*/
|
|
1609
|
+
//#define MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* \def MBEDTLS_CAMELLIA_SMALL_MEMORY
|
|
1613
|
+
*
|
|
1614
|
+
* Use less ROM for the Camellia implementation (saves about 768 bytes).
|
|
1615
|
+
*
|
|
1616
|
+
* Uncomment this macro to use less memory for Camellia.
|
|
1617
|
+
*/
|
|
1618
|
+
//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
|
|
1619
|
+
|
|
1620
|
+
/**
|
|
1621
|
+
* Enable the verified implementations of ECDH primitives from Project Everest
|
|
1622
|
+
* (currently only Curve25519).
|
|
1623
|
+
*
|
|
1624
|
+
* The Everest code is provided under the Apache 2.0 license only; therefore enabling this
|
|
1625
|
+
* option is not compatible with taking the library under the GPL v2.0-or-later license.
|
|
1626
|
+
*/
|
|
1627
|
+
//#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* \def MBEDTLS_ECP_NIST_OPTIM
|
|
1631
|
+
*
|
|
1632
|
+
* Enable specific 'modulo p' routines for each NIST prime.
|
|
1633
|
+
* Depending on the prime and architecture, makes operations 4 to 8 times
|
|
1634
|
+
* faster on the corresponding curve.
|
|
1635
|
+
*
|
|
1636
|
+
* Comment this macro to disable NIST curves optimisation.
|
|
1637
|
+
*/
|
|
1638
|
+
#define MBEDTLS_ECP_NIST_OPTIM
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* \def MBEDTLS_ECP_RESTARTABLE
|
|
1642
|
+
*
|
|
1643
|
+
* Enable "non-blocking" ECC operations that can return early and be resumed.
|
|
1644
|
+
*
|
|
1645
|
+
* This allows various functions to pause by returning
|
|
1646
|
+
* #PSA_OPERATION_INCOMPLETE and then be called later again in
|
|
1647
|
+
* order to further progress and eventually complete their operation. This is
|
|
1648
|
+
* controlled through psa_interruptible_set_max_ops() which limits the maximum
|
|
1649
|
+
* number of ECC operations a function may perform before pausing; see
|
|
1650
|
+
* psa_interruptible_set_max_ops() for more information.
|
|
1651
|
+
*
|
|
1652
|
+
* This is useful in non-threaded environments if you want to avoid blocking
|
|
1653
|
+
* for too long on ECC (and, hence, X.509 or SSL/TLS) operations.
|
|
1654
|
+
*
|
|
1655
|
+
* This option:
|
|
1656
|
+
* - Adds xxx_restartable() variants of existing operations in the
|
|
1657
|
+
* following modules, with corresponding restart context types:
|
|
1658
|
+
* - ECP (for Short Weierstrass curves only): scalar multiplication (mul),
|
|
1659
|
+
* linear combination (muladd);
|
|
1660
|
+
* - ECDSA: signature generation & verification;
|
|
1661
|
+
* - PK: signature generation & verification;
|
|
1662
|
+
* - X509: certificate chain verification.
|
|
1663
|
+
* - Adds mbedtls_ecdh_enable_restart() in the ECDH module.
|
|
1664
|
+
* - Changes the behaviour of TLS 1.2 clients (not servers) when using the
|
|
1665
|
+
* ECDHE-ECDSA key exchange (not other key exchanges) to make all ECC
|
|
1666
|
+
* computations restartable:
|
|
1667
|
+
* - verification of the server's key exchange signature;
|
|
1668
|
+
* - verification of the server's certificate chain;
|
|
1669
|
+
* - generation of the client's signature if client authentication is used,
|
|
1670
|
+
* with an ECC key/certificate.
|
|
1671
|
+
*
|
|
1672
|
+
* \note When this option is enabled, restartable operations in PK, X.509
|
|
1673
|
+
* and TLS (see above) are not using PSA. On the other hand, ECDH
|
|
1674
|
+
* computations in TLS are using PSA, and are not restartable. These
|
|
1675
|
+
* are temporary limitations that should be lifted in the future. (See
|
|
1676
|
+
* https://github.com/Mbed-TLS/mbedtls/issues/9784 and
|
|
1677
|
+
* https://github.com/Mbed-TLS/mbedtls/issues/9817)
|
|
1678
|
+
*
|
|
1679
|
+
* Requires: Builtin support of Elliptic Curves.
|
|
1680
|
+
*
|
|
1681
|
+
* Uncomment this macro to enable restartable ECC computations.
|
|
1682
|
+
*/
|
|
1683
|
+
//#define MBEDTLS_ECP_RESTARTABLE
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* Uncomment to enable using new bignum code in the ECC modules.
|
|
1687
|
+
*
|
|
1688
|
+
* \warning This is currently experimental, incomplete and therefore should not
|
|
1689
|
+
* be used in production.
|
|
1690
|
+
*/
|
|
1691
|
+
//#define MBEDTLS_ECP_WITH_MPI_UINT
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* \def MBEDTLS_GCM_LARGE_TABLE
|
|
1695
|
+
*
|
|
1696
|
+
* Enable large pre-computed tables for Galois/Counter Mode (GCM).
|
|
1697
|
+
* Can significantly increase throughput on systems without GCM hardware
|
|
1698
|
+
* acceleration (e.g., AESNI, AESCE).
|
|
1699
|
+
*
|
|
1700
|
+
* The mbedtls_gcm_context size will increase by 3840 bytes.
|
|
1701
|
+
* The code size will increase by roughly 344 bytes.
|
|
1702
|
+
*
|
|
1703
|
+
* Module: drivers/builtin/src/gcm.c
|
|
1704
|
+
*
|
|
1705
|
+
* Requires: The GCM built-in implementation
|
|
1706
|
+
*/
|
|
1707
|
+
//#define MBEDTLS_GCM_LARGE_TABLE
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* \def MBEDTLS_HAVE_ASM
|
|
1711
|
+
*
|
|
1712
|
+
* The compiler has support for asm().
|
|
1713
|
+
*
|
|
1714
|
+
* Requires support for asm() in compiler.
|
|
1715
|
+
*
|
|
1716
|
+
* Used in:
|
|
1717
|
+
* drivers/builtin/src/aesni.h
|
|
1718
|
+
* drivers/builtin/src/aria.c
|
|
1719
|
+
* drivers/builtin/src/bn_mul.h
|
|
1720
|
+
* utilities/constant_time.c
|
|
1721
|
+
*
|
|
1722
|
+
* Required by:
|
|
1723
|
+
* MBEDTLS_AESCE_C
|
|
1724
|
+
* MBEDTLS_AESNI_C (on some platforms)
|
|
1725
|
+
*
|
|
1726
|
+
* Comment to disable the use of assembly code.
|
|
1727
|
+
*/
|
|
1728
|
+
#define MBEDTLS_HAVE_ASM
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* \def MBEDTLS_HAVE_SSE2
|
|
1732
|
+
*
|
|
1733
|
+
* CPU supports SSE2 instruction set.
|
|
1734
|
+
*
|
|
1735
|
+
* Uncomment if the CPU supports SSE2 (IA-32 specific).
|
|
1736
|
+
*/
|
|
1737
|
+
//#define MBEDTLS_HAVE_SSE2
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* \def MBEDTLS_NO_UDBL_DIVISION
|
|
1741
|
+
*
|
|
1742
|
+
* The platform lacks support for double-width integer division (64-bit
|
|
1743
|
+
* division on a 32-bit platform, 128-bit division on a 64-bit platform).
|
|
1744
|
+
*
|
|
1745
|
+
* Used in:
|
|
1746
|
+
* include/mbedtls/bignum.h
|
|
1747
|
+
* drivers/builtin/src/bignum.c
|
|
1748
|
+
*
|
|
1749
|
+
* The bignum code uses double-width division to speed up some operations.
|
|
1750
|
+
* Double-width division is often implemented in software that needs to
|
|
1751
|
+
* be linked with the program. The presence of a double-width integer
|
|
1752
|
+
* type is usually detected automatically through preprocessor macros,
|
|
1753
|
+
* but the automatic detection cannot know whether the code needs to
|
|
1754
|
+
* and can be linked with an implementation of division for that type.
|
|
1755
|
+
* By default division is assumed to be usable if the type is present.
|
|
1756
|
+
* Uncomment this option to prevent the use of double-width division.
|
|
1757
|
+
*
|
|
1758
|
+
* Note that division for the native integer type is always required.
|
|
1759
|
+
* Furthermore, a 64-bit type is always required even on a 32-bit
|
|
1760
|
+
* platform, but it need not support multiplication or division. In some
|
|
1761
|
+
* cases it is also desirable to disable some double-width operations. For
|
|
1762
|
+
* example, if double-width division is implemented in software, disabling
|
|
1763
|
+
* it can reduce code size in some embedded targets.
|
|
1764
|
+
*/
|
|
1765
|
+
//#define MBEDTLS_NO_UDBL_DIVISION
|
|
1766
|
+
|
|
1767
|
+
/**
|
|
1768
|
+
* \def MBEDTLS_NO_64BIT_MULTIPLICATION
|
|
1769
|
+
*
|
|
1770
|
+
* The platform lacks support for 32x32 -> 64-bit multiplication.
|
|
1771
|
+
*
|
|
1772
|
+
* Used in:
|
|
1773
|
+
* drivers/builtin/src/poly1305.c
|
|
1774
|
+
*
|
|
1775
|
+
* Some parts of the library may use multiplication of two unsigned 32-bit
|
|
1776
|
+
* operands with a 64-bit result in order to speed up computations. On some
|
|
1777
|
+
* platforms, this is not available in hardware and has to be implemented in
|
|
1778
|
+
* software, usually in a library provided by the toolchain.
|
|
1779
|
+
*
|
|
1780
|
+
* Sometimes it is not desirable to have to link to that library. This option
|
|
1781
|
+
* removes the dependency of that library on platforms that lack a hardware
|
|
1782
|
+
* 64-bit multiplier by embedding a software implementation in Mbed TLS.
|
|
1783
|
+
*
|
|
1784
|
+
* Note that depending on the compiler, this may decrease performance compared
|
|
1785
|
+
* to using the library function provided by the toolchain.
|
|
1786
|
+
*/
|
|
1787
|
+
//#define MBEDTLS_NO_64BIT_MULTIPLICATION
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* Uncomment to enable p256-m. This is an alternative implementation of
|
|
1791
|
+
* key generation, ECDH and (randomized) ECDSA on the curve SECP256R1.
|
|
1792
|
+
* Compared to the default implementation:
|
|
1793
|
+
*
|
|
1794
|
+
* - p256-m has a much smaller code size and RAM footprint.
|
|
1795
|
+
* - p256-m is only available via the PSA API. This includes the pk module.
|
|
1796
|
+
* - p256-m does not support deterministic ECDSA, EC-JPAKE, custom protocols
|
|
1797
|
+
* over the core arithmetic, or deterministic derivation of keys.
|
|
1798
|
+
*
|
|
1799
|
+
* We recommend enabling this option if your application uses the PSA API
|
|
1800
|
+
* and the only elliptic curve support it needs is ECDH and ECDSA over
|
|
1801
|
+
* SECP256R1.
|
|
1802
|
+
*
|
|
1803
|
+
* If you enable this option, you do not need to enable any ECC-related
|
|
1804
|
+
* MBEDTLS_xxx option. You do need to separately request support for the
|
|
1805
|
+
* cryptographic mechanisms through the PSA API:
|
|
1806
|
+
* - #MBEDTLS_PSA_CRYPTO_C for PSA-based configuration;
|
|
1807
|
+
* - #PSA_WANT_ECC_SECP_R1_256;
|
|
1808
|
+
* - #PSA_WANT_ALG_ECDH and/or #PSA_WANT_ALG_ECDSA as needed;
|
|
1809
|
+
* - #PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY, #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC,
|
|
1810
|
+
* #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT,
|
|
1811
|
+
* #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT and/or
|
|
1812
|
+
* #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE as needed.
|
|
1813
|
+
*
|
|
1814
|
+
* \note To benefit from the smaller code size of p256-m, make sure that you
|
|
1815
|
+
* do not enable any ECC-related option not supported by p256-m: this
|
|
1816
|
+
* would cause the built-in ECC implementation to be built as well, in
|
|
1817
|
+
* order to provide the required option.
|
|
1818
|
+
* Make sure #PSA_WANT_ALG_DETERMINISTIC_ECDSA, #PSA_WANT_ALG_JPAKE and
|
|
1819
|
+
* #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE, and curves other than
|
|
1820
|
+
* SECP256R1 are disabled as they are not supported by this driver.
|
|
1821
|
+
* Also, avoid defining #MBEDTLS_PK_PARSE_EC_COMPRESSED or
|
|
1822
|
+
* #MBEDTLS_PK_PARSE_EC_EXTENDED as those currently require a subset of
|
|
1823
|
+
* the built-in ECC implementation, see docs/driver-only-builds.md.
|
|
1824
|
+
*/
|
|
1825
|
+
//#define MBEDTLS_PSA_P256M_DRIVER_ENABLED
|
|
1826
|
+
|
|
1827
|
+
/**
|
|
1828
|
+
* \def MBEDTLS_RSA_NO_CRT
|
|
1829
|
+
*
|
|
1830
|
+
* Do not use the Chinese Remainder Theorem
|
|
1831
|
+
* for the RSA private operation.
|
|
1832
|
+
*
|
|
1833
|
+
* Uncomment this macro to disable the use of CRT in RSA.
|
|
1834
|
+
*
|
|
1835
|
+
*/
|
|
1836
|
+
//#define MBEDTLS_RSA_NO_CRT
|
|
1837
|
+
|
|
1838
|
+
/**
|
|
1839
|
+
* \def MBEDTLS_SHA256_SMALLER
|
|
1840
|
+
*
|
|
1841
|
+
* Enable an implementation of SHA-256 that has lower ROM footprint but also
|
|
1842
|
+
* lower performance.
|
|
1843
|
+
*
|
|
1844
|
+
* The default implementation is meant to be a reasonable compromise between
|
|
1845
|
+
* performance and size. This version optimizes more aggressively for size at
|
|
1846
|
+
* the expense of performance. Eg on Cortex-M4 it reduces the size of
|
|
1847
|
+
* mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
|
|
1848
|
+
* 30%.
|
|
1849
|
+
*
|
|
1850
|
+
* Uncomment to enable the smaller implementation of SHA256.
|
|
1851
|
+
*/
|
|
1852
|
+
//#define MBEDTLS_SHA256_SMALLER
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* \def MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
|
|
1856
|
+
*
|
|
1857
|
+
* Enable acceleration of the SHA-256 and SHA-224 cryptographic hash algorithms
|
|
1858
|
+
* with the ARMv8 cryptographic extensions if they are available at runtime.
|
|
1859
|
+
* If not, the library will fall back to the C implementation.
|
|
1860
|
+
*
|
|
1861
|
+
* \note MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT requires the built-in
|
|
1862
|
+
* SHA-256 implementation to be present in the build. This implementation is
|
|
1863
|
+
* included only if PSA_WANT_ALG_SHA_256 is enabled and this results in
|
|
1864
|
+
* MBEDTLS_PSA_BUILTIN_ALG_SHA_256 being defined internally (i.e., no
|
|
1865
|
+
* fully-featured, fallback-free accelerator driver is present).
|
|
1866
|
+
*
|
|
1867
|
+
* \note If MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT is defined when building
|
|
1868
|
+
* for a non-Armv8-A build it will be silently ignored.
|
|
1869
|
+
*
|
|
1870
|
+
* \note Minimum compiler versions for this feature are Clang 4.0,
|
|
1871
|
+
* armclang 6.6 or GCC 6.0.
|
|
1872
|
+
*
|
|
1873
|
+
* \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for
|
|
1874
|
+
* armclang <= 6.9
|
|
1875
|
+
*
|
|
1876
|
+
* \warning MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT cannot be defined at the
|
|
1877
|
+
* same time as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY.
|
|
1878
|
+
*
|
|
1879
|
+
* Requires: The SHA-256 built-in implementation
|
|
1880
|
+
*
|
|
1881
|
+
* Module: drivers/builtin/src/sha256.c
|
|
1882
|
+
*
|
|
1883
|
+
* Uncomment to have the library check for the Armv8-A SHA-256 crypto extensions
|
|
1884
|
+
* and use them if available.
|
|
1885
|
+
*/
|
|
1886
|
+
//#define MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* \def MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY
|
|
1891
|
+
*
|
|
1892
|
+
* Enable acceleration of the SHA-256 and SHA-224 cryptographic hash algorithms
|
|
1893
|
+
* with the ARMv8 cryptographic extensions, which must be available at runtime
|
|
1894
|
+
* or else an illegal instruction fault will occur.
|
|
1895
|
+
*
|
|
1896
|
+
* \note MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY requires the built-in SHA-256
|
|
1897
|
+
* implementation to be present in the build. This implementation is included
|
|
1898
|
+
* only if PSA_WANT_ALG_SHA_256 is enabled and this results in
|
|
1899
|
+
* MBEDTLS_PSA_BUILTIN_ALG_SHA_256 being defined internally (i.e., no
|
|
1900
|
+
* fully-featured, fallback-free accelerator driver is present).
|
|
1901
|
+
*
|
|
1902
|
+
* \note This allows builds with a smaller code size than with
|
|
1903
|
+
* MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
|
|
1904
|
+
*
|
|
1905
|
+
* \note Minimum compiler versions for this feature are Clang 4.0,
|
|
1906
|
+
* armclang 6.6 or GCC 6.0.
|
|
1907
|
+
*
|
|
1908
|
+
* \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for
|
|
1909
|
+
* armclang <= 6.9
|
|
1910
|
+
*
|
|
1911
|
+
* \warning MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY cannot be defined at the same
|
|
1912
|
+
* time as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT.
|
|
1913
|
+
*
|
|
1914
|
+
* Requires: The SHA-256 built-in implementation
|
|
1915
|
+
*
|
|
1916
|
+
* Module: drivers/builtin/src/sha256.c
|
|
1917
|
+
*
|
|
1918
|
+
* Uncomment to have the library use the Armv8-A SHA-256 crypto extensions
|
|
1919
|
+
* unconditionally.
|
|
1920
|
+
*/
|
|
1921
|
+
//#define MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* \def MBEDTLS_SHA512_SMALLER
|
|
1925
|
+
*
|
|
1926
|
+
* Enable an implementation of SHA-512 that has lower ROM footprint but also
|
|
1927
|
+
* lower performance.
|
|
1928
|
+
*
|
|
1929
|
+
* Uncomment to enable the smaller implementation of SHA512.
|
|
1930
|
+
*/
|
|
1931
|
+
//#define MBEDTLS_SHA512_SMALLER
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* \def MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
|
|
1935
|
+
*
|
|
1936
|
+
* Enable acceleration of the SHA-512 and SHA-384 cryptographic hash algorithms
|
|
1937
|
+
* with the ARMv8 cryptographic extensions if they are available at runtime.
|
|
1938
|
+
* If not, the library will fall back to the C implementation.
|
|
1939
|
+
*
|
|
1940
|
+
* \note MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT requires the built-in
|
|
1941
|
+
* SHA-512 implementation to be present in the build. This implementation is
|
|
1942
|
+
* included only if PSA_WANT_ALG_SHA_512 is enabled and this results in
|
|
1943
|
+
* MBEDTLS_PSA_BUILTIN_ALG_SHA_512 being defined internally (i.e., no
|
|
1944
|
+
* fully-featured, fallback-free accelerator driver is present).
|
|
1945
|
+
*
|
|
1946
|
+
* \note If MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT is defined when building
|
|
1947
|
+
* for a non-Aarch64 build it will be silently ignored.
|
|
1948
|
+
*
|
|
1949
|
+
* \note Minimum compiler versions for this feature are Clang 7.0,
|
|
1950
|
+
* armclang 6.9 or GCC 8.0.
|
|
1951
|
+
*
|
|
1952
|
+
* \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for
|
|
1953
|
+
* armclang 6.9
|
|
1954
|
+
*
|
|
1955
|
+
* \warning MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT cannot be defined at the
|
|
1956
|
+
* same time as MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY.
|
|
1957
|
+
*
|
|
1958
|
+
* Requires: The SHA-512 built-in implementation
|
|
1959
|
+
*
|
|
1960
|
+
* Module: drivers/builtin/src/sha512.c
|
|
1961
|
+
*
|
|
1962
|
+
* Uncomment to have the library check for the A64 SHA-512 crypto extensions
|
|
1963
|
+
* and use them if available.
|
|
1964
|
+
*/
|
|
1965
|
+
//#define MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* \def MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY
|
|
1969
|
+
*
|
|
1970
|
+
* Enable acceleration of the SHA-512 and SHA-384 cryptographic hash algorithms
|
|
1971
|
+
* with the ARMv8 cryptographic extensions, which must be available at runtime
|
|
1972
|
+
* or else an illegal instruction fault will occur.
|
|
1973
|
+
*
|
|
1974
|
+
* \note MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT requires the built-in
|
|
1975
|
+
* SHA-512 implementation to be present in the build. This implementation is
|
|
1976
|
+
* included only if PSA_WANT_ALG_SHA_512 is enabled and this results in
|
|
1977
|
+
* MBEDTLS_PSA_BUILTIN_ALG_SHA_512 being defined internally (i.e., no
|
|
1978
|
+
* fully-featured, fallback-free accelerator driver is present).
|
|
1979
|
+
*
|
|
1980
|
+
* \note This allows builds with a smaller code size than with
|
|
1981
|
+
* MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
|
|
1982
|
+
*
|
|
1983
|
+
* \note Minimum compiler versions for this feature are Clang 7.0,
|
|
1984
|
+
* armclang 6.9 or GCC 8.0.
|
|
1985
|
+
*
|
|
1986
|
+
* \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for
|
|
1987
|
+
* armclang 6.9
|
|
1988
|
+
*
|
|
1989
|
+
* \warning MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY cannot be defined at the same
|
|
1990
|
+
* time as MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT.
|
|
1991
|
+
*
|
|
1992
|
+
* Requires: The SHA-512 built-in implementation
|
|
1993
|
+
*
|
|
1994
|
+
* Module: drivers/builtin/src/sha512.c
|
|
1995
|
+
*
|
|
1996
|
+
* Uncomment to have the library use the A64 SHA-512 crypto extensions
|
|
1997
|
+
* unconditionally.
|
|
1998
|
+
*/
|
|
1999
|
+
//#define MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY
|
|
2000
|
+
|
|
2001
|
+
/* ECP options */
|
|
2002
|
+
//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
|
|
2003
|
+
//#define MBEDTLS_ECP_WINDOW_SIZE 4 /**< Maximum window size used */
|
|
2004
|
+
|
|
2005
|
+
/* MPI / BIGNUM options */
|
|
2006
|
+
//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
|
|
2007
|
+
//#define MBEDTLS_MPI_WINDOW_SIZE 2 /**< Maximum window size used. */
|
|
2008
|
+
|
|
2009
|
+
/* RSA OPTIONS */
|
|
2010
|
+
//#define MBEDTLS_RSA_GEN_KEY_MIN_BITS 1024 /**< Minimum RSA key size that can be generated in bits (Minimum possible value is 128 bits) */
|
|
2011
|
+
|
|
2012
|
+
/**
|
|
2013
|
+
* \def TF_PSA_CRYPTO_PQCP_MLDSA_ENABLED
|
|
2014
|
+
*
|
|
2015
|
+
* Enable mldsa-native from the PQCP (post-quantum code package) driver.
|
|
2016
|
+
* This is an integration of https://github.com/pq-code-package/mldsa-native
|
|
2017
|
+
* in TF-PSA-Crypto.
|
|
2018
|
+
*
|
|
2019
|
+
* \warning This option is experimental. It may change or be removed without
|
|
2020
|
+
* notice.
|
|
2021
|
+
*
|
|
2022
|
+
* Module: drivers/pqcp/src/wrap_mldsa_native.c
|
|
2023
|
+
*
|
|
2024
|
+
* Uncomment to include mldsa-native in libtfpsacrypto.
|
|
2025
|
+
*/
|
|
2026
|
+
//#define TF_PSA_CRYPTO_PQCP_MLDSA_ENABLED
|
|
2027
|
+
|
|
2028
|
+
/**
|
|
2029
|
+
* \def TF_PSA_CRYPTO_PQCP_MLDSA_87_ENABLED
|
|
2030
|
+
*
|
|
2031
|
+
* Enable mldsa-native from the PQCP (post-quantum code package) driver
|
|
2032
|
+
* for the security level 87.
|
|
2033
|
+
* This is an integration of https://github.com/pq-code-package/mldsa-native
|
|
2034
|
+
* in TF-PSA-Crypto.
|
|
2035
|
+
*
|
|
2036
|
+
* \warning This option is experimental. It may change or be removed without
|
|
2037
|
+
* notice.
|
|
2038
|
+
*
|
|
2039
|
+
* Requires: TF_PSA_CRYPTO_PQCP_MLDSA_ENABLED
|
|
2040
|
+
*
|
|
2041
|
+
* Module: drivers/pqcp/src/wrap_mldsa_native.c
|
|
2042
|
+
*
|
|
2043
|
+
* Uncomment to include MLDSA-87 from mldsa-native in libtfpsacrypto.
|
|
2044
|
+
*/
|
|
2045
|
+
//#define TF_PSA_CRYPTO_PQCP_MLDSA_87_ENABLED
|
|
2046
|
+
|
|
2047
|
+
/**
|
|
2048
|
+
* \def TF_PSA_CRYPTO_PQCP_OWN_SHAKE
|
|
2049
|
+
*
|
|
2050
|
+
* If this option is enabled, the MLDSA implementation from mldsa-native
|
|
2051
|
+
* (#TF_PSA_CRYPTO_PQCP_MLDSA_ENABLED) will use the SHAKE implementation
|
|
2052
|
+
* that's bundled with mldsa-native. Otherwise mldsa-native will use the
|
|
2053
|
+
* TF-PSA-Crypto SHAKE builtin that powers the PSA SHA3 and SHAKE APIs.
|
|
2054
|
+
*
|
|
2055
|
+
* The mldsa-native SHAKE implementation is significantly faster on
|
|
2056
|
+
* processors that have vector instructions. On other architectures,
|
|
2057
|
+
* your mileage may vary.
|
|
2058
|
+
*
|
|
2059
|
+
* \warning This option is experimental. It may change or be removed without
|
|
2060
|
+
* notice.
|
|
2061
|
+
*
|
|
2062
|
+
* Module: drivers/pqcp/src/wrap_mldsa_native.c
|
|
2063
|
+
*
|
|
2064
|
+
* Uncomment to have mldsa-native use its own SHAKE.
|
|
2065
|
+
*/
|
|
2066
|
+
//#define TF_PSA_CRYPTO_PQCP_OWN_SHAKE
|
|
2067
|
+
|
|
2068
|
+
/** \} name SECTION: Builtin drivers */
|
|
2069
|
+
|
|
2070
|
+
/* Do not enable except for testing. Will be removed in a future minor version.
|
|
2071
|
+
*/
|
|
2072
|
+
//#define TF_PSA_CRYPTO_ALLOW_REMOVED_MECHANISMS
|
|
2073
|
+
#endif /* PSA_CRYPTO_CONFIG_H */
|