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,211 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* PSA hashing layer on top of Mbed TLS software crypto
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* Copyright The Mbed TLS Contributors
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#ifndef TF_PSA_CRYPTO_PSA_CRYPTO_HASH_H
|
|
10
|
+
#define TF_PSA_CRYPTO_PSA_CRYPTO_HASH_H
|
|
11
|
+
|
|
12
|
+
#include <psa/crypto.h>
|
|
13
|
+
|
|
14
|
+
/** Calculate the hash (digest) of a message using Mbed TLS routines.
|
|
15
|
+
*
|
|
16
|
+
* \note The signature of this function is that of a PSA driver hash_compute
|
|
17
|
+
* entry point. This function behaves as a hash_compute entry point as
|
|
18
|
+
* defined in the PSA driver interface specification for transparent
|
|
19
|
+
* drivers.
|
|
20
|
+
*
|
|
21
|
+
* \param alg The hash algorithm to compute (\c PSA_ALG_XXX value
|
|
22
|
+
* such that #PSA_ALG_IS_HASH(\p alg) is true).
|
|
23
|
+
* \param[in] input Buffer containing the message to hash.
|
|
24
|
+
* \param input_length Size of the \p input buffer in bytes.
|
|
25
|
+
* \param[out] hash Buffer where the hash is to be written.
|
|
26
|
+
* \param hash_size Size of the \p hash buffer in bytes.
|
|
27
|
+
* \param[out] hash_length On success, the number of bytes
|
|
28
|
+
* that make up the hash value. This is always
|
|
29
|
+
* #PSA_HASH_LENGTH(\p alg).
|
|
30
|
+
*
|
|
31
|
+
* \retval #PSA_SUCCESS
|
|
32
|
+
* Success.
|
|
33
|
+
* \retval #PSA_ERROR_NOT_SUPPORTED
|
|
34
|
+
* \p alg is not supported
|
|
35
|
+
* \retval #PSA_ERROR_BUFFER_TOO_SMALL
|
|
36
|
+
* \p hash_size is too small
|
|
37
|
+
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
|
|
38
|
+
* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
|
|
39
|
+
*/
|
|
40
|
+
psa_status_t mbedtls_psa_hash_compute(
|
|
41
|
+
psa_algorithm_t alg,
|
|
42
|
+
const uint8_t *input,
|
|
43
|
+
size_t input_length,
|
|
44
|
+
uint8_t *hash,
|
|
45
|
+
size_t hash_size,
|
|
46
|
+
size_t *hash_length);
|
|
47
|
+
|
|
48
|
+
/** Set up a multipart hash operation using Mbed TLS routines.
|
|
49
|
+
*
|
|
50
|
+
* \note The signature of this function is that of a PSA driver hash_setup
|
|
51
|
+
* entry point. This function behaves as a hash_setup entry point as
|
|
52
|
+
* defined in the PSA driver interface specification for transparent
|
|
53
|
+
* drivers.
|
|
54
|
+
*
|
|
55
|
+
* If an error occurs at any step after a call to mbedtls_psa_hash_setup(), the
|
|
56
|
+
* operation will need to be reset by a call to mbedtls_psa_hash_abort(). The
|
|
57
|
+
* core may call mbedtls_psa_hash_abort() at any time after the operation
|
|
58
|
+
* has been initialized.
|
|
59
|
+
*
|
|
60
|
+
* After a successful call to mbedtls_psa_hash_setup(), the core must
|
|
61
|
+
* eventually terminate the operation. The following events terminate an
|
|
62
|
+
* operation:
|
|
63
|
+
* - A successful call to mbedtls_psa_hash_finish() or mbedtls_psa_hash_verify().
|
|
64
|
+
* - A call to mbedtls_psa_hash_abort().
|
|
65
|
+
*
|
|
66
|
+
* \param[in,out] operation The operation object to set up. It must have
|
|
67
|
+
* been initialized to all-zero and not yet be in use.
|
|
68
|
+
* \param alg The hash algorithm to compute (\c PSA_ALG_XXX value
|
|
69
|
+
* such that #PSA_ALG_IS_HASH(\p alg) is true).
|
|
70
|
+
*
|
|
71
|
+
* \retval #PSA_SUCCESS
|
|
72
|
+
* Success.
|
|
73
|
+
* \retval #PSA_ERROR_NOT_SUPPORTED
|
|
74
|
+
* \p alg is not supported
|
|
75
|
+
* \retval #PSA_ERROR_BAD_STATE
|
|
76
|
+
* The operation state is not valid (it must be inactive).
|
|
77
|
+
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
|
|
78
|
+
* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
|
|
79
|
+
*/
|
|
80
|
+
psa_status_t mbedtls_psa_hash_setup(
|
|
81
|
+
mbedtls_psa_hash_operation_t *operation,
|
|
82
|
+
psa_algorithm_t alg);
|
|
83
|
+
|
|
84
|
+
/** Clone an Mbed TLS hash operation.
|
|
85
|
+
*
|
|
86
|
+
* \note The signature of this function is that of a PSA driver hash_clone
|
|
87
|
+
* entry point. This function behaves as a hash_clone entry point as
|
|
88
|
+
* defined in the PSA driver interface specification for transparent
|
|
89
|
+
* drivers.
|
|
90
|
+
*
|
|
91
|
+
* This function copies the state of an ongoing hash operation to
|
|
92
|
+
* a new operation object. In other words, this function is equivalent
|
|
93
|
+
* to calling mbedtls_psa_hash_setup() on \p target_operation with the same
|
|
94
|
+
* algorithm that \p source_operation was set up for, then
|
|
95
|
+
* mbedtls_psa_hash_update() on \p target_operation with the same input that
|
|
96
|
+
* that was passed to \p source_operation. After this function returns, the
|
|
97
|
+
* two objects are independent, i.e. subsequent calls involving one of
|
|
98
|
+
* the objects do not affect the other object.
|
|
99
|
+
*
|
|
100
|
+
* \param[in] source_operation The active hash operation to clone.
|
|
101
|
+
* \param[in,out] target_operation The operation object to set up.
|
|
102
|
+
* It must be initialized but not active.
|
|
103
|
+
*
|
|
104
|
+
* \retval #PSA_SUCCESS \emptydescription
|
|
105
|
+
* \retval #PSA_ERROR_BAD_STATE
|
|
106
|
+
* The \p source_operation state is not valid (it must be active).
|
|
107
|
+
* \retval #PSA_ERROR_BAD_STATE
|
|
108
|
+
* The \p target_operation state is not valid (it must be inactive).
|
|
109
|
+
* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
|
|
110
|
+
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
|
|
111
|
+
*/
|
|
112
|
+
psa_status_t mbedtls_psa_hash_clone(
|
|
113
|
+
const mbedtls_psa_hash_operation_t *source_operation,
|
|
114
|
+
mbedtls_psa_hash_operation_t *target_operation);
|
|
115
|
+
|
|
116
|
+
/** Add a message fragment to a multipart Mbed TLS hash operation.
|
|
117
|
+
*
|
|
118
|
+
* \note The signature of this function is that of a PSA driver hash_update
|
|
119
|
+
* entry point. This function behaves as a hash_update entry point as
|
|
120
|
+
* defined in the PSA driver interface specification for transparent
|
|
121
|
+
* drivers.
|
|
122
|
+
*
|
|
123
|
+
* The application must call mbedtls_psa_hash_setup() before calling this function.
|
|
124
|
+
*
|
|
125
|
+
* If this function returns an error status, the operation enters an error
|
|
126
|
+
* state and must be aborted by calling mbedtls_psa_hash_abort().
|
|
127
|
+
*
|
|
128
|
+
* \param[in,out] operation Active hash operation.
|
|
129
|
+
* \param[in] input Buffer containing the message fragment to hash.
|
|
130
|
+
* \param input_length Size of the \p input buffer in bytes.
|
|
131
|
+
*
|
|
132
|
+
* \retval #PSA_SUCCESS
|
|
133
|
+
* Success.
|
|
134
|
+
* \retval #PSA_ERROR_BAD_STATE
|
|
135
|
+
* The operation state is not valid (it must be active).
|
|
136
|
+
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
|
|
137
|
+
* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
|
|
138
|
+
*/
|
|
139
|
+
psa_status_t mbedtls_psa_hash_update(
|
|
140
|
+
mbedtls_psa_hash_operation_t *operation,
|
|
141
|
+
const uint8_t *input,
|
|
142
|
+
size_t input_length);
|
|
143
|
+
|
|
144
|
+
/** Finish the calculation of the Mbed TLS-calculated hash of a message.
|
|
145
|
+
*
|
|
146
|
+
* \note The signature of this function is that of a PSA driver hash_finish
|
|
147
|
+
* entry point. This function behaves as a hash_finish entry point as
|
|
148
|
+
* defined in the PSA driver interface specification for transparent
|
|
149
|
+
* drivers.
|
|
150
|
+
*
|
|
151
|
+
* The application must call mbedtls_psa_hash_setup() before calling this function.
|
|
152
|
+
* This function calculates the hash of the message formed by concatenating
|
|
153
|
+
* the inputs passed to preceding calls to mbedtls_psa_hash_update().
|
|
154
|
+
*
|
|
155
|
+
* When this function returns successfully, the operation becomes inactive.
|
|
156
|
+
* If this function returns an error status, the operation enters an error
|
|
157
|
+
* state and must be aborted by calling mbedtls_psa_hash_abort().
|
|
158
|
+
*
|
|
159
|
+
* \param[in,out] operation Active hash operation.
|
|
160
|
+
* \param[out] hash Buffer where the hash is to be written.
|
|
161
|
+
* \param hash_size Size of the \p hash buffer in bytes.
|
|
162
|
+
* \param[out] hash_length On success, the number of bytes
|
|
163
|
+
* that make up the hash value. This is always
|
|
164
|
+
* #PSA_HASH_LENGTH(\c alg) where \c alg is the
|
|
165
|
+
* hash algorithm that is calculated.
|
|
166
|
+
*
|
|
167
|
+
* \retval #PSA_SUCCESS
|
|
168
|
+
* Success.
|
|
169
|
+
* \retval #PSA_ERROR_BAD_STATE
|
|
170
|
+
* The operation state is not valid (it must be active).
|
|
171
|
+
* \retval #PSA_ERROR_BUFFER_TOO_SMALL
|
|
172
|
+
* The size of the \p hash buffer is too small. You can determine a
|
|
173
|
+
* sufficient buffer size by calling #PSA_HASH_LENGTH(\c alg)
|
|
174
|
+
* where \c alg is the hash algorithm that is calculated.
|
|
175
|
+
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
|
|
176
|
+
* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
|
|
177
|
+
*/
|
|
178
|
+
psa_status_t mbedtls_psa_hash_finish(
|
|
179
|
+
mbedtls_psa_hash_operation_t *operation,
|
|
180
|
+
uint8_t *hash,
|
|
181
|
+
size_t hash_size,
|
|
182
|
+
size_t *hash_length);
|
|
183
|
+
|
|
184
|
+
/** Abort an Mbed TLS hash operation.
|
|
185
|
+
*
|
|
186
|
+
* \note The signature of this function is that of a PSA driver hash_abort
|
|
187
|
+
* entry point. This function behaves as a hash_abort entry point as
|
|
188
|
+
* defined in the PSA driver interface specification for transparent
|
|
189
|
+
* drivers.
|
|
190
|
+
*
|
|
191
|
+
* Aborting an operation frees all associated resources except for the
|
|
192
|
+
* \p operation structure itself. Once aborted, the operation object
|
|
193
|
+
* can be reused for another operation by calling
|
|
194
|
+
* mbedtls_psa_hash_setup() again.
|
|
195
|
+
*
|
|
196
|
+
* You may call this function any time after the operation object has
|
|
197
|
+
* been initialized by one of the methods described in #psa_hash_operation_t.
|
|
198
|
+
*
|
|
199
|
+
* In particular, calling mbedtls_psa_hash_abort() after the operation has been
|
|
200
|
+
* terminated by a call to mbedtls_psa_hash_abort(), mbedtls_psa_hash_finish() or
|
|
201
|
+
* mbedtls_psa_hash_verify() is safe and has no effect.
|
|
202
|
+
*
|
|
203
|
+
* \param[in,out] operation Initialized hash operation.
|
|
204
|
+
*
|
|
205
|
+
* \retval #PSA_SUCCESS \emptydescription
|
|
206
|
+
* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
|
|
207
|
+
*/
|
|
208
|
+
psa_status_t mbedtls_psa_hash_abort(
|
|
209
|
+
mbedtls_psa_hash_operation_t *operation);
|
|
210
|
+
|
|
211
|
+
#endif /* TF_PSA_CRYPTO_PSA_CRYPTO_HASH_H */
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* PSA MAC layer on top of Mbed TLS software crypto
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* Copyright The Mbed TLS Contributors
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#include "tf_psa_crypto_common.h"
|
|
10
|
+
|
|
11
|
+
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
|
12
|
+
|
|
13
|
+
#include <psa/crypto.h>
|
|
14
|
+
#include "psa_crypto_core.h"
|
|
15
|
+
#include "psa_crypto_cipher.h"
|
|
16
|
+
#include "psa_crypto_mac.h"
|
|
17
|
+
#include <mbedtls/md.h>
|
|
18
|
+
|
|
19
|
+
#include <mbedtls/private/error_common.h>
|
|
20
|
+
#include "mbedtls/constant_time.h"
|
|
21
|
+
#include <string.h>
|
|
22
|
+
|
|
23
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
|
|
24
|
+
static psa_status_t psa_hmac_abort_internal(
|
|
25
|
+
mbedtls_psa_hmac_operation_t *hmac)
|
|
26
|
+
{
|
|
27
|
+
mbedtls_platform_zeroize(hmac->opad, sizeof(hmac->opad));
|
|
28
|
+
return psa_hash_abort(&hmac->hash_ctx);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static psa_status_t psa_hmac_setup_internal(
|
|
32
|
+
mbedtls_psa_hmac_operation_t *hmac,
|
|
33
|
+
const uint8_t *key,
|
|
34
|
+
size_t key_length,
|
|
35
|
+
psa_algorithm_t hash_alg)
|
|
36
|
+
{
|
|
37
|
+
uint8_t ipad[PSA_HMAC_MAX_HASH_BLOCK_SIZE];
|
|
38
|
+
size_t i;
|
|
39
|
+
size_t hash_size = PSA_HASH_LENGTH(hash_alg);
|
|
40
|
+
size_t block_size = PSA_HASH_BLOCK_LENGTH(hash_alg);
|
|
41
|
+
psa_status_t status;
|
|
42
|
+
|
|
43
|
+
hmac->alg = hash_alg;
|
|
44
|
+
|
|
45
|
+
/* Sanity checks on block_size, to guarantee that there won't be a buffer
|
|
46
|
+
* overflow below. This should never trigger if the hash algorithm
|
|
47
|
+
* is implemented correctly. */
|
|
48
|
+
/* The size checks against the ipad and opad buffers cannot be written
|
|
49
|
+
* `block_size > sizeof( ipad ) || block_size > sizeof( hmac->opad )`
|
|
50
|
+
* because that triggers -Wlogical-op on GCC 7.3. */
|
|
51
|
+
if (block_size > sizeof(ipad)) {
|
|
52
|
+
return PSA_ERROR_NOT_SUPPORTED;
|
|
53
|
+
}
|
|
54
|
+
if (block_size > sizeof(hmac->opad)) {
|
|
55
|
+
return PSA_ERROR_NOT_SUPPORTED;
|
|
56
|
+
}
|
|
57
|
+
if (block_size < hash_size) {
|
|
58
|
+
return PSA_ERROR_NOT_SUPPORTED;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (key_length > block_size) {
|
|
62
|
+
status = psa_hash_compute(hash_alg, key, key_length,
|
|
63
|
+
ipad, sizeof(ipad), &key_length);
|
|
64
|
+
if (status != PSA_SUCCESS) {
|
|
65
|
+
goto cleanup;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/* A 0-length key is not commonly used in HMAC when used as a MAC,
|
|
69
|
+
* but it is permitted. It is common when HMAC is used in HKDF, for
|
|
70
|
+
* example. Don't call `memcpy` in the 0-length because `key` could be
|
|
71
|
+
* an invalid pointer which would make the behavior undefined. */
|
|
72
|
+
else if (key_length != 0) {
|
|
73
|
+
memcpy(ipad, key, key_length);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ipad contains the key followed by garbage. Xor and fill with 0x36
|
|
77
|
+
* to create the ipad value. */
|
|
78
|
+
for (i = 0; i < key_length; i++) {
|
|
79
|
+
ipad[i] ^= 0x36;
|
|
80
|
+
}
|
|
81
|
+
memset(ipad + key_length, 0x36, block_size - key_length);
|
|
82
|
+
|
|
83
|
+
/* Copy the key material from ipad to opad, flipping the requisite bits,
|
|
84
|
+
* and filling the rest of opad with the requisite constant. */
|
|
85
|
+
for (i = 0; i < key_length; i++) {
|
|
86
|
+
hmac->opad[i] = ipad[i] ^ 0x36 ^ 0x5C;
|
|
87
|
+
}
|
|
88
|
+
memset(hmac->opad + key_length, 0x5C, block_size - key_length);
|
|
89
|
+
|
|
90
|
+
status = psa_hash_setup(&hmac->hash_ctx, hash_alg);
|
|
91
|
+
if (status != PSA_SUCCESS) {
|
|
92
|
+
goto cleanup;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
status = psa_hash_update(&hmac->hash_ctx, ipad, block_size);
|
|
96
|
+
|
|
97
|
+
cleanup:
|
|
98
|
+
mbedtls_platform_zeroize(ipad, sizeof(ipad));
|
|
99
|
+
|
|
100
|
+
return status;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static psa_status_t psa_hmac_update_internal(
|
|
104
|
+
mbedtls_psa_hmac_operation_t *hmac,
|
|
105
|
+
const uint8_t *data,
|
|
106
|
+
size_t data_length)
|
|
107
|
+
{
|
|
108
|
+
return psa_hash_update(&hmac->hash_ctx, data, data_length);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static psa_status_t psa_hmac_finish_internal(
|
|
112
|
+
mbedtls_psa_hmac_operation_t *hmac,
|
|
113
|
+
uint8_t *mac,
|
|
114
|
+
size_t mac_size)
|
|
115
|
+
{
|
|
116
|
+
uint8_t tmp[PSA_HASH_MAX_SIZE];
|
|
117
|
+
psa_algorithm_t hash_alg = hmac->alg;
|
|
118
|
+
size_t hash_size = 0;
|
|
119
|
+
size_t block_size = PSA_HASH_BLOCK_LENGTH(hash_alg);
|
|
120
|
+
psa_status_t status;
|
|
121
|
+
|
|
122
|
+
status = psa_hash_finish(&hmac->hash_ctx, tmp, sizeof(tmp), &hash_size);
|
|
123
|
+
if (status != PSA_SUCCESS) {
|
|
124
|
+
return status;
|
|
125
|
+
}
|
|
126
|
+
/* From here on, tmp needs to be wiped. */
|
|
127
|
+
|
|
128
|
+
status = psa_hash_setup(&hmac->hash_ctx, hash_alg);
|
|
129
|
+
if (status != PSA_SUCCESS) {
|
|
130
|
+
goto exit;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
status = psa_hash_update(&hmac->hash_ctx, hmac->opad, block_size);
|
|
134
|
+
if (status != PSA_SUCCESS) {
|
|
135
|
+
goto exit;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
status = psa_hash_update(&hmac->hash_ctx, tmp, hash_size);
|
|
139
|
+
if (status != PSA_SUCCESS) {
|
|
140
|
+
goto exit;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
status = psa_hash_finish(&hmac->hash_ctx, tmp, sizeof(tmp), &hash_size);
|
|
144
|
+
if (status != PSA_SUCCESS) {
|
|
145
|
+
goto exit;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
memcpy(mac, tmp, mac_size);
|
|
149
|
+
|
|
150
|
+
exit:
|
|
151
|
+
mbedtls_platform_zeroize(tmp, hash_size);
|
|
152
|
+
return status;
|
|
153
|
+
}
|
|
154
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
|
|
155
|
+
|
|
156
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
157
|
+
static psa_status_t cmac_setup(mbedtls_psa_mac_operation_t *operation,
|
|
158
|
+
const psa_key_attributes_t *attributes,
|
|
159
|
+
const uint8_t *key_buffer)
|
|
160
|
+
{
|
|
161
|
+
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
|
162
|
+
|
|
163
|
+
const mbedtls_cipher_info_t *cipher_info =
|
|
164
|
+
mbedtls_cipher_info_from_psa(
|
|
165
|
+
PSA_ALG_CMAC,
|
|
166
|
+
psa_get_key_type(attributes),
|
|
167
|
+
psa_get_key_bits(attributes),
|
|
168
|
+
NULL);
|
|
169
|
+
|
|
170
|
+
if (cipher_info == NULL) {
|
|
171
|
+
return PSA_ERROR_NOT_SUPPORTED;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
ret = mbedtls_cipher_setup(&operation->ctx.cmac, cipher_info);
|
|
175
|
+
if (ret != 0) {
|
|
176
|
+
goto exit;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
ret = mbedtls_cipher_cmac_starts(&operation->ctx.cmac,
|
|
180
|
+
key_buffer,
|
|
181
|
+
psa_get_key_bits(attributes));
|
|
182
|
+
exit:
|
|
183
|
+
return mbedtls_to_psa_error(ret);
|
|
184
|
+
}
|
|
185
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
186
|
+
|
|
187
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC) || \
|
|
188
|
+
defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
189
|
+
|
|
190
|
+
/* Initialize this driver's MAC operation structure. Once this function has been
|
|
191
|
+
* called, mbedtls_psa_mac_abort can run and will do the right thing. */
|
|
192
|
+
static psa_status_t mac_init(
|
|
193
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
194
|
+
psa_algorithm_t alg)
|
|
195
|
+
{
|
|
196
|
+
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
|
197
|
+
|
|
198
|
+
operation->alg = alg;
|
|
199
|
+
|
|
200
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
201
|
+
if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) {
|
|
202
|
+
mbedtls_cipher_init(&operation->ctx.cmac);
|
|
203
|
+
status = PSA_SUCCESS;
|
|
204
|
+
} else
|
|
205
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
206
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
|
|
207
|
+
if (PSA_ALG_IS_HMAC(operation->alg)) {
|
|
208
|
+
/* We'll set up the hash operation later in psa_hmac_setup_internal. */
|
|
209
|
+
operation->ctx.hmac.alg = 0;
|
|
210
|
+
status = PSA_SUCCESS;
|
|
211
|
+
} else
|
|
212
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
|
|
213
|
+
{
|
|
214
|
+
(void) operation;
|
|
215
|
+
status = PSA_ERROR_NOT_SUPPORTED;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (status != PSA_SUCCESS) {
|
|
219
|
+
memset(operation, 0, sizeof(*operation));
|
|
220
|
+
}
|
|
221
|
+
return status;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
psa_status_t mbedtls_psa_mac_abort(mbedtls_psa_mac_operation_t *operation)
|
|
225
|
+
{
|
|
226
|
+
if (operation->alg == 0) {
|
|
227
|
+
/* The object has (apparently) been initialized but it is not
|
|
228
|
+
* in use. It's ok to call abort on such an object, and there's
|
|
229
|
+
* nothing to do. */
|
|
230
|
+
return PSA_SUCCESS;
|
|
231
|
+
} else
|
|
232
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
233
|
+
if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) {
|
|
234
|
+
mbedtls_cipher_free(&operation->ctx.cmac);
|
|
235
|
+
} else
|
|
236
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
237
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
|
|
238
|
+
if (PSA_ALG_IS_HMAC(operation->alg)) {
|
|
239
|
+
psa_hmac_abort_internal(&operation->ctx.hmac);
|
|
240
|
+
} else
|
|
241
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
|
|
242
|
+
{
|
|
243
|
+
/* Sanity check (shouldn't happen: operation->alg should
|
|
244
|
+
* always have been initialized to a valid value). */
|
|
245
|
+
goto bad_state;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
operation->alg = 0;
|
|
249
|
+
|
|
250
|
+
return PSA_SUCCESS;
|
|
251
|
+
|
|
252
|
+
bad_state:
|
|
253
|
+
/* If abort is called on an uninitialized object, we can't trust
|
|
254
|
+
* anything. Wipe the object in case it contains confidential data.
|
|
255
|
+
* This may result in a memory leak if a pointer gets overwritten,
|
|
256
|
+
* but it's too late to do anything about this. */
|
|
257
|
+
memset(operation, 0, sizeof(*operation));
|
|
258
|
+
return PSA_ERROR_BAD_STATE;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
static psa_status_t psa_mac_setup(mbedtls_psa_mac_operation_t *operation,
|
|
262
|
+
const psa_key_attributes_t *attributes,
|
|
263
|
+
const uint8_t *key_buffer,
|
|
264
|
+
size_t key_buffer_size,
|
|
265
|
+
psa_algorithm_t alg)
|
|
266
|
+
{
|
|
267
|
+
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
|
268
|
+
|
|
269
|
+
/* A context must be freshly initialized before it can be set up. */
|
|
270
|
+
if (operation->alg != 0) {
|
|
271
|
+
return PSA_ERROR_BAD_STATE;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
status = mac_init(operation, alg);
|
|
275
|
+
if (status != PSA_SUCCESS) {
|
|
276
|
+
return status;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
280
|
+
if (PSA_ALG_FULL_LENGTH_MAC(alg) == PSA_ALG_CMAC) {
|
|
281
|
+
/* Key buffer size for CMAC is dictated by the key bits set on the
|
|
282
|
+
* attributes, and previously validated by the core on key import. */
|
|
283
|
+
(void) key_buffer_size;
|
|
284
|
+
status = cmac_setup(operation, attributes, key_buffer);
|
|
285
|
+
} else
|
|
286
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
287
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
|
|
288
|
+
if (PSA_ALG_IS_HMAC(alg)) {
|
|
289
|
+
status = psa_hmac_setup_internal(&operation->ctx.hmac,
|
|
290
|
+
key_buffer,
|
|
291
|
+
key_buffer_size,
|
|
292
|
+
PSA_ALG_HMAC_GET_HASH(alg));
|
|
293
|
+
} else
|
|
294
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
|
|
295
|
+
{
|
|
296
|
+
(void) attributes;
|
|
297
|
+
(void) key_buffer;
|
|
298
|
+
(void) key_buffer_size;
|
|
299
|
+
status = PSA_ERROR_NOT_SUPPORTED;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (status != PSA_SUCCESS) {
|
|
303
|
+
mbedtls_psa_mac_abort(operation);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return status;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
psa_status_t mbedtls_psa_mac_sign_setup(
|
|
310
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
311
|
+
const psa_key_attributes_t *attributes,
|
|
312
|
+
const uint8_t *key_buffer,
|
|
313
|
+
size_t key_buffer_size,
|
|
314
|
+
psa_algorithm_t alg)
|
|
315
|
+
{
|
|
316
|
+
return psa_mac_setup(operation, attributes,
|
|
317
|
+
key_buffer, key_buffer_size, alg);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
psa_status_t mbedtls_psa_mac_verify_setup(
|
|
321
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
322
|
+
const psa_key_attributes_t *attributes,
|
|
323
|
+
const uint8_t *key_buffer,
|
|
324
|
+
size_t key_buffer_size,
|
|
325
|
+
psa_algorithm_t alg)
|
|
326
|
+
{
|
|
327
|
+
return psa_mac_setup(operation, attributes,
|
|
328
|
+
key_buffer, key_buffer_size, alg);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
psa_status_t mbedtls_psa_mac_update(
|
|
332
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
333
|
+
const uint8_t *input,
|
|
334
|
+
size_t input_length)
|
|
335
|
+
{
|
|
336
|
+
if (operation->alg == 0) {
|
|
337
|
+
return PSA_ERROR_BAD_STATE;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
341
|
+
if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) {
|
|
342
|
+
return mbedtls_to_psa_error(
|
|
343
|
+
mbedtls_cipher_cmac_update(&operation->ctx.cmac,
|
|
344
|
+
input, input_length));
|
|
345
|
+
} else
|
|
346
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
347
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
|
|
348
|
+
if (PSA_ALG_IS_HMAC(operation->alg)) {
|
|
349
|
+
return psa_hmac_update_internal(&operation->ctx.hmac,
|
|
350
|
+
input, input_length);
|
|
351
|
+
} else
|
|
352
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
|
|
353
|
+
{
|
|
354
|
+
/* This shouldn't happen if `operation` was initialized by
|
|
355
|
+
* a setup function. */
|
|
356
|
+
(void) input;
|
|
357
|
+
(void) input_length;
|
|
358
|
+
return PSA_ERROR_BAD_STATE;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
static psa_status_t psa_mac_finish_internal(
|
|
363
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
364
|
+
uint8_t *mac, size_t mac_size)
|
|
365
|
+
{
|
|
366
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC)
|
|
367
|
+
if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) {
|
|
368
|
+
uint8_t tmp[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE];
|
|
369
|
+
int ret = mbedtls_cipher_cmac_finish(&operation->ctx.cmac, tmp);
|
|
370
|
+
if (ret == 0) {
|
|
371
|
+
memcpy(mac, tmp, mac_size);
|
|
372
|
+
}
|
|
373
|
+
mbedtls_platform_zeroize(tmp, sizeof(tmp));
|
|
374
|
+
return mbedtls_to_psa_error(ret);
|
|
375
|
+
} else
|
|
376
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
377
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
|
|
378
|
+
if (PSA_ALG_IS_HMAC(operation->alg)) {
|
|
379
|
+
return psa_hmac_finish_internal(&operation->ctx.hmac,
|
|
380
|
+
mac, mac_size);
|
|
381
|
+
} else
|
|
382
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
|
|
383
|
+
{
|
|
384
|
+
/* This shouldn't happen if `operation` was initialized by
|
|
385
|
+
* a setup function. */
|
|
386
|
+
(void) operation;
|
|
387
|
+
(void) mac;
|
|
388
|
+
(void) mac_size;
|
|
389
|
+
return PSA_ERROR_BAD_STATE;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
psa_status_t mbedtls_psa_mac_sign_finish(
|
|
394
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
395
|
+
uint8_t *mac,
|
|
396
|
+
size_t mac_size,
|
|
397
|
+
size_t *mac_length)
|
|
398
|
+
{
|
|
399
|
+
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
|
400
|
+
|
|
401
|
+
if (operation->alg == 0) {
|
|
402
|
+
return PSA_ERROR_BAD_STATE;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
status = psa_mac_finish_internal(operation, mac, mac_size);
|
|
406
|
+
if (status == PSA_SUCCESS) {
|
|
407
|
+
*mac_length = mac_size;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return status;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
psa_status_t mbedtls_psa_mac_verify_finish(
|
|
414
|
+
mbedtls_psa_mac_operation_t *operation,
|
|
415
|
+
const uint8_t *mac,
|
|
416
|
+
size_t mac_length)
|
|
417
|
+
{
|
|
418
|
+
uint8_t actual_mac[PSA_MAC_MAX_SIZE];
|
|
419
|
+
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
|
420
|
+
|
|
421
|
+
if (operation->alg == 0) {
|
|
422
|
+
return PSA_ERROR_BAD_STATE;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/* Consistency check: requested MAC length fits our local buffer */
|
|
426
|
+
if (mac_length > sizeof(actual_mac)) {
|
|
427
|
+
return PSA_ERROR_INVALID_ARGUMENT;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
status = psa_mac_finish_internal(operation, actual_mac, mac_length);
|
|
431
|
+
if (status != PSA_SUCCESS) {
|
|
432
|
+
goto cleanup;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (mbedtls_ct_memcmp(mac, actual_mac, mac_length) != 0) {
|
|
436
|
+
status = PSA_ERROR_INVALID_SIGNATURE;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
cleanup:
|
|
440
|
+
mbedtls_platform_zeroize(actual_mac, sizeof(actual_mac));
|
|
441
|
+
|
|
442
|
+
return status;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
psa_status_t mbedtls_psa_mac_compute(
|
|
446
|
+
const psa_key_attributes_t *attributes,
|
|
447
|
+
const uint8_t *key_buffer,
|
|
448
|
+
size_t key_buffer_size,
|
|
449
|
+
psa_algorithm_t alg,
|
|
450
|
+
const uint8_t *input,
|
|
451
|
+
size_t input_length,
|
|
452
|
+
uint8_t *mac,
|
|
453
|
+
size_t mac_size,
|
|
454
|
+
size_t *mac_length)
|
|
455
|
+
{
|
|
456
|
+
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
|
457
|
+
mbedtls_psa_mac_operation_t operation = MBEDTLS_PSA_MAC_OPERATION_INIT;
|
|
458
|
+
/* Make sure the whole operation is zeroed.
|
|
459
|
+
* PSA_MAC_OPERATION_INIT does not necessarily do it fully,
|
|
460
|
+
* since one field is a union and initializing a union does not
|
|
461
|
+
* necessarily initialize all of its members.
|
|
462
|
+
* In multipart operations, this is done in the API functions,
|
|
463
|
+
* before driver dispatch, since it needs to be done before calling
|
|
464
|
+
* the driver entry point. Here, we bypass the multipart API,
|
|
465
|
+
* so it's our job. */
|
|
466
|
+
memset(&operation, 0, sizeof(operation));
|
|
467
|
+
|
|
468
|
+
status = psa_mac_setup(&operation,
|
|
469
|
+
attributes, key_buffer, key_buffer_size,
|
|
470
|
+
alg);
|
|
471
|
+
if (status != PSA_SUCCESS) {
|
|
472
|
+
goto exit;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (input_length > 0) {
|
|
476
|
+
status = mbedtls_psa_mac_update(&operation, input, input_length);
|
|
477
|
+
if (status != PSA_SUCCESS) {
|
|
478
|
+
goto exit;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
status = psa_mac_finish_internal(&operation, mac, mac_size);
|
|
483
|
+
if (status == PSA_SUCCESS) {
|
|
484
|
+
*mac_length = mac_size;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
exit:
|
|
488
|
+
mbedtls_psa_mac_abort(&operation);
|
|
489
|
+
|
|
490
|
+
return status;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC || MBEDTLS_PSA_BUILTIN_ALG_CMAC */
|
|
494
|
+
|
|
495
|
+
#endif /* MBEDTLS_PSA_CRYPTO_C */
|