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,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ECDH with curve-optimized implementation multiplexing
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016-2018 INRIA and Microsoft Corporation
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
* not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
* This file is part of Mbed TLS (https://tls.mbed.org)
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#include "tf_psa_crypto_common.h"
|
|
23
|
+
#include "mbedtls/private_access.h"
|
|
24
|
+
|
|
25
|
+
#if defined(MBEDTLS_PSA_BUILTIN_ALG_ECDH) && defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
|
|
26
|
+
|
|
27
|
+
#if !(defined(__SIZEOF_INT128__) && (__SIZEOF_INT128__ == 16))
|
|
28
|
+
#define KRML_VERIFIED_UINT128
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#include <Hacl_Curve25519.h>
|
|
32
|
+
#include <mbedtls/platform_util.h>
|
|
33
|
+
|
|
34
|
+
#include "x25519.h"
|
|
35
|
+
|
|
36
|
+
void mbedtls_x25519_scalarmult(uint8_t out[MBEDTLS_X25519_KEY_SIZE_BYTES],
|
|
37
|
+
const uint8_t scalar[MBEDTLS_X25519_KEY_SIZE_BYTES],
|
|
38
|
+
const uint8_t point[MBEDTLS_X25519_KEY_SIZE_BYTES])
|
|
39
|
+
{
|
|
40
|
+
uint8_t cp_scalar[MBEDTLS_X25519_KEY_SIZE_BYTES];
|
|
41
|
+
uint8_t cp_point[MBEDTLS_X25519_KEY_SIZE_BYTES];
|
|
42
|
+
|
|
43
|
+
memcpy(cp_scalar, scalar, sizeof(cp_scalar));
|
|
44
|
+
memcpy(cp_point, point, sizeof(cp_point));
|
|
45
|
+
|
|
46
|
+
Hacl_Curve25519_crypto_scalarmult(out, cp_scalar, cp_point);
|
|
47
|
+
|
|
48
|
+
mbedtls_platform_zeroize(cp_scalar, sizeof(cp_scalar));
|
|
49
|
+
mbedtls_platform_zeroize(cp_point, sizeof(cp_point));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
#endif /* MBEDTLS_PSA_BUILTIN_ALG_ECDH && MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
set(p256-m_target "${TF_PSA_CRYPTO_TARGET_PREFIX}p256-m")
|
|
2
|
+
if (USE_STATIC_TF_PSA_CRYPTO_LIBRARY)
|
|
3
|
+
set(p256-m_static_target ${p256-m_target})
|
|
4
|
+
endif()
|
|
5
|
+
set(target_libraries ${p256-m_target})
|
|
6
|
+
if(USE_STATIC_TF_PSA_CRYPTO_LIBRARY AND USE_SHARED_TF_PSA_CRYPTO_LIBRARY)
|
|
7
|
+
string(APPEND p256-m_static_target "_static")
|
|
8
|
+
list(APPEND target_libraries ${p256-m_static_target})
|
|
9
|
+
endif()
|
|
10
|
+
|
|
11
|
+
foreach (target IN LISTS target_libraries)
|
|
12
|
+
add_library(${target} OBJECT
|
|
13
|
+
p256-m_driver_entrypoints.c
|
|
14
|
+
p256-m/p256-m.c)
|
|
15
|
+
|
|
16
|
+
tf_psa_crypto_set_base_compile_options(${target})
|
|
17
|
+
|
|
18
|
+
target_include_directories(${target}
|
|
19
|
+
PUBLIC p256-m
|
|
20
|
+
# Add the build-tree include directory before the source-tree one
|
|
21
|
+
# so that generated headers in the build tree take precedence.
|
|
22
|
+
PRIVATE ${PROJECT_BINARY_DIR}/include
|
|
23
|
+
${PROJECT_SOURCE_DIR}/include
|
|
24
|
+
${PROJECT_SOURCE_DIR}/core
|
|
25
|
+
${PROJECT_SOURCE_DIR}/dispatch
|
|
26
|
+
${TF_PSA_CRYPTO_DRIVERS_INCLUDE_DIRS}
|
|
27
|
+
)
|
|
28
|
+
tf_psa_crypto_set_config_files_compile_definitions(${target})
|
|
29
|
+
if(TF_PSA_CRYPTO_TEST_DRIVER)
|
|
30
|
+
add_dependencies(${target} ${TF_PSA_CRYPTO_TEST_DRIVER_GENERATION_TARGETS})
|
|
31
|
+
endif()
|
|
32
|
+
endforeach(target)
|
|
33
|
+
|
|
34
|
+
if(USE_SHARED_TF_PSA_CRYPTO_LIBRARY)
|
|
35
|
+
set_property(TARGET ${p256-m_target} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
36
|
+
endif(USE_SHARED_TF_PSA_CRYPTO_LIBRARY)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
THIRDPARTY_INCLUDES+=-I$(THIRDPARTY_DIR)/p256-m/p256-m/include -I$(THIRDPARTY_DIR)/p256-m/p256-m/include/p256-m -I$(THIRDPARTY_DIR)/p256-m/p256-m_driver_interface
|
|
2
|
+
|
|
3
|
+
THIRDPARTY_CRYPTO_OBJECTS+= \
|
|
4
|
+
$(THIRDPARTY_DIR)/p256-m//p256-m_driver_entrypoints.o \
|
|
5
|
+
$(THIRDPARTY_DIR)/p256-m//p256-m/p256-m.o
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
The files within the `p256-m/` subdirectory originate from the [p256-m GitHub repository](https://github.com/mpg/p256-m). They are distributed here under a dual Apache-2.0 OR GPL-2.0-or-later license. They are authored by Manuel Pégourié-Gonnard. p256-m is a minimalistic implementation of ECDH and ECDSA on NIST P-256, especially suited to constrained 32-bit environments. Mbed TLS documentation for integrating drivers uses p256-m as an example of a software accelerator, and describes how it can be integrated alongside Mbed TLS. It should be noted that p256-m files in the Mbed TLS repo will not be updated regularly, so they may not have fixes and improvements present in the upstream project.
|
|
2
|
+
|
|
3
|
+
The files `p256-m.c`, `p256-m.h` and `README.md` have been taken from the `p256-m` repository.
|
|
4
|
+
It should be noted that p256-m deliberately does not supply its own cryptographically secure RNG function. As a result, the PSA RNG is used, with `p256_generate_random()` wrapping `psa_generate_random()`.
|
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
*This is the original README for the p256-m repository. Please note that as
|
|
2
|
+
only a subset of p256-m's files are present in Mbed TLS, this README may refer
|
|
3
|
+
to files that are not present/relevant here.*
|
|
4
|
+
|
|
5
|
+
p256-m is a minimalistic implementation of ECDH and ECDSA on NIST P-256,
|
|
6
|
+
especially suited to constrained 32-bit environments. It's written in standard
|
|
7
|
+
C, with optional bits of assembly for Arm Cortex-M and Cortex-A CPUs.
|
|
8
|
+
|
|
9
|
+
Its design is guided by the following goals in this order:
|
|
10
|
+
|
|
11
|
+
1. correctness & security;
|
|
12
|
+
2. low code size & RAM usage;
|
|
13
|
+
3. runtime performance.
|
|
14
|
+
|
|
15
|
+
Most cryptographic implementations care more about speed than footprint, and
|
|
16
|
+
some might even risk weakening security for more speed. p256-m was written
|
|
17
|
+
because I wanted to see what happened when reversing the usual emphasis.
|
|
18
|
+
|
|
19
|
+
The result is a full implementation of ECDH and ECDSA in **less than 3KiB of
|
|
20
|
+
code**, using **less than 768 bytes of RAM**, with comparable performance
|
|
21
|
+
to existing implementations (see below) - in less than 700 LOC.
|
|
22
|
+
|
|
23
|
+
_Contents of this Readme:_
|
|
24
|
+
|
|
25
|
+
- [Correctness](#correctness)
|
|
26
|
+
- [Security](#security)
|
|
27
|
+
- [Code size](#code-size)
|
|
28
|
+
- [RAM usage](#ram-usage)
|
|
29
|
+
- [Runtime performance](#runtime-performance)
|
|
30
|
+
- [Comparison with other implementations](#comparison-with-other-implementations)
|
|
31
|
+
- [Design overview](#design-overview)
|
|
32
|
+
- [Notes about other curves](#notes-about-other-curves)
|
|
33
|
+
- [Notes about other platforms](#notes-about-other-platforms)
|
|
34
|
+
|
|
35
|
+
## Correctness
|
|
36
|
+
|
|
37
|
+
**API design:**
|
|
38
|
+
|
|
39
|
+
- The API is minimal: only 4 public functions.
|
|
40
|
+
- Each public function fully validates its inputs and returns specific errors.
|
|
41
|
+
- The API uses arrays of octets for all input and output.
|
|
42
|
+
|
|
43
|
+
**Testing:**
|
|
44
|
+
|
|
45
|
+
- p256-m is validated against multiple test vectors from various RFCs and
|
|
46
|
+
NIST.
|
|
47
|
+
- In addition, crafted inputs are used for negative testing and to reach
|
|
48
|
+
corner cases.
|
|
49
|
+
- Two test suites are provided: one for closed-box testing (using only the
|
|
50
|
+
public API), one for open-box testing (for unit-testing internal functions,
|
|
51
|
+
and reaching more error cases by exploiting knowledge of how the RNG is used).
|
|
52
|
+
- The resulting branch coverage is maximal: closed-box testing reaches all
|
|
53
|
+
branches except four; three of them are reached by open-box testing using a
|
|
54
|
+
rigged RNG; the last branch could only be reached by computing a discrete log
|
|
55
|
+
on P-256... See `coverage.sh`.
|
|
56
|
+
- Testing also uses dynamic analysis: valgrind, ASan, MemSan, UBSan.
|
|
57
|
+
|
|
58
|
+
**Code quality:**
|
|
59
|
+
|
|
60
|
+
- The code is standard C99; it builds without warnings with `clang
|
|
61
|
+
-Weverything` and `gcc -Wall -Wextra -pedantic`.
|
|
62
|
+
- The code is small and well documented, including internal APIs: with the
|
|
63
|
+
header file, it's less than 700 lines of code, and more lines of comments
|
|
64
|
+
than of code.
|
|
65
|
+
- However it _has not been reviewed_ independently so far, as this is a
|
|
66
|
+
personal project.
|
|
67
|
+
|
|
68
|
+
**Short Weierstrass pitfalls:**
|
|
69
|
+
|
|
70
|
+
Its has been [pointed out](https://safecurves.cr.yp.to/) that the NIST curves,
|
|
71
|
+
and indeed all Short Weierstrass curves, have a number of pitfalls including
|
|
72
|
+
risk for the implementation to:
|
|
73
|
+
|
|
74
|
+
- "produce incorrect results for some rare curve points" - this is avoided by
|
|
75
|
+
carefully checking the validity domain of formulas used throughout the code;
|
|
76
|
+
- "leak secret data when the input isn't a curve point" - this is avoided by
|
|
77
|
+
validating that points lie on the curve every time a point is deserialized.
|
|
78
|
+
|
|
79
|
+
## Security
|
|
80
|
+
|
|
81
|
+
In addition to the above correctness claims, p256-m has the following
|
|
82
|
+
properties:
|
|
83
|
+
|
|
84
|
+
- it has no branch depending (even indirectly) on secret data;
|
|
85
|
+
- it has no memory access depending (even indirectly) on secret data.
|
|
86
|
+
|
|
87
|
+
These properties are checked using valgrind and MemSan with the ideas
|
|
88
|
+
behind [ctgrind](https://github.com/agl/ctgrind), see `consttime.sh`.
|
|
89
|
+
|
|
90
|
+
In addition to avoiding branches and memory accesses depending on secret data,
|
|
91
|
+
p256-m also avoid instructions (or library functions) whose execution time
|
|
92
|
+
depends on the value of operands on cores of interest. Namely, it never uses
|
|
93
|
+
integer division, and for multiplication by default it only uses 16x16->32 bit
|
|
94
|
+
unsigned multiplication. On cores which have a constant-time 32x32->64 bit
|
|
95
|
+
unsigned multiplication instruction, the symbol `MUL64_IS_CONSTANT_TIME` can
|
|
96
|
+
be defined by the user at compile-time to take advantage of it in order to
|
|
97
|
+
improve performance and code size. (On Cortex-M and Cortex-A cores wtih GCC or
|
|
98
|
+
Clang this is not necessary, since inline assembly is used instead.)
|
|
99
|
+
|
|
100
|
+
As a result, p256-m should be secure against the following classes of attackers:
|
|
101
|
+
|
|
102
|
+
1. attackers who can only manipulate the input and observe the output;
|
|
103
|
+
2. attackers who can also measure the total computation time of the operation;
|
|
104
|
+
3. attackers who can also observe and manipulate micro-architectural features
|
|
105
|
+
such as the cache or branch predictor with arbitrary precision.
|
|
106
|
+
|
|
107
|
+
However, p256-m makes no attempt to protect against:
|
|
108
|
+
|
|
109
|
+
4. passive physical attackers who can record traces of physical emissions
|
|
110
|
+
(power, EM, sound) of the CPU while it manipulates secrets;
|
|
111
|
+
5. active physical attackers who can also inject faults in the computation.
|
|
112
|
+
|
|
113
|
+
(Note: p256-m should actually be secure against SPA, by virtue of being fully
|
|
114
|
+
constant-flow, but is not expected to resist any other physical attack.)
|
|
115
|
+
|
|
116
|
+
**Warning:** p256-m requires an externally-provided RNG function. If that
|
|
117
|
+
function is not cryptographically secure, then neither is p256-m's key
|
|
118
|
+
generation or ECDSA signature generation.
|
|
119
|
+
|
|
120
|
+
_Note:_ p256-m also follows best practices such as securely erasing secret
|
|
121
|
+
data on the stack before returning.
|
|
122
|
+
|
|
123
|
+
## Code size
|
|
124
|
+
|
|
125
|
+
Compiled with
|
|
126
|
+
[ARM-GCC 9](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads),
|
|
127
|
+
with `-mthumb -Os`, here are samples of code sizes reached on selected cores:
|
|
128
|
+
|
|
129
|
+
- Cortex-M0: 2988 bytes
|
|
130
|
+
- Cortex-M4: 2900 bytes
|
|
131
|
+
- Cortex-A7: 2924 bytes
|
|
132
|
+
|
|
133
|
+
Clang was also tried but tends to generate larger code (by about 10%). For
|
|
134
|
+
details, see `sizes.sh`.
|
|
135
|
+
|
|
136
|
+
**What's included:**
|
|
137
|
+
|
|
138
|
+
- Full input validation and (de)serialisation of input/outputs to/from bytes.
|
|
139
|
+
- Cleaning up secret values from the stack before returning from a function.
|
|
140
|
+
- The code has no dependency on libc functions or the toolchain's runtime
|
|
141
|
+
library (such as helpers for long multiply); this can be checked for the
|
|
142
|
+
Arm-GCC toolchain with the `deps.sh` script.
|
|
143
|
+
|
|
144
|
+
**What's excluded:**
|
|
145
|
+
|
|
146
|
+
- A secure RNG function needs to be provided externally, see
|
|
147
|
+
`p256_generate_random()` in `p256-m.h`.
|
|
148
|
+
|
|
149
|
+
## RAM usage
|
|
150
|
+
|
|
151
|
+
p256-m doesn't use any dynamic memory (on the heap), only the stack. Here's
|
|
152
|
+
how much stack is used by each of its 4 public functions on selected cores:
|
|
153
|
+
|
|
154
|
+
| Function | Cortex-M0 | Cortex-M4 | Cortex-A7 |
|
|
155
|
+
| ------------------------- | --------: | --------: | --------: |
|
|
156
|
+
| `p256_gen_keypair` | 608 | 564 | 564 |
|
|
157
|
+
| `p256_ecdh_shared_secret` | 640 | 596 | 596 |
|
|
158
|
+
| `p256_ecdsa_sign` | 664 | 604 | 604 |
|
|
159
|
+
| `p256_ecdsa_verify` | 752 | 700 | 700 |
|
|
160
|
+
|
|
161
|
+
For details, see `stack.sh`, `wcs.py` and `libc.msu` (the above figures assume
|
|
162
|
+
that the externally-provided RNG function uses at most 384 bytes of stack).
|
|
163
|
+
|
|
164
|
+
## Runtime performance
|
|
165
|
+
|
|
166
|
+
Here are the timings of each public function in milliseconds measured on
|
|
167
|
+
platforms based on a selection of cores:
|
|
168
|
+
|
|
169
|
+
- Cortex-M0 at 48 MHz: STM32F091 board running Mbed OS 6
|
|
170
|
+
- Cortex-M4 at 100 MHz: STM32F411 board running Mbed OS 6
|
|
171
|
+
- Cortex-A7 at 900 MHz: Raspberry Pi 2B running Raspbian Buster
|
|
172
|
+
|
|
173
|
+
| Function | Cortex-M0 | Cortex-M4 | Cortex-A7 |
|
|
174
|
+
| ------------------------- | --------: | --------: | --------: |
|
|
175
|
+
| `p256_gen_keypair` | 921 | 145 | 11 |
|
|
176
|
+
| `p256_ecdh_shared_secret` | 922 | 144 | 11 |
|
|
177
|
+
| `p256_ecdsa_sign` | 990 | 155 | 12 |
|
|
178
|
+
| `p256_ecdsa_verify` | 1976 | 309 | 24 |
|
|
179
|
+
| Sum of the above | 4809 | 753 | 59 |
|
|
180
|
+
|
|
181
|
+
The sum of these operations corresponds to a TLS handshake using ECDHE-ECDSA
|
|
182
|
+
with mutual authentication based on raw public keys or directly-trusted
|
|
183
|
+
certificates (otherwise, add one 'verify' for each link in the peer's
|
|
184
|
+
certificate chain).
|
|
185
|
+
|
|
186
|
+
_Note_: the above figures where obtained by compiling with GCC, which is able
|
|
187
|
+
to use inline assembly. Without that inline assembly (22 lines for Cortex-M0,
|
|
188
|
+
1 line for Cortex-M4), the code would be roughly 2 times slower on those
|
|
189
|
+
platforms. (The effect is much less important on the Cortex-A7 core.)
|
|
190
|
+
|
|
191
|
+
For details, see `bench.sh`, `benchmark.c` and `on-target-benchmark/`.
|
|
192
|
+
|
|
193
|
+
## Comparison with other implementations
|
|
194
|
+
|
|
195
|
+
The most relevant/convenient implementation for comparisons is
|
|
196
|
+
[TinyCrypt](https://github.com/intel/tinycrypt), as it's also a standalone
|
|
197
|
+
implementation of ECDH and ECDSA on P-256 only, that also targets constrained
|
|
198
|
+
devices. Other implementations tend to implement many curves and build on a
|
|
199
|
+
shared bignum/MPI module (possibly also supporting RSA), which makes fair
|
|
200
|
+
comparisons less convenient.
|
|
201
|
+
|
|
202
|
+
The scripts used for TinyCrypt measurements are available in [this
|
|
203
|
+
branch](https://github.com/mpg/tinycrypt/tree/measurements), based on version
|
|
204
|
+
0.2.8.
|
|
205
|
+
|
|
206
|
+
**Code size**
|
|
207
|
+
|
|
208
|
+
| Core | p256-m | TinyCrypt |
|
|
209
|
+
| --------- | -----: | --------: |
|
|
210
|
+
| Cortex-M0 | 2988 | 6134 |
|
|
211
|
+
| Cortex-M4 | 2900 | 5934 |
|
|
212
|
+
| Cortex-A7 | 2924 | 5934 |
|
|
213
|
+
|
|
214
|
+
**RAM usage**
|
|
215
|
+
|
|
216
|
+
TinyCrypto also uses no heap, only the stack. Here's the RAM used by each
|
|
217
|
+
operation on a Cortex-M0 core:
|
|
218
|
+
|
|
219
|
+
| operation | p256-m | TinyCrypt |
|
|
220
|
+
| ------------------ | -----: | --------: |
|
|
221
|
+
| key generation | 608 | 824 |
|
|
222
|
+
| ECDH shared secret | 640 | 728 |
|
|
223
|
+
| ECDSA sign | 664 | 880 |
|
|
224
|
+
| ECDSA verify | 752 | 824 |
|
|
225
|
+
|
|
226
|
+
On a Cortex-M4 or Cortex-A7 core (identical numbers):
|
|
227
|
+
|
|
228
|
+
| operation | p256-m | TinyCrypt |
|
|
229
|
+
| ------------------ | -----: | --------: |
|
|
230
|
+
| key generation | 564 | 796 |
|
|
231
|
+
| ECDH shared secret | 596 | 700 |
|
|
232
|
+
| ECDSA sign | 604 | 844 |
|
|
233
|
+
| ECDSA verify | 700 | 808 |
|
|
234
|
+
|
|
235
|
+
**Runtime performance**
|
|
236
|
+
|
|
237
|
+
Here are the timings of each operation in milliseconds measured on
|
|
238
|
+
platforms based on a selection of cores:
|
|
239
|
+
|
|
240
|
+
_Cortex-M0_ at 48 MHz: STM32F091 board running Mbed OS 6
|
|
241
|
+
|
|
242
|
+
| Operation | p256-m | TinyCrypt |
|
|
243
|
+
| ------------------ | -----: | --------: |
|
|
244
|
+
| Key generation | 921 | 979 |
|
|
245
|
+
| ECDH shared secret | 922 | 975 |
|
|
246
|
+
| ECDSA sign | 990 | 1009 |
|
|
247
|
+
| ECDSA verify | 1976 | 1130 |
|
|
248
|
+
| Sum of those 4 | 4809 | 4093 |
|
|
249
|
+
|
|
250
|
+
_Cortex-M4_ at 100 MHz: STM32F411 board running Mbed OS 6
|
|
251
|
+
|
|
252
|
+
| Operation | p256-m | TinyCrypt |
|
|
253
|
+
| ------------------ | -----: | --------: |
|
|
254
|
+
| Key generation | 145 | 178 |
|
|
255
|
+
| ECDH shared secret | 144 | 177 |
|
|
256
|
+
| ECDSA sign | 155 | 188 |
|
|
257
|
+
| ECDSA verify | 309 | 210 |
|
|
258
|
+
| Sum of those 4 | 753 | 753 |
|
|
259
|
+
|
|
260
|
+
_Cortex-A7_ at 900 MHz: Raspberry Pi 2B running Raspbian Buster
|
|
261
|
+
|
|
262
|
+
| Operation | p256-m | TinyCrypt |
|
|
263
|
+
| ------------------ | -----: | --------: |
|
|
264
|
+
| Key generation | 11 | 13 |
|
|
265
|
+
| ECDH shared secret | 11 | 13 |
|
|
266
|
+
| ECDSA sign | 12 | 14 |
|
|
267
|
+
| ECDSA verify | 24 | 15 |
|
|
268
|
+
| Sum of those 4 | 59 | 55 |
|
|
269
|
+
|
|
270
|
+
_64-bit Intel_ (i7-6500U at 2.50GHz) laptop running Ubuntu 20.04
|
|
271
|
+
|
|
272
|
+
Note: results in microseconds (previous benchmarks in milliseconds)
|
|
273
|
+
|
|
274
|
+
| Operation | p256-m | TinyCrypt |
|
|
275
|
+
| ------------------ | -----: | --------: |
|
|
276
|
+
| Key generation | 1060 | 1627 |
|
|
277
|
+
| ECDH shared secret | 1060 | 1611 |
|
|
278
|
+
| ECDSA sign | 1136 | 1712 |
|
|
279
|
+
| ECDSA verify | 2279 | 1888 |
|
|
280
|
+
| Sum of those 4 | 5535 | 6838 |
|
|
281
|
+
|
|
282
|
+
**Other differences**
|
|
283
|
+
|
|
284
|
+
- While p256-m fully validates all inputs, Tinycrypt's ECDH shared secret
|
|
285
|
+
function doesn't include validation of the peer's public key, which should be
|
|
286
|
+
done separately by the user for static ECDH (there are attacks [when users
|
|
287
|
+
forget](https://link.springer.com/chapter/10.1007/978-3-319-24174-6_21)).
|
|
288
|
+
- The two implementations have slightly different security characteristics:
|
|
289
|
+
p256-m is fully constant-time from the ground up so should be more robust
|
|
290
|
+
than TinyCrypt against powerful local attackers (such as an untrusted OS
|
|
291
|
+
attacking a secure enclave); on the other hand TinyCrypt includes coordinate
|
|
292
|
+
randomisation which protects against some passive physical attacks (such as
|
|
293
|
+
DPA, see Table 3, column C9 of [this
|
|
294
|
+
paper](https://www.esat.kuleuven.be/cosic/publications/article-2293.pdf#page=12)),
|
|
295
|
+
which p256-m completely ignores.
|
|
296
|
+
- TinyCrypt's code looks like it could easily be expanded to support other
|
|
297
|
+
curves, while p256-m has much more hard-coded to minimize code size (see
|
|
298
|
+
"Notes about other curves" below).
|
|
299
|
+
- TinyCrypt uses a specialised routine for reduction modulo the curve prime,
|
|
300
|
+
exploiting its structure as a Solinas prime, which should be faster than the
|
|
301
|
+
generic Montgomery reduction used by p256-m, but other factors appear to
|
|
302
|
+
compensate for that.
|
|
303
|
+
- TinyCrypt uses Co-Z Jacobian formulas for point operation, which should be
|
|
304
|
+
faster (though a bit larger) than the mixed affine-Jacobian formulas
|
|
305
|
+
used by p256-m, but again other factors appear to compensate for that.
|
|
306
|
+
- p256-m uses bits of inline assembly for 64-bit multiplication on the
|
|
307
|
+
platforms used for benchmarking, while TinyCrypt uses only C (and the
|
|
308
|
+
compiler's runtime library).
|
|
309
|
+
- TinyCrypt uses a specialised routine based on Shamir's trick for
|
|
310
|
+
ECDSA verification, which gives much better performance than the generic
|
|
311
|
+
code that p256-m uses in order to minimize code size.
|
|
312
|
+
|
|
313
|
+
## Design overview
|
|
314
|
+
|
|
315
|
+
The implementation is contained in a single file to keep most functions static
|
|
316
|
+
and allow for more optimisations. It is organized in multiple layers:
|
|
317
|
+
|
|
318
|
+
- Fixed-width multi-precision arithmetic
|
|
319
|
+
- Fixed-width modular arithmetic
|
|
320
|
+
- Operations on curve points
|
|
321
|
+
- Operations with scalars
|
|
322
|
+
- The public API
|
|
323
|
+
|
|
324
|
+
**Multi-precision arithmetic.**
|
|
325
|
+
|
|
326
|
+
Large integers are represented as arrays of `uint32_t` limbs. When carries may
|
|
327
|
+
occur, casts to `uint64_t` are used to nudge the compiler towards using the
|
|
328
|
+
CPU's carry flag. When overflow may occur, functions return a carry flag.
|
|
329
|
+
|
|
330
|
+
This layer contains optional assembly for Cortex-M and Cortex-A cores, for the
|
|
331
|
+
internal `u32_muladd64()` function, as well as two pure C versions of this
|
|
332
|
+
function, depending on whether `MUL64_IS_CONSTANT_TIME`.
|
|
333
|
+
|
|
334
|
+
This layer's API consists of:
|
|
335
|
+
|
|
336
|
+
- addition, subtraction;
|
|
337
|
+
- multiply-and-add, shift by one limb (for Montgomery multiplication);
|
|
338
|
+
- conditional assignment, assignment of a small value;
|
|
339
|
+
- comparison of two values for equality, comparison to 0 for equality;
|
|
340
|
+
- (de)serialization as big-endian arrays of bytes.
|
|
341
|
+
|
|
342
|
+
**Modular arithmetic.**
|
|
343
|
+
|
|
344
|
+
All modular operations are done in the Montgomery domain, that is x is
|
|
345
|
+
represented by `x * 2^256 mod m`; integers need to be converted to that domain
|
|
346
|
+
before computations, and back from it afterwards. Montgomery constants
|
|
347
|
+
associated to the curve's p and n are pre-computed and stored in static
|
|
348
|
+
structures.
|
|
349
|
+
|
|
350
|
+
Modular inversion is computed using Fermat's little theorem to get
|
|
351
|
+
constant-time behaviour with respect to the value being inverted.
|
|
352
|
+
|
|
353
|
+
This layer's API consists of:
|
|
354
|
+
|
|
355
|
+
- the curve's constants p and n (and associated Montgomery constants);
|
|
356
|
+
- modular addition, subtraction, multiplication, and inversion;
|
|
357
|
+
- assignment of a small value;
|
|
358
|
+
- conversion to/from Montgomery domain;
|
|
359
|
+
- (de)serialization to/from bytes with integrated range checking and
|
|
360
|
+
Montgomery domain conversion.
|
|
361
|
+
|
|
362
|
+
**Operations on curve points.**
|
|
363
|
+
|
|
364
|
+
Curve points are represented using either affine or Jacobian coordinates;
|
|
365
|
+
affine coordinates are extended to represent 0 as (0,0). Individual
|
|
366
|
+
coordinates are always in the Montgomery domain.
|
|
367
|
+
|
|
368
|
+
Not all formulas associated with affine or Jacobian coordinates are complete;
|
|
369
|
+
great care is taken to document and satisfy each function's pre-conditions.
|
|
370
|
+
|
|
371
|
+
This layer's API consists of:
|
|
372
|
+
|
|
373
|
+
- curve constants: b from the equation, the base point's coordinates;
|
|
374
|
+
- point validity check (on the curve and not 0);
|
|
375
|
+
- Jacobian to affine coordinate conversion;
|
|
376
|
+
- point doubling in Jacobian coordinates (complete formulas);
|
|
377
|
+
- point addition in mixed affine-Jacobian coordinates (P not in {0, Q, -Q});
|
|
378
|
+
- point addition-or-doubling in affine coordinates (leaky version, only used
|
|
379
|
+
for ECDSA verify where all data is public);
|
|
380
|
+
- (de)serialization to/from bytes with integrated validity checking
|
|
381
|
+
|
|
382
|
+
**Scalar operations.**
|
|
383
|
+
|
|
384
|
+
The crucial function here is scalar multiplication. It uses a signed binary
|
|
385
|
+
ladder, which is a variant of the good old double-and-add algorithm where an
|
|
386
|
+
addition/subtraction is performed at each step. Again, care is taken to make
|
|
387
|
+
sure the pre-conditions for the addition formulas are always satisfied. The
|
|
388
|
+
signed binary ladder only works if the scalar is odd; this is ensured by
|
|
389
|
+
negating both the scalar (mod n) and the input point if necessary.
|
|
390
|
+
|
|
391
|
+
This layer's API consists of:
|
|
392
|
+
|
|
393
|
+
- scalar multiplication
|
|
394
|
+
- de-serialization from bytes with integrated range checking
|
|
395
|
+
- generation of a scalar and its associated public key
|
|
396
|
+
|
|
397
|
+
**Public API.**
|
|
398
|
+
|
|
399
|
+
This layer builds on the others, but unlike them, all inputs and outputs are
|
|
400
|
+
byte arrays. Key generation and ECDH shared secret computation are thin
|
|
401
|
+
wrappers around internal functions, just taking care of format conversions and
|
|
402
|
+
errors. The ECDSA functions have more non-trivial logic.
|
|
403
|
+
|
|
404
|
+
This layer's API consists of:
|
|
405
|
+
|
|
406
|
+
- key-pair generation
|
|
407
|
+
- ECDH shared secret computation
|
|
408
|
+
- ECDSA signature creation
|
|
409
|
+
- ECDSA signature verification
|
|
410
|
+
|
|
411
|
+
**Testing.**
|
|
412
|
+
|
|
413
|
+
A self-contained, straightforward, pure-Python implementation was first
|
|
414
|
+
produced as a warm-up and to help check intermediate values. Test vectors from
|
|
415
|
+
various sources are embedded and used to validate the implementation.
|
|
416
|
+
|
|
417
|
+
This implementation, `p256.py`, is used by a second Python script,
|
|
418
|
+
`gen-test-data.py`, to generate additional data for both positive and negative
|
|
419
|
+
testing, available from a C header file, that is then used by the closed-box
|
|
420
|
+
and open-box test programs.
|
|
421
|
+
|
|
422
|
+
p256-m can be compiled with extra instrumentation to mark secret data and
|
|
423
|
+
allow either valgrind or MemSan to check that no branch or memory access
|
|
424
|
+
depends on it (even indirectly). Macros are defined for this purpose near the
|
|
425
|
+
top of the file.
|
|
426
|
+
|
|
427
|
+
**Tested platforms.**
|
|
428
|
+
|
|
429
|
+
There are 4 versions of the internal function `u32_muladd64`: two assembly
|
|
430
|
+
versions, for Cortex-M/A cores with or without the DSP extension, and two
|
|
431
|
+
pure-C versions, depending on whether `MUL64_IS_CONSTANT_TIME`.
|
|
432
|
+
|
|
433
|
+
Tests are run on the following platforms:
|
|
434
|
+
|
|
435
|
+
- `make` on x64 tests the pure-C version without `MUL64_IS_CONSTANT_TIME`
|
|
436
|
+
(with Clang).
|
|
437
|
+
- `./consttime.sh` on x64 tests both pure-C versions (with Clang).
|
|
438
|
+
- `make` on Arm v7-A (Raspberry Pi 2) tests the Arm-DSP assembly version (with
|
|
439
|
+
Clang).
|
|
440
|
+
- `on-target-*box` on boards based on Cortex-M0 and M4 cores test both
|
|
441
|
+
assembly versions (with GCC).
|
|
442
|
+
|
|
443
|
+
In addition:
|
|
444
|
+
|
|
445
|
+
- `sizes.sh` builds the code for three Arm cores with GCC and Clang.
|
|
446
|
+
- `deps.sh` checks for external dependencies with GCC.
|
|
447
|
+
|
|
448
|
+
## Notes about other curves
|
|
449
|
+
|
|
450
|
+
It should be clear that minimal code size can only be reached by specializing
|
|
451
|
+
the implementation to the curve at hand. Here's a list of things in the
|
|
452
|
+
implementation that are specific to the NIST P-256 curve, and how the
|
|
453
|
+
implementation could be changed to expand to other curves, layer by layer (see
|
|
454
|
+
"Design Overview" above).
|
|
455
|
+
|
|
456
|
+
**Fixed-width multi-precision arithmetic:**
|
|
457
|
+
|
|
458
|
+
- The number of limbs is hard-coded to 8. For other 256-bit curves, nothing to
|
|
459
|
+
change. For a curve of another size, hard-code to another value. For multiple
|
|
460
|
+
curves of various sizes, add a parameter to each function specifying the
|
|
461
|
+
number of limbs; when declaring arrays, always use the maximum number of
|
|
462
|
+
limbs.
|
|
463
|
+
|
|
464
|
+
**Fixed-width modular arithmetic:**
|
|
465
|
+
|
|
466
|
+
- The values of the curve's constant p and n, and their associated Montgomery
|
|
467
|
+
constants, are hard-coded. For another curve, just hard-code the new constants.
|
|
468
|
+
For multiple other curves, define all the constants, and from this layer's API
|
|
469
|
+
only keep the functions that already accept a `mod` parameter (that is, remove
|
|
470
|
+
convenience functions `m256_xxx_p()`).
|
|
471
|
+
- The number of limbs is again hard-coded to 8. See above, but it order to
|
|
472
|
+
support multiple sizes there is no need to add a new parameter to functions
|
|
473
|
+
in this layer: the existing `mod` parameter can include the number of limbs as
|
|
474
|
+
well.
|
|
475
|
+
|
|
476
|
+
**Operations on curve points:**
|
|
477
|
+
|
|
478
|
+
- The values of the curve's constants b (constant term from the equation) and
|
|
479
|
+
gx, gy (coordinates of the base point) are hard-coded. For another curve,
|
|
480
|
+
hard-code the other values. For multiple curves, define each curve's value and
|
|
481
|
+
add a "curve id" parameter to all functions in this layer.
|
|
482
|
+
- The value of the curve's constant a is implicitly hard-coded to `-3` by using
|
|
483
|
+
a standard optimisation to save one multiplication in the first step of
|
|
484
|
+
`point_double()`. For curves that don't have a == -3, replace that with the
|
|
485
|
+
normal computation.
|
|
486
|
+
- The fact that b != 0 in the curve equation is used indirectly, to ensure
|
|
487
|
+
that (0, 0) is not a point on the curve and re-use that value to represent
|
|
488
|
+
the point 0. As far as I know, all Short Weierstrass curves standardized so
|
|
489
|
+
far have b != 0.
|
|
490
|
+
- The shape of the curve is assumed to be Short Weierstrass. For other curve
|
|
491
|
+
shapes (Montgomery, (twisted) Edwards), this layer would probably look very
|
|
492
|
+
different (both implementation and API).
|
|
493
|
+
|
|
494
|
+
**Scalar operations:**
|
|
495
|
+
|
|
496
|
+
- If multiple curves are to be supported, all function in this layer need to
|
|
497
|
+
gain a new "curve id" parameter.
|
|
498
|
+
- This layer assumes that the bit size of the curve's order n is the same as
|
|
499
|
+
that of the modulus p. This is true of most curves standardized so far, the
|
|
500
|
+
only exception being secp224k1. If that curve were to be supported, the
|
|
501
|
+
representation of `n` and scalars would need adapting to allow for an extra
|
|
502
|
+
limb.
|
|
503
|
+
- The bit size of the curve's order is hard-coded in `scalar_mult()`. For
|
|
504
|
+
multiple curves, this should be deduced from the "curve id" parameter.
|
|
505
|
+
- The `scalar_mult()` function exploits the fact that the second least
|
|
506
|
+
significant bit of the curve's order n is set in order to avoid a special
|
|
507
|
+
case. For curve orders that don't meet this criterion, we can just handle that
|
|
508
|
+
special case (multiplication by +-2) separately (always compute that and
|
|
509
|
+
conditionally assign it to the result).
|
|
510
|
+
- The shape of the curve is again assumed to be Short Weierstrass. For other curve
|
|
511
|
+
shapes (Montgomery, (twisted) Edwards), this layer would probably have a
|
|
512
|
+
very different implementation.
|
|
513
|
+
|
|
514
|
+
**Public API:**
|
|
515
|
+
|
|
516
|
+
- For multiple curves, all functions in this layer would need to gain a "curve
|
|
517
|
+
id" parameter and handle variable-sized input/output.
|
|
518
|
+
- The shape of the curve is again assumed to be Short Weierstrass. For other curve
|
|
519
|
+
shapes (Montgomery, (twisted) Edwards), the ECDH API would probably look
|
|
520
|
+
quite similar (with differences in the size of public keys), but the ECDSA API
|
|
521
|
+
wouldn't apply and an EdDSA API would look pretty different.
|
|
522
|
+
|
|
523
|
+
## Notes about other platforms
|
|
524
|
+
|
|
525
|
+
While p256-m is standard C99, it is written with constrained 32-bit platforms
|
|
526
|
+
in mind and makes a few assumptions about the platform:
|
|
527
|
+
|
|
528
|
+
- The types `uint8_t`, `uint16_t`, `uint32_t` and `uint64_t` exist.
|
|
529
|
+
- 32-bit unsigned addition and subtraction with carry are constant time.
|
|
530
|
+
- 16x16->32-bit unsigned multiplication is available and constant time.
|
|
531
|
+
|
|
532
|
+
Also, on platforms on which 64-bit addition and subtraction with carry, or
|
|
533
|
+
even 64x64->128-bit multiplication, are available, p256-m makes no use of
|
|
534
|
+
them, though they could significantly improve performance.
|
|
535
|
+
|
|
536
|
+
This could be improved by replacing uses of arrays of `uint32_t` with a
|
|
537
|
+
defined type throughout the internal APIs, and then on 64-bit platforms define
|
|
538
|
+
that type to be an array of `uint64_t` instead, and making the obvious
|
|
539
|
+
adaptations in the multi-precision arithmetic layer.
|
|
540
|
+
|
|
541
|
+
Finally, the optional assembly code (which boosts performance by a factor 2 on
|
|
542
|
+
tested Cortex-M CPUs, while slightly reducing code size and stack usage) is
|
|
543
|
+
currently only available with compilers that support GCC's extended asm
|
|
544
|
+
syntax (which includes GCC and Clang).
|