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,1056 @@
|
|
|
1
|
+
#ifndef SECP256K1_MODULE_ED25519_REF10_FE_25_5
|
|
2
|
+
#define SECP256K1_MODULE_ED25519_REF10_FE_25_5
|
|
3
|
+
|
|
4
|
+
#include <string.h>
|
|
5
|
+
|
|
6
|
+
/*#include "private/common.h"*/
|
|
7
|
+
#include "../utils.h"
|
|
8
|
+
/*#include "fe_25_5/fe.h"*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
h = 0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
static void
|
|
15
|
+
fe25519_0(fe25519 h)
|
|
16
|
+
{
|
|
17
|
+
memset(&h[0], 0, 10 * sizeof h[0]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
h = 1
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
static void
|
|
25
|
+
fe25519_1(fe25519 h)
|
|
26
|
+
{
|
|
27
|
+
h[0] = 1;
|
|
28
|
+
h[1] = 0;
|
|
29
|
+
memset(&h[2], 0, 8 * sizeof h[0]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
h = f + g
|
|
34
|
+
Can overlap h with f or g.
|
|
35
|
+
*
|
|
36
|
+
Preconditions:
|
|
37
|
+
|f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
|
38
|
+
|g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
|
39
|
+
*
|
|
40
|
+
Postconditions:
|
|
41
|
+
|h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
static void
|
|
45
|
+
fe25519_add(fe25519 h, const fe25519 f, const fe25519 g)
|
|
46
|
+
{
|
|
47
|
+
int32_t h0 = f[0] + g[0];
|
|
48
|
+
int32_t h1 = f[1] + g[1];
|
|
49
|
+
int32_t h2 = f[2] + g[2];
|
|
50
|
+
int32_t h3 = f[3] + g[3];
|
|
51
|
+
int32_t h4 = f[4] + g[4];
|
|
52
|
+
int32_t h5 = f[5] + g[5];
|
|
53
|
+
int32_t h6 = f[6] + g[6];
|
|
54
|
+
int32_t h7 = f[7] + g[7];
|
|
55
|
+
int32_t h8 = f[8] + g[8];
|
|
56
|
+
int32_t h9 = f[9] + g[9];
|
|
57
|
+
|
|
58
|
+
h[0] = h0;
|
|
59
|
+
h[1] = h1;
|
|
60
|
+
h[2] = h2;
|
|
61
|
+
h[3] = h3;
|
|
62
|
+
h[4] = h4;
|
|
63
|
+
h[5] = h5;
|
|
64
|
+
h[6] = h6;
|
|
65
|
+
h[7] = h7;
|
|
66
|
+
h[8] = h8;
|
|
67
|
+
h[9] = h9;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
h = f - g
|
|
72
|
+
Can overlap h with f or g.
|
|
73
|
+
*
|
|
74
|
+
Preconditions:
|
|
75
|
+
|f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
|
76
|
+
|g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
|
77
|
+
*
|
|
78
|
+
Postconditions:
|
|
79
|
+
|h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
static void
|
|
83
|
+
fe25519_sub(fe25519 h, const fe25519 f, const fe25519 g)
|
|
84
|
+
{
|
|
85
|
+
int32_t h0 = f[0] - g[0];
|
|
86
|
+
int32_t h1 = f[1] - g[1];
|
|
87
|
+
int32_t h2 = f[2] - g[2];
|
|
88
|
+
int32_t h3 = f[3] - g[3];
|
|
89
|
+
int32_t h4 = f[4] - g[4];
|
|
90
|
+
int32_t h5 = f[5] - g[5];
|
|
91
|
+
int32_t h6 = f[6] - g[6];
|
|
92
|
+
int32_t h7 = f[7] - g[7];
|
|
93
|
+
int32_t h8 = f[8] - g[8];
|
|
94
|
+
int32_t h9 = f[9] - g[9];
|
|
95
|
+
|
|
96
|
+
h[0] = h0;
|
|
97
|
+
h[1] = h1;
|
|
98
|
+
h[2] = h2;
|
|
99
|
+
h[3] = h3;
|
|
100
|
+
h[4] = h4;
|
|
101
|
+
h[5] = h5;
|
|
102
|
+
h[6] = h6;
|
|
103
|
+
h[7] = h7;
|
|
104
|
+
h[8] = h8;
|
|
105
|
+
h[9] = h9;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
h = -f
|
|
110
|
+
*
|
|
111
|
+
Preconditions:
|
|
112
|
+
|f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
|
113
|
+
*
|
|
114
|
+
Postconditions:
|
|
115
|
+
|h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
static void
|
|
119
|
+
fe25519_neg(fe25519 h, const fe25519 f)
|
|
120
|
+
{
|
|
121
|
+
int32_t h0 = -f[0];
|
|
122
|
+
int32_t h1 = -f[1];
|
|
123
|
+
int32_t h2 = -f[2];
|
|
124
|
+
int32_t h3 = -f[3];
|
|
125
|
+
int32_t h4 = -f[4];
|
|
126
|
+
int32_t h5 = -f[5];
|
|
127
|
+
int32_t h6 = -f[6];
|
|
128
|
+
int32_t h7 = -f[7];
|
|
129
|
+
int32_t h8 = -f[8];
|
|
130
|
+
int32_t h9 = -f[9];
|
|
131
|
+
|
|
132
|
+
h[0] = h0;
|
|
133
|
+
h[1] = h1;
|
|
134
|
+
h[2] = h2;
|
|
135
|
+
h[3] = h3;
|
|
136
|
+
h[4] = h4;
|
|
137
|
+
h[5] = h5;
|
|
138
|
+
h[6] = h6;
|
|
139
|
+
h[7] = h7;
|
|
140
|
+
h[8] = h8;
|
|
141
|
+
h[9] = h9;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
Replace (f,g) with (g,g) if b == 1;
|
|
146
|
+
replace (f,g) with (f,g) if b == 0.
|
|
147
|
+
*
|
|
148
|
+
Preconditions: b in {0,1}.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
static void
|
|
152
|
+
fe25519_cmov(fe25519 f, const fe25519 g, unsigned int b)
|
|
153
|
+
{
|
|
154
|
+
const uint32_t mask = (uint32_t) (-(int32_t) b);
|
|
155
|
+
|
|
156
|
+
int32_t f0 = f[0];
|
|
157
|
+
int32_t f1 = f[1];
|
|
158
|
+
int32_t f2 = f[2];
|
|
159
|
+
int32_t f3 = f[3];
|
|
160
|
+
int32_t f4 = f[4];
|
|
161
|
+
int32_t f5 = f[5];
|
|
162
|
+
int32_t f6 = f[6];
|
|
163
|
+
int32_t f7 = f[7];
|
|
164
|
+
int32_t f8 = f[8];
|
|
165
|
+
int32_t f9 = f[9];
|
|
166
|
+
|
|
167
|
+
int32_t x0 = f0 ^ g[0];
|
|
168
|
+
int32_t x1 = f1 ^ g[1];
|
|
169
|
+
int32_t x2 = f2 ^ g[2];
|
|
170
|
+
int32_t x3 = f3 ^ g[3];
|
|
171
|
+
int32_t x4 = f4 ^ g[4];
|
|
172
|
+
int32_t x5 = f5 ^ g[5];
|
|
173
|
+
int32_t x6 = f6 ^ g[6];
|
|
174
|
+
int32_t x7 = f7 ^ g[7];
|
|
175
|
+
int32_t x8 = f8 ^ g[8];
|
|
176
|
+
int32_t x9 = f9 ^ g[9];
|
|
177
|
+
|
|
178
|
+
x0 &= mask;
|
|
179
|
+
x1 &= mask;
|
|
180
|
+
x2 &= mask;
|
|
181
|
+
x3 &= mask;
|
|
182
|
+
x4 &= mask;
|
|
183
|
+
x5 &= mask;
|
|
184
|
+
x6 &= mask;
|
|
185
|
+
x7 &= mask;
|
|
186
|
+
x8 &= mask;
|
|
187
|
+
x9 &= mask;
|
|
188
|
+
|
|
189
|
+
f[0] = f0 ^ x0;
|
|
190
|
+
f[1] = f1 ^ x1;
|
|
191
|
+
f[2] = f2 ^ x2;
|
|
192
|
+
f[3] = f3 ^ x3;
|
|
193
|
+
f[4] = f4 ^ x4;
|
|
194
|
+
f[5] = f5 ^ x5;
|
|
195
|
+
f[6] = f6 ^ x6;
|
|
196
|
+
f[7] = f7 ^ x7;
|
|
197
|
+
f[8] = f8 ^ x8;
|
|
198
|
+
f[9] = f9 ^ x9;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
static void
|
|
202
|
+
fe25519_cswap(fe25519 f, fe25519 g, unsigned int b)
|
|
203
|
+
{
|
|
204
|
+
const uint32_t mask = (uint32_t) (-(int64_t) b);
|
|
205
|
+
|
|
206
|
+
int32_t f0 = f[0];
|
|
207
|
+
int32_t f1 = f[1];
|
|
208
|
+
int32_t f2 = f[2];
|
|
209
|
+
int32_t f3 = f[3];
|
|
210
|
+
int32_t f4 = f[4];
|
|
211
|
+
int32_t f5 = f[5];
|
|
212
|
+
int32_t f6 = f[6];
|
|
213
|
+
int32_t f7 = f[7];
|
|
214
|
+
int32_t f8 = f[8];
|
|
215
|
+
int32_t f9 = f[9];
|
|
216
|
+
|
|
217
|
+
int32_t g0 = g[0];
|
|
218
|
+
int32_t g1 = g[1];
|
|
219
|
+
int32_t g2 = g[2];
|
|
220
|
+
int32_t g3 = g[3];
|
|
221
|
+
int32_t g4 = g[4];
|
|
222
|
+
int32_t g5 = g[5];
|
|
223
|
+
int32_t g6 = g[6];
|
|
224
|
+
int32_t g7 = g[7];
|
|
225
|
+
int32_t g8 = g[8];
|
|
226
|
+
int32_t g9 = g[9];
|
|
227
|
+
|
|
228
|
+
int32_t x0 = f0 ^ g0;
|
|
229
|
+
int32_t x1 = f1 ^ g1;
|
|
230
|
+
int32_t x2 = f2 ^ g2;
|
|
231
|
+
int32_t x3 = f3 ^ g3;
|
|
232
|
+
int32_t x4 = f4 ^ g4;
|
|
233
|
+
int32_t x5 = f5 ^ g5;
|
|
234
|
+
int32_t x6 = f6 ^ g6;
|
|
235
|
+
int32_t x7 = f7 ^ g7;
|
|
236
|
+
int32_t x8 = f8 ^ g8;
|
|
237
|
+
int32_t x9 = f9 ^ g9;
|
|
238
|
+
|
|
239
|
+
x0 &= mask;
|
|
240
|
+
x1 &= mask;
|
|
241
|
+
x2 &= mask;
|
|
242
|
+
x3 &= mask;
|
|
243
|
+
x4 &= mask;
|
|
244
|
+
x5 &= mask;
|
|
245
|
+
x6 &= mask;
|
|
246
|
+
x7 &= mask;
|
|
247
|
+
x8 &= mask;
|
|
248
|
+
x9 &= mask;
|
|
249
|
+
|
|
250
|
+
f[0] = f0 ^ x0;
|
|
251
|
+
f[1] = f1 ^ x1;
|
|
252
|
+
f[2] = f2 ^ x2;
|
|
253
|
+
f[3] = f3 ^ x3;
|
|
254
|
+
f[4] = f4 ^ x4;
|
|
255
|
+
f[5] = f5 ^ x5;
|
|
256
|
+
f[6] = f6 ^ x6;
|
|
257
|
+
f[7] = f7 ^ x7;
|
|
258
|
+
f[8] = f8 ^ x8;
|
|
259
|
+
f[9] = f9 ^ x9;
|
|
260
|
+
|
|
261
|
+
g[0] = g0 ^ x0;
|
|
262
|
+
g[1] = g1 ^ x1;
|
|
263
|
+
g[2] = g2 ^ x2;
|
|
264
|
+
g[3] = g3 ^ x3;
|
|
265
|
+
g[4] = g4 ^ x4;
|
|
266
|
+
g[5] = g5 ^ x5;
|
|
267
|
+
g[6] = g6 ^ x6;
|
|
268
|
+
g[7] = g7 ^ x7;
|
|
269
|
+
g[8] = g8 ^ x8;
|
|
270
|
+
g[9] = g9 ^ x9;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/*
|
|
274
|
+
h = f
|
|
275
|
+
*/
|
|
276
|
+
|
|
277
|
+
static void
|
|
278
|
+
fe25519_copy(fe25519 h, const fe25519 f)
|
|
279
|
+
{
|
|
280
|
+
int32_t f0 = f[0];
|
|
281
|
+
int32_t f1 = f[1];
|
|
282
|
+
int32_t f2 = f[2];
|
|
283
|
+
int32_t f3 = f[3];
|
|
284
|
+
int32_t f4 = f[4];
|
|
285
|
+
int32_t f5 = f[5];
|
|
286
|
+
int32_t f6 = f[6];
|
|
287
|
+
int32_t f7 = f[7];
|
|
288
|
+
int32_t f8 = f[8];
|
|
289
|
+
int32_t f9 = f[9];
|
|
290
|
+
|
|
291
|
+
h[0] = f0;
|
|
292
|
+
h[1] = f1;
|
|
293
|
+
h[2] = f2;
|
|
294
|
+
h[3] = f3;
|
|
295
|
+
h[4] = f4;
|
|
296
|
+
h[5] = f5;
|
|
297
|
+
h[6] = f6;
|
|
298
|
+
h[7] = f7;
|
|
299
|
+
h[8] = f8;
|
|
300
|
+
h[9] = f9;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/*
|
|
304
|
+
return 1 if f is in {1,3,5,...,q-2}
|
|
305
|
+
return 0 if f is in {0,2,4,...,q-1}
|
|
306
|
+
|
|
307
|
+
Preconditions:
|
|
308
|
+
|f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
|
309
|
+
*/
|
|
310
|
+
|
|
311
|
+
static int
|
|
312
|
+
fe25519_isnegative(const fe25519 f)
|
|
313
|
+
{
|
|
314
|
+
unsigned char s[32];
|
|
315
|
+
|
|
316
|
+
fe25519_tobytes(s, f);
|
|
317
|
+
|
|
318
|
+
return s[0] & 1;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/*
|
|
322
|
+
return 1 if f == 0
|
|
323
|
+
return 0 if f != 0
|
|
324
|
+
|
|
325
|
+
Preconditions:
|
|
326
|
+
|f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
|
327
|
+
*/
|
|
328
|
+
|
|
329
|
+
static int
|
|
330
|
+
fe25519_iszero(const fe25519 f)
|
|
331
|
+
{
|
|
332
|
+
unsigned char s[32];
|
|
333
|
+
|
|
334
|
+
fe25519_tobytes(s, f);
|
|
335
|
+
|
|
336
|
+
return sodium_is_zero(s, 32);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/*
|
|
340
|
+
h = f * g
|
|
341
|
+
Can overlap h with f or g.
|
|
342
|
+
*
|
|
343
|
+
Preconditions:
|
|
344
|
+
|f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc.
|
|
345
|
+
|g| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc.
|
|
346
|
+
*
|
|
347
|
+
Postconditions:
|
|
348
|
+
|h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc.
|
|
349
|
+
*/
|
|
350
|
+
|
|
351
|
+
/*
|
|
352
|
+
Notes on implementation strategy:
|
|
353
|
+
*
|
|
354
|
+
Using schoolbook multiplication.
|
|
355
|
+
Karatsuba would save a little in some cost models.
|
|
356
|
+
*
|
|
357
|
+
Most multiplications by 2 and 19 are 32-bit precomputations;
|
|
358
|
+
cheaper than 64-bit postcomputations.
|
|
359
|
+
*
|
|
360
|
+
There is one remaining multiplication by 19 in the carry chain;
|
|
361
|
+
one *19 precomputation can be merged into this,
|
|
362
|
+
but the resulting data flow is considerably less clean.
|
|
363
|
+
*
|
|
364
|
+
There are 12 carries below.
|
|
365
|
+
10 of them are 2-way parallelizable and vectorizable.
|
|
366
|
+
Can get away with 11 carries, but then data flow is much deeper.
|
|
367
|
+
*
|
|
368
|
+
With tighter constraints on inputs can squeeze carries into int32.
|
|
369
|
+
*/
|
|
370
|
+
|
|
371
|
+
static void
|
|
372
|
+
fe25519_mul(fe25519 h, const fe25519 f, const fe25519 g)
|
|
373
|
+
{
|
|
374
|
+
int32_t f0 = f[0];
|
|
375
|
+
int32_t f1 = f[1];
|
|
376
|
+
int32_t f2 = f[2];
|
|
377
|
+
int32_t f3 = f[3];
|
|
378
|
+
int32_t f4 = f[4];
|
|
379
|
+
int32_t f5 = f[5];
|
|
380
|
+
int32_t f6 = f[6];
|
|
381
|
+
int32_t f7 = f[7];
|
|
382
|
+
int32_t f8 = f[8];
|
|
383
|
+
int32_t f9 = f[9];
|
|
384
|
+
|
|
385
|
+
int32_t g0 = g[0];
|
|
386
|
+
int32_t g1 = g[1];
|
|
387
|
+
int32_t g2 = g[2];
|
|
388
|
+
int32_t g3 = g[3];
|
|
389
|
+
int32_t g4 = g[4];
|
|
390
|
+
int32_t g5 = g[5];
|
|
391
|
+
int32_t g6 = g[6];
|
|
392
|
+
int32_t g7 = g[7];
|
|
393
|
+
int32_t g8 = g[8];
|
|
394
|
+
int32_t g9 = g[9];
|
|
395
|
+
|
|
396
|
+
int32_t g1_19 = 19 * g1; /* 1.959375*2^29 */
|
|
397
|
+
int32_t g2_19 = 19 * g2; /* 1.959375*2^30; still ok */
|
|
398
|
+
int32_t g3_19 = 19 * g3;
|
|
399
|
+
int32_t g4_19 = 19 * g4;
|
|
400
|
+
int32_t g5_19 = 19 * g5;
|
|
401
|
+
int32_t g6_19 = 19 * g6;
|
|
402
|
+
int32_t g7_19 = 19 * g7;
|
|
403
|
+
int32_t g8_19 = 19 * g8;
|
|
404
|
+
int32_t g9_19 = 19 * g9;
|
|
405
|
+
int32_t f1_2 = 2 * f1;
|
|
406
|
+
int32_t f3_2 = 2 * f3;
|
|
407
|
+
int32_t f5_2 = 2 * f5;
|
|
408
|
+
int32_t f7_2 = 2 * f7;
|
|
409
|
+
int32_t f9_2 = 2 * f9;
|
|
410
|
+
|
|
411
|
+
int64_t f0g0 = f0 * (int64_t) g0;
|
|
412
|
+
int64_t f0g1 = f0 * (int64_t) g1;
|
|
413
|
+
int64_t f0g2 = f0 * (int64_t) g2;
|
|
414
|
+
int64_t f0g3 = f0 * (int64_t) g3;
|
|
415
|
+
int64_t f0g4 = f0 * (int64_t) g4;
|
|
416
|
+
int64_t f0g5 = f0 * (int64_t) g5;
|
|
417
|
+
int64_t f0g6 = f0 * (int64_t) g6;
|
|
418
|
+
int64_t f0g7 = f0 * (int64_t) g7;
|
|
419
|
+
int64_t f0g8 = f0 * (int64_t) g8;
|
|
420
|
+
int64_t f0g9 = f0 * (int64_t) g9;
|
|
421
|
+
int64_t f1g0 = f1 * (int64_t) g0;
|
|
422
|
+
int64_t f1g1_2 = f1_2 * (int64_t) g1;
|
|
423
|
+
int64_t f1g2 = f1 * (int64_t) g2;
|
|
424
|
+
int64_t f1g3_2 = f1_2 * (int64_t) g3;
|
|
425
|
+
int64_t f1g4 = f1 * (int64_t) g4;
|
|
426
|
+
int64_t f1g5_2 = f1_2 * (int64_t) g5;
|
|
427
|
+
int64_t f1g6 = f1 * (int64_t) g6;
|
|
428
|
+
int64_t f1g7_2 = f1_2 * (int64_t) g7;
|
|
429
|
+
int64_t f1g8 = f1 * (int64_t) g8;
|
|
430
|
+
int64_t f1g9_38 = f1_2 * (int64_t) g9_19;
|
|
431
|
+
int64_t f2g0 = f2 * (int64_t) g0;
|
|
432
|
+
int64_t f2g1 = f2 * (int64_t) g1;
|
|
433
|
+
int64_t f2g2 = f2 * (int64_t) g2;
|
|
434
|
+
int64_t f2g3 = f2 * (int64_t) g3;
|
|
435
|
+
int64_t f2g4 = f2 * (int64_t) g4;
|
|
436
|
+
int64_t f2g5 = f2 * (int64_t) g5;
|
|
437
|
+
int64_t f2g6 = f2 * (int64_t) g6;
|
|
438
|
+
int64_t f2g7 = f2 * (int64_t) g7;
|
|
439
|
+
int64_t f2g8_19 = f2 * (int64_t) g8_19;
|
|
440
|
+
int64_t f2g9_19 = f2 * (int64_t) g9_19;
|
|
441
|
+
int64_t f3g0 = f3 * (int64_t) g0;
|
|
442
|
+
int64_t f3g1_2 = f3_2 * (int64_t) g1;
|
|
443
|
+
int64_t f3g2 = f3 * (int64_t) g2;
|
|
444
|
+
int64_t f3g3_2 = f3_2 * (int64_t) g3;
|
|
445
|
+
int64_t f3g4 = f3 * (int64_t) g4;
|
|
446
|
+
int64_t f3g5_2 = f3_2 * (int64_t) g5;
|
|
447
|
+
int64_t f3g6 = f3 * (int64_t) g6;
|
|
448
|
+
int64_t f3g7_38 = f3_2 * (int64_t) g7_19;
|
|
449
|
+
int64_t f3g8_19 = f3 * (int64_t) g8_19;
|
|
450
|
+
int64_t f3g9_38 = f3_2 * (int64_t) g9_19;
|
|
451
|
+
int64_t f4g0 = f4 * (int64_t) g0;
|
|
452
|
+
int64_t f4g1 = f4 * (int64_t) g1;
|
|
453
|
+
int64_t f4g2 = f4 * (int64_t) g2;
|
|
454
|
+
int64_t f4g3 = f4 * (int64_t) g3;
|
|
455
|
+
int64_t f4g4 = f4 * (int64_t) g4;
|
|
456
|
+
int64_t f4g5 = f4 * (int64_t) g5;
|
|
457
|
+
int64_t f4g6_19 = f4 * (int64_t) g6_19;
|
|
458
|
+
int64_t f4g7_19 = f4 * (int64_t) g7_19;
|
|
459
|
+
int64_t f4g8_19 = f4 * (int64_t) g8_19;
|
|
460
|
+
int64_t f4g9_19 = f4 * (int64_t) g9_19;
|
|
461
|
+
int64_t f5g0 = f5 * (int64_t) g0;
|
|
462
|
+
int64_t f5g1_2 = f5_2 * (int64_t) g1;
|
|
463
|
+
int64_t f5g2 = f5 * (int64_t) g2;
|
|
464
|
+
int64_t f5g3_2 = f5_2 * (int64_t) g3;
|
|
465
|
+
int64_t f5g4 = f5 * (int64_t) g4;
|
|
466
|
+
int64_t f5g5_38 = f5_2 * (int64_t) g5_19;
|
|
467
|
+
int64_t f5g6_19 = f5 * (int64_t) g6_19;
|
|
468
|
+
int64_t f5g7_38 = f5_2 * (int64_t) g7_19;
|
|
469
|
+
int64_t f5g8_19 = f5 * (int64_t) g8_19;
|
|
470
|
+
int64_t f5g9_38 = f5_2 * (int64_t) g9_19;
|
|
471
|
+
int64_t f6g0 = f6 * (int64_t) g0;
|
|
472
|
+
int64_t f6g1 = f6 * (int64_t) g1;
|
|
473
|
+
int64_t f6g2 = f6 * (int64_t) g2;
|
|
474
|
+
int64_t f6g3 = f6 * (int64_t) g3;
|
|
475
|
+
int64_t f6g4_19 = f6 * (int64_t) g4_19;
|
|
476
|
+
int64_t f6g5_19 = f6 * (int64_t) g5_19;
|
|
477
|
+
int64_t f6g6_19 = f6 * (int64_t) g6_19;
|
|
478
|
+
int64_t f6g7_19 = f6 * (int64_t) g7_19;
|
|
479
|
+
int64_t f6g8_19 = f6 * (int64_t) g8_19;
|
|
480
|
+
int64_t f6g9_19 = f6 * (int64_t) g9_19;
|
|
481
|
+
int64_t f7g0 = f7 * (int64_t) g0;
|
|
482
|
+
int64_t f7g1_2 = f7_2 * (int64_t) g1;
|
|
483
|
+
int64_t f7g2 = f7 * (int64_t) g2;
|
|
484
|
+
int64_t f7g3_38 = f7_2 * (int64_t) g3_19;
|
|
485
|
+
int64_t f7g4_19 = f7 * (int64_t) g4_19;
|
|
486
|
+
int64_t f7g5_38 = f7_2 * (int64_t) g5_19;
|
|
487
|
+
int64_t f7g6_19 = f7 * (int64_t) g6_19;
|
|
488
|
+
int64_t f7g7_38 = f7_2 * (int64_t) g7_19;
|
|
489
|
+
int64_t f7g8_19 = f7 * (int64_t) g8_19;
|
|
490
|
+
int64_t f7g9_38 = f7_2 * (int64_t) g9_19;
|
|
491
|
+
int64_t f8g0 = f8 * (int64_t) g0;
|
|
492
|
+
int64_t f8g1 = f8 * (int64_t) g1;
|
|
493
|
+
int64_t f8g2_19 = f8 * (int64_t) g2_19;
|
|
494
|
+
int64_t f8g3_19 = f8 * (int64_t) g3_19;
|
|
495
|
+
int64_t f8g4_19 = f8 * (int64_t) g4_19;
|
|
496
|
+
int64_t f8g5_19 = f8 * (int64_t) g5_19;
|
|
497
|
+
int64_t f8g6_19 = f8 * (int64_t) g6_19;
|
|
498
|
+
int64_t f8g7_19 = f8 * (int64_t) g7_19;
|
|
499
|
+
int64_t f8g8_19 = f8 * (int64_t) g8_19;
|
|
500
|
+
int64_t f8g9_19 = f8 * (int64_t) g9_19;
|
|
501
|
+
int64_t f9g0 = f9 * (int64_t) g0;
|
|
502
|
+
int64_t f9g1_38 = f9_2 * (int64_t) g1_19;
|
|
503
|
+
int64_t f9g2_19 = f9 * (int64_t) g2_19;
|
|
504
|
+
int64_t f9g3_38 = f9_2 * (int64_t) g3_19;
|
|
505
|
+
int64_t f9g4_19 = f9 * (int64_t) g4_19;
|
|
506
|
+
int64_t f9g5_38 = f9_2 * (int64_t) g5_19;
|
|
507
|
+
int64_t f9g6_19 = f9 * (int64_t) g6_19;
|
|
508
|
+
int64_t f9g7_38 = f9_2 * (int64_t) g7_19;
|
|
509
|
+
int64_t f9g8_19 = f9 * (int64_t) g8_19;
|
|
510
|
+
int64_t f9g9_38 = f9_2 * (int64_t) g9_19;
|
|
511
|
+
|
|
512
|
+
int64_t h0 = f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 +
|
|
513
|
+
f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38;
|
|
514
|
+
int64_t h1 = f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 +
|
|
515
|
+
f7g4_19 + f8g3_19 + f9g2_19;
|
|
516
|
+
int64_t h2 = f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 +
|
|
517
|
+
f7g5_38 + f8g4_19 + f9g3_38;
|
|
518
|
+
int64_t h3 = f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 +
|
|
519
|
+
f7g6_19 + f8g5_19 + f9g4_19;
|
|
520
|
+
int64_t h4 = f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 +
|
|
521
|
+
f7g7_38 + f8g6_19 + f9g5_38;
|
|
522
|
+
int64_t h5 = f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 +
|
|
523
|
+
f8g7_19 + f9g6_19;
|
|
524
|
+
int64_t h6 = f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 +
|
|
525
|
+
f7g9_38 + f8g8_19 + f9g7_38;
|
|
526
|
+
int64_t h7 = f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 +
|
|
527
|
+
f8g9_19 + f9g8_19;
|
|
528
|
+
int64_t h8 = f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 +
|
|
529
|
+
f8g0 + f9g9_38;
|
|
530
|
+
int64_t h9 =
|
|
531
|
+
f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0;
|
|
532
|
+
|
|
533
|
+
int64_t carry0;
|
|
534
|
+
int64_t carry1;
|
|
535
|
+
int64_t carry2;
|
|
536
|
+
int64_t carry3;
|
|
537
|
+
int64_t carry4;
|
|
538
|
+
int64_t carry5;
|
|
539
|
+
int64_t carry6;
|
|
540
|
+
int64_t carry7;
|
|
541
|
+
int64_t carry8;
|
|
542
|
+
int64_t carry9;
|
|
543
|
+
|
|
544
|
+
/*
|
|
545
|
+
|h0| <= (1.65*1.65*2^52*(1+19+19+19+19)+1.65*1.65*2^50*(38+38+38+38+38))
|
|
546
|
+
i.e. |h0| <= 1.4*2^60; narrower ranges for h2, h4, h6, h8
|
|
547
|
+
|h1| <= (1.65*1.65*2^51*(1+1+19+19+19+19+19+19+19+19))
|
|
548
|
+
i.e. |h1| <= 1.7*2^59; narrower ranges for h3, h5, h7, h9
|
|
549
|
+
*/
|
|
550
|
+
|
|
551
|
+
carry0 = (h0 + (int64_t)(1L << 25)) >> 26;
|
|
552
|
+
h1 += carry0;
|
|
553
|
+
h0 -= carry0 * ((uint64_t) 1L << 26);
|
|
554
|
+
carry4 = (h4 + (int64_t)(1L << 25)) >> 26;
|
|
555
|
+
h5 += carry4;
|
|
556
|
+
h4 -= carry4 * ((uint64_t) 1L << 26);
|
|
557
|
+
/* |h0| <= 2^25 */
|
|
558
|
+
/* |h4| <= 2^25 */
|
|
559
|
+
/* |h1| <= 1.71*2^59 */
|
|
560
|
+
/* |h5| <= 1.71*2^59 */
|
|
561
|
+
|
|
562
|
+
carry1 = (h1 + (int64_t)(1L << 24)) >> 25;
|
|
563
|
+
h2 += carry1;
|
|
564
|
+
h1 -= carry1 * ((uint64_t) 1L << 25);
|
|
565
|
+
carry5 = (h5 + (int64_t)(1L << 24)) >> 25;
|
|
566
|
+
h6 += carry5;
|
|
567
|
+
h5 -= carry5 * ((uint64_t) 1L << 25);
|
|
568
|
+
/* |h1| <= 2^24; from now on fits into int32 */
|
|
569
|
+
/* |h5| <= 2^24; from now on fits into int32 */
|
|
570
|
+
/* |h2| <= 1.41*2^60 */
|
|
571
|
+
/* |h6| <= 1.41*2^60 */
|
|
572
|
+
|
|
573
|
+
carry2 = (h2 + (int64_t)(1L << 25)) >> 26;
|
|
574
|
+
h3 += carry2;
|
|
575
|
+
h2 -= carry2 * ((uint64_t) 1L << 26);
|
|
576
|
+
carry6 = (h6 + (int64_t)(1L << 25)) >> 26;
|
|
577
|
+
h7 += carry6;
|
|
578
|
+
h6 -= carry6 * ((uint64_t) 1L << 26);
|
|
579
|
+
/* |h2| <= 2^25; from now on fits into int32 unchanged */
|
|
580
|
+
/* |h6| <= 2^25; from now on fits into int32 unchanged */
|
|
581
|
+
/* |h3| <= 1.71*2^59 */
|
|
582
|
+
/* |h7| <= 1.71*2^59 */
|
|
583
|
+
|
|
584
|
+
carry3 = (h3 + (int64_t)(1L << 24)) >> 25;
|
|
585
|
+
h4 += carry3;
|
|
586
|
+
h3 -= carry3 * ((uint64_t) 1L << 25);
|
|
587
|
+
carry7 = (h7 + (int64_t)(1L << 24)) >> 25;
|
|
588
|
+
h8 += carry7;
|
|
589
|
+
h7 -= carry7 * ((uint64_t) 1L << 25);
|
|
590
|
+
/* |h3| <= 2^24; from now on fits into int32 unchanged */
|
|
591
|
+
/* |h7| <= 2^24; from now on fits into int32 unchanged */
|
|
592
|
+
/* |h4| <= 1.72*2^34 */
|
|
593
|
+
/* |h8| <= 1.41*2^60 */
|
|
594
|
+
|
|
595
|
+
carry4 = (h4 + (int64_t)(1L << 25)) >> 26;
|
|
596
|
+
h5 += carry4;
|
|
597
|
+
h4 -= carry4 * ((uint64_t) 1L << 26);
|
|
598
|
+
carry8 = (h8 + (int64_t)(1L << 25)) >> 26;
|
|
599
|
+
h9 += carry8;
|
|
600
|
+
h8 -= carry8 * ((uint64_t) 1L << 26);
|
|
601
|
+
/* |h4| <= 2^25; from now on fits into int32 unchanged */
|
|
602
|
+
/* |h8| <= 2^25; from now on fits into int32 unchanged */
|
|
603
|
+
/* |h5| <= 1.01*2^24 */
|
|
604
|
+
/* |h9| <= 1.71*2^59 */
|
|
605
|
+
|
|
606
|
+
carry9 = (h9 + (int64_t)(1L << 24)) >> 25;
|
|
607
|
+
h0 += carry9 * 19;
|
|
608
|
+
h9 -= carry9 * ((uint64_t) 1L << 25);
|
|
609
|
+
/* |h9| <= 2^24; from now on fits into int32 unchanged */
|
|
610
|
+
/* |h0| <= 1.1*2^39 */
|
|
611
|
+
|
|
612
|
+
carry0 = (h0 + (int64_t)(1L << 25)) >> 26;
|
|
613
|
+
h1 += carry0;
|
|
614
|
+
h0 -= carry0 * ((uint64_t) 1L << 26);
|
|
615
|
+
/* |h0| <= 2^25; from now on fits into int32 unchanged */
|
|
616
|
+
/* |h1| <= 1.01*2^24 */
|
|
617
|
+
|
|
618
|
+
h[0] = (int32_t) h0;
|
|
619
|
+
h[1] = (int32_t) h1;
|
|
620
|
+
h[2] = (int32_t) h2;
|
|
621
|
+
h[3] = (int32_t) h3;
|
|
622
|
+
h[4] = (int32_t) h4;
|
|
623
|
+
h[5] = (int32_t) h5;
|
|
624
|
+
h[6] = (int32_t) h6;
|
|
625
|
+
h[7] = (int32_t) h7;
|
|
626
|
+
h[8] = (int32_t) h8;
|
|
627
|
+
h[9] = (int32_t) h9;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/*
|
|
631
|
+
h = f * f
|
|
632
|
+
Can overlap h with f.
|
|
633
|
+
*
|
|
634
|
+
Preconditions:
|
|
635
|
+
|f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc.
|
|
636
|
+
*
|
|
637
|
+
Postconditions:
|
|
638
|
+
|h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc.
|
|
639
|
+
*/
|
|
640
|
+
|
|
641
|
+
static void
|
|
642
|
+
fe25519_sq(fe25519 h, const fe25519 f)
|
|
643
|
+
{
|
|
644
|
+
int32_t f0 = f[0];
|
|
645
|
+
int32_t f1 = f[1];
|
|
646
|
+
int32_t f2 = f[2];
|
|
647
|
+
int32_t f3 = f[3];
|
|
648
|
+
int32_t f4 = f[4];
|
|
649
|
+
int32_t f5 = f[5];
|
|
650
|
+
int32_t f6 = f[6];
|
|
651
|
+
int32_t f7 = f[7];
|
|
652
|
+
int32_t f8 = f[8];
|
|
653
|
+
int32_t f9 = f[9];
|
|
654
|
+
|
|
655
|
+
int32_t f0_2 = 2 * f0;
|
|
656
|
+
int32_t f1_2 = 2 * f1;
|
|
657
|
+
int32_t f2_2 = 2 * f2;
|
|
658
|
+
int32_t f3_2 = 2 * f3;
|
|
659
|
+
int32_t f4_2 = 2 * f4;
|
|
660
|
+
int32_t f5_2 = 2 * f5;
|
|
661
|
+
int32_t f6_2 = 2 * f6;
|
|
662
|
+
int32_t f7_2 = 2 * f7;
|
|
663
|
+
int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */
|
|
664
|
+
int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */
|
|
665
|
+
int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */
|
|
666
|
+
int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */
|
|
667
|
+
int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */
|
|
668
|
+
|
|
669
|
+
int64_t f0f0 = f0 * (int64_t) f0;
|
|
670
|
+
int64_t f0f1_2 = f0_2 * (int64_t) f1;
|
|
671
|
+
int64_t f0f2_2 = f0_2 * (int64_t) f2;
|
|
672
|
+
int64_t f0f3_2 = f0_2 * (int64_t) f3;
|
|
673
|
+
int64_t f0f4_2 = f0_2 * (int64_t) f4;
|
|
674
|
+
int64_t f0f5_2 = f0_2 * (int64_t) f5;
|
|
675
|
+
int64_t f0f6_2 = f0_2 * (int64_t) f6;
|
|
676
|
+
int64_t f0f7_2 = f0_2 * (int64_t) f7;
|
|
677
|
+
int64_t f0f8_2 = f0_2 * (int64_t) f8;
|
|
678
|
+
int64_t f0f9_2 = f0_2 * (int64_t) f9;
|
|
679
|
+
int64_t f1f1_2 = f1_2 * (int64_t) f1;
|
|
680
|
+
int64_t f1f2_2 = f1_2 * (int64_t) f2;
|
|
681
|
+
int64_t f1f3_4 = f1_2 * (int64_t) f3_2;
|
|
682
|
+
int64_t f1f4_2 = f1_2 * (int64_t) f4;
|
|
683
|
+
int64_t f1f5_4 = f1_2 * (int64_t) f5_2;
|
|
684
|
+
int64_t f1f6_2 = f1_2 * (int64_t) f6;
|
|
685
|
+
int64_t f1f7_4 = f1_2 * (int64_t) f7_2;
|
|
686
|
+
int64_t f1f8_2 = f1_2 * (int64_t) f8;
|
|
687
|
+
int64_t f1f9_76 = f1_2 * (int64_t) f9_38;
|
|
688
|
+
int64_t f2f2 = f2 * (int64_t) f2;
|
|
689
|
+
int64_t f2f3_2 = f2_2 * (int64_t) f3;
|
|
690
|
+
int64_t f2f4_2 = f2_2 * (int64_t) f4;
|
|
691
|
+
int64_t f2f5_2 = f2_2 * (int64_t) f5;
|
|
692
|
+
int64_t f2f6_2 = f2_2 * (int64_t) f6;
|
|
693
|
+
int64_t f2f7_2 = f2_2 * (int64_t) f7;
|
|
694
|
+
int64_t f2f8_38 = f2_2 * (int64_t) f8_19;
|
|
695
|
+
int64_t f2f9_38 = f2 * (int64_t) f9_38;
|
|
696
|
+
int64_t f3f3_2 = f3_2 * (int64_t) f3;
|
|
697
|
+
int64_t f3f4_2 = f3_2 * (int64_t) f4;
|
|
698
|
+
int64_t f3f5_4 = f3_2 * (int64_t) f5_2;
|
|
699
|
+
int64_t f3f6_2 = f3_2 * (int64_t) f6;
|
|
700
|
+
int64_t f3f7_76 = f3_2 * (int64_t) f7_38;
|
|
701
|
+
int64_t f3f8_38 = f3_2 * (int64_t) f8_19;
|
|
702
|
+
int64_t f3f9_76 = f3_2 * (int64_t) f9_38;
|
|
703
|
+
int64_t f4f4 = f4 * (int64_t) f4;
|
|
704
|
+
int64_t f4f5_2 = f4_2 * (int64_t) f5;
|
|
705
|
+
int64_t f4f6_38 = f4_2 * (int64_t) f6_19;
|
|
706
|
+
int64_t f4f7_38 = f4 * (int64_t) f7_38;
|
|
707
|
+
int64_t f4f8_38 = f4_2 * (int64_t) f8_19;
|
|
708
|
+
int64_t f4f9_38 = f4 * (int64_t) f9_38;
|
|
709
|
+
int64_t f5f5_38 = f5 * (int64_t) f5_38;
|
|
710
|
+
int64_t f5f6_38 = f5_2 * (int64_t) f6_19;
|
|
711
|
+
int64_t f5f7_76 = f5_2 * (int64_t) f7_38;
|
|
712
|
+
int64_t f5f8_38 = f5_2 * (int64_t) f8_19;
|
|
713
|
+
int64_t f5f9_76 = f5_2 * (int64_t) f9_38;
|
|
714
|
+
int64_t f6f6_19 = f6 * (int64_t) f6_19;
|
|
715
|
+
int64_t f6f7_38 = f6 * (int64_t) f7_38;
|
|
716
|
+
int64_t f6f8_38 = f6_2 * (int64_t) f8_19;
|
|
717
|
+
int64_t f6f9_38 = f6 * (int64_t) f9_38;
|
|
718
|
+
int64_t f7f7_38 = f7 * (int64_t) f7_38;
|
|
719
|
+
int64_t f7f8_38 = f7_2 * (int64_t) f8_19;
|
|
720
|
+
int64_t f7f9_76 = f7_2 * (int64_t) f9_38;
|
|
721
|
+
int64_t f8f8_19 = f8 * (int64_t) f8_19;
|
|
722
|
+
int64_t f8f9_38 = f8 * (int64_t) f9_38;
|
|
723
|
+
int64_t f9f9_38 = f9 * (int64_t) f9_38;
|
|
724
|
+
|
|
725
|
+
int64_t h0 = f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
|
|
726
|
+
int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
|
|
727
|
+
int64_t h2 = f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
|
|
728
|
+
int64_t h3 = f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38;
|
|
729
|
+
int64_t h4 = f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38;
|
|
730
|
+
int64_t h5 = f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38;
|
|
731
|
+
int64_t h6 = f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19;
|
|
732
|
+
int64_t h7 = f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38;
|
|
733
|
+
int64_t h8 = f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38;
|
|
734
|
+
int64_t h9 = f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2;
|
|
735
|
+
|
|
736
|
+
int64_t carry0;
|
|
737
|
+
int64_t carry1;
|
|
738
|
+
int64_t carry2;
|
|
739
|
+
int64_t carry3;
|
|
740
|
+
int64_t carry4;
|
|
741
|
+
int64_t carry5;
|
|
742
|
+
int64_t carry6;
|
|
743
|
+
int64_t carry7;
|
|
744
|
+
int64_t carry8;
|
|
745
|
+
int64_t carry9;
|
|
746
|
+
|
|
747
|
+
carry0 = (h0 + (int64_t)(1L << 25)) >> 26;
|
|
748
|
+
h1 += carry0;
|
|
749
|
+
h0 -= carry0 * ((uint64_t) 1L << 26);
|
|
750
|
+
carry4 = (h4 + (int64_t)(1L << 25)) >> 26;
|
|
751
|
+
h5 += carry4;
|
|
752
|
+
h4 -= carry4 * ((uint64_t) 1L << 26);
|
|
753
|
+
|
|
754
|
+
carry1 = (h1 + (int64_t)(1L << 24)) >> 25;
|
|
755
|
+
h2 += carry1;
|
|
756
|
+
h1 -= carry1 * ((uint64_t) 1L << 25);
|
|
757
|
+
carry5 = (h5 + (int64_t)(1L << 24)) >> 25;
|
|
758
|
+
h6 += carry5;
|
|
759
|
+
h5 -= carry5 * ((uint64_t) 1L << 25);
|
|
760
|
+
|
|
761
|
+
carry2 = (h2 + (int64_t)(1L << 25)) >> 26;
|
|
762
|
+
h3 += carry2;
|
|
763
|
+
h2 -= carry2 * ((uint64_t) 1L << 26);
|
|
764
|
+
carry6 = (h6 + (int64_t)(1L << 25)) >> 26;
|
|
765
|
+
h7 += carry6;
|
|
766
|
+
h6 -= carry6 * ((uint64_t) 1L << 26);
|
|
767
|
+
|
|
768
|
+
carry3 = (h3 + (int64_t)(1L << 24)) >> 25;
|
|
769
|
+
h4 += carry3;
|
|
770
|
+
h3 -= carry3 * ((uint64_t) 1L << 25);
|
|
771
|
+
carry7 = (h7 + (int64_t)(1L << 24)) >> 25;
|
|
772
|
+
h8 += carry7;
|
|
773
|
+
h7 -= carry7 * ((uint64_t) 1L << 25);
|
|
774
|
+
|
|
775
|
+
carry4 = (h4 + (int64_t)(1L << 25)) >> 26;
|
|
776
|
+
h5 += carry4;
|
|
777
|
+
h4 -= carry4 * ((uint64_t) 1L << 26);
|
|
778
|
+
carry8 = (h8 + (int64_t)(1L << 25)) >> 26;
|
|
779
|
+
h9 += carry8;
|
|
780
|
+
h8 -= carry8 * ((uint64_t) 1L << 26);
|
|
781
|
+
|
|
782
|
+
carry9 = (h9 + (int64_t)(1L << 24)) >> 25;
|
|
783
|
+
h0 += carry9 * 19;
|
|
784
|
+
h9 -= carry9 * ((uint64_t) 1L << 25);
|
|
785
|
+
|
|
786
|
+
carry0 = (h0 + (int64_t)(1L << 25)) >> 26;
|
|
787
|
+
h1 += carry0;
|
|
788
|
+
h0 -= carry0 * ((uint64_t) 1L << 26);
|
|
789
|
+
|
|
790
|
+
h[0] = (int32_t) h0;
|
|
791
|
+
h[1] = (int32_t) h1;
|
|
792
|
+
h[2] = (int32_t) h2;
|
|
793
|
+
h[3] = (int32_t) h3;
|
|
794
|
+
h[4] = (int32_t) h4;
|
|
795
|
+
h[5] = (int32_t) h5;
|
|
796
|
+
h[6] = (int32_t) h6;
|
|
797
|
+
h[7] = (int32_t) h7;
|
|
798
|
+
h[8] = (int32_t) h8;
|
|
799
|
+
h[9] = (int32_t) h9;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/*
|
|
803
|
+
h = 2 * f * f
|
|
804
|
+
Can overlap h with f.
|
|
805
|
+
*
|
|
806
|
+
Preconditions:
|
|
807
|
+
|f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc.
|
|
808
|
+
*
|
|
809
|
+
Postconditions:
|
|
810
|
+
|h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc.
|
|
811
|
+
*/
|
|
812
|
+
|
|
813
|
+
static void
|
|
814
|
+
fe25519_sq2(fe25519 h, const fe25519 f)
|
|
815
|
+
{
|
|
816
|
+
int32_t f0 = f[0];
|
|
817
|
+
int32_t f1 = f[1];
|
|
818
|
+
int32_t f2 = f[2];
|
|
819
|
+
int32_t f3 = f[3];
|
|
820
|
+
int32_t f4 = f[4];
|
|
821
|
+
int32_t f5 = f[5];
|
|
822
|
+
int32_t f6 = f[6];
|
|
823
|
+
int32_t f7 = f[7];
|
|
824
|
+
int32_t f8 = f[8];
|
|
825
|
+
int32_t f9 = f[9];
|
|
826
|
+
|
|
827
|
+
int32_t f0_2 = 2 * f0;
|
|
828
|
+
int32_t f1_2 = 2 * f1;
|
|
829
|
+
int32_t f2_2 = 2 * f2;
|
|
830
|
+
int32_t f3_2 = 2 * f3;
|
|
831
|
+
int32_t f4_2 = 2 * f4;
|
|
832
|
+
int32_t f5_2 = 2 * f5;
|
|
833
|
+
int32_t f6_2 = 2 * f6;
|
|
834
|
+
int32_t f7_2 = 2 * f7;
|
|
835
|
+
int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */
|
|
836
|
+
int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */
|
|
837
|
+
int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */
|
|
838
|
+
int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */
|
|
839
|
+
int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */
|
|
840
|
+
|
|
841
|
+
int64_t f0f0 = f0 * (int64_t) f0;
|
|
842
|
+
int64_t f0f1_2 = f0_2 * (int64_t) f1;
|
|
843
|
+
int64_t f0f2_2 = f0_2 * (int64_t) f2;
|
|
844
|
+
int64_t f0f3_2 = f0_2 * (int64_t) f3;
|
|
845
|
+
int64_t f0f4_2 = f0_2 * (int64_t) f4;
|
|
846
|
+
int64_t f0f5_2 = f0_2 * (int64_t) f5;
|
|
847
|
+
int64_t f0f6_2 = f0_2 * (int64_t) f6;
|
|
848
|
+
int64_t f0f7_2 = f0_2 * (int64_t) f7;
|
|
849
|
+
int64_t f0f8_2 = f0_2 * (int64_t) f8;
|
|
850
|
+
int64_t f0f9_2 = f0_2 * (int64_t) f9;
|
|
851
|
+
int64_t f1f1_2 = f1_2 * (int64_t) f1;
|
|
852
|
+
int64_t f1f2_2 = f1_2 * (int64_t) f2;
|
|
853
|
+
int64_t f1f3_4 = f1_2 * (int64_t) f3_2;
|
|
854
|
+
int64_t f1f4_2 = f1_2 * (int64_t) f4;
|
|
855
|
+
int64_t f1f5_4 = f1_2 * (int64_t) f5_2;
|
|
856
|
+
int64_t f1f6_2 = f1_2 * (int64_t) f6;
|
|
857
|
+
int64_t f1f7_4 = f1_2 * (int64_t) f7_2;
|
|
858
|
+
int64_t f1f8_2 = f1_2 * (int64_t) f8;
|
|
859
|
+
int64_t f1f9_76 = f1_2 * (int64_t) f9_38;
|
|
860
|
+
int64_t f2f2 = f2 * (int64_t) f2;
|
|
861
|
+
int64_t f2f3_2 = f2_2 * (int64_t) f3;
|
|
862
|
+
int64_t f2f4_2 = f2_2 * (int64_t) f4;
|
|
863
|
+
int64_t f2f5_2 = f2_2 * (int64_t) f5;
|
|
864
|
+
int64_t f2f6_2 = f2_2 * (int64_t) f6;
|
|
865
|
+
int64_t f2f7_2 = f2_2 * (int64_t) f7;
|
|
866
|
+
int64_t f2f8_38 = f2_2 * (int64_t) f8_19;
|
|
867
|
+
int64_t f2f9_38 = f2 * (int64_t) f9_38;
|
|
868
|
+
int64_t f3f3_2 = f3_2 * (int64_t) f3;
|
|
869
|
+
int64_t f3f4_2 = f3_2 * (int64_t) f4;
|
|
870
|
+
int64_t f3f5_4 = f3_2 * (int64_t) f5_2;
|
|
871
|
+
int64_t f3f6_2 = f3_2 * (int64_t) f6;
|
|
872
|
+
int64_t f3f7_76 = f3_2 * (int64_t) f7_38;
|
|
873
|
+
int64_t f3f8_38 = f3_2 * (int64_t) f8_19;
|
|
874
|
+
int64_t f3f9_76 = f3_2 * (int64_t) f9_38;
|
|
875
|
+
int64_t f4f4 = f4 * (int64_t) f4;
|
|
876
|
+
int64_t f4f5_2 = f4_2 * (int64_t) f5;
|
|
877
|
+
int64_t f4f6_38 = f4_2 * (int64_t) f6_19;
|
|
878
|
+
int64_t f4f7_38 = f4 * (int64_t) f7_38;
|
|
879
|
+
int64_t f4f8_38 = f4_2 * (int64_t) f8_19;
|
|
880
|
+
int64_t f4f9_38 = f4 * (int64_t) f9_38;
|
|
881
|
+
int64_t f5f5_38 = f5 * (int64_t) f5_38;
|
|
882
|
+
int64_t f5f6_38 = f5_2 * (int64_t) f6_19;
|
|
883
|
+
int64_t f5f7_76 = f5_2 * (int64_t) f7_38;
|
|
884
|
+
int64_t f5f8_38 = f5_2 * (int64_t) f8_19;
|
|
885
|
+
int64_t f5f9_76 = f5_2 * (int64_t) f9_38;
|
|
886
|
+
int64_t f6f6_19 = f6 * (int64_t) f6_19;
|
|
887
|
+
int64_t f6f7_38 = f6 * (int64_t) f7_38;
|
|
888
|
+
int64_t f6f8_38 = f6_2 * (int64_t) f8_19;
|
|
889
|
+
int64_t f6f9_38 = f6 * (int64_t) f9_38;
|
|
890
|
+
int64_t f7f7_38 = f7 * (int64_t) f7_38;
|
|
891
|
+
int64_t f7f8_38 = f7_2 * (int64_t) f8_19;
|
|
892
|
+
int64_t f7f9_76 = f7_2 * (int64_t) f9_38;
|
|
893
|
+
int64_t f8f8_19 = f8 * (int64_t) f8_19;
|
|
894
|
+
int64_t f8f9_38 = f8 * (int64_t) f9_38;
|
|
895
|
+
int64_t f9f9_38 = f9 * (int64_t) f9_38;
|
|
896
|
+
|
|
897
|
+
int64_t h0 = f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
|
|
898
|
+
int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
|
|
899
|
+
int64_t h2 = f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
|
|
900
|
+
int64_t h3 = f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38;
|
|
901
|
+
int64_t h4 = f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38;
|
|
902
|
+
int64_t h5 = f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38;
|
|
903
|
+
int64_t h6 = f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19;
|
|
904
|
+
int64_t h7 = f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38;
|
|
905
|
+
int64_t h8 = f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38;
|
|
906
|
+
int64_t h9 = f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2;
|
|
907
|
+
|
|
908
|
+
int64_t carry0;
|
|
909
|
+
int64_t carry1;
|
|
910
|
+
int64_t carry2;
|
|
911
|
+
int64_t carry3;
|
|
912
|
+
int64_t carry4;
|
|
913
|
+
int64_t carry5;
|
|
914
|
+
int64_t carry6;
|
|
915
|
+
int64_t carry7;
|
|
916
|
+
int64_t carry8;
|
|
917
|
+
int64_t carry9;
|
|
918
|
+
|
|
919
|
+
h0 += h0;
|
|
920
|
+
h1 += h1;
|
|
921
|
+
h2 += h2;
|
|
922
|
+
h3 += h3;
|
|
923
|
+
h4 += h4;
|
|
924
|
+
h5 += h5;
|
|
925
|
+
h6 += h6;
|
|
926
|
+
h7 += h7;
|
|
927
|
+
h8 += h8;
|
|
928
|
+
h9 += h9;
|
|
929
|
+
|
|
930
|
+
carry0 = (h0 + (int64_t)(1L << 25)) >> 26;
|
|
931
|
+
h1 += carry0;
|
|
932
|
+
h0 -= carry0 * ((uint64_t) 1L << 26);
|
|
933
|
+
carry4 = (h4 + (int64_t)(1L << 25)) >> 26;
|
|
934
|
+
h5 += carry4;
|
|
935
|
+
h4 -= carry4 * ((uint64_t) 1L << 26);
|
|
936
|
+
|
|
937
|
+
carry1 = (h1 + (int64_t)(1L << 24)) >> 25;
|
|
938
|
+
h2 += carry1;
|
|
939
|
+
h1 -= carry1 * ((uint64_t) 1L << 25);
|
|
940
|
+
carry5 = (h5 + (int64_t)(1L << 24)) >> 25;
|
|
941
|
+
h6 += carry5;
|
|
942
|
+
h5 -= carry5 * ((uint64_t) 1L << 25);
|
|
943
|
+
|
|
944
|
+
carry2 = (h2 + (int64_t)(1L << 25)) >> 26;
|
|
945
|
+
h3 += carry2;
|
|
946
|
+
h2 -= carry2 * ((uint64_t) 1L << 26);
|
|
947
|
+
carry6 = (h6 + (int64_t)(1L << 25)) >> 26;
|
|
948
|
+
h7 += carry6;
|
|
949
|
+
h6 -= carry6 * ((uint64_t) 1L << 26);
|
|
950
|
+
|
|
951
|
+
carry3 = (h3 + (int64_t)(1L << 24)) >> 25;
|
|
952
|
+
h4 += carry3;
|
|
953
|
+
h3 -= carry3 * ((uint64_t) 1L << 25);
|
|
954
|
+
carry7 = (h7 + (int64_t)(1L << 24)) >> 25;
|
|
955
|
+
h8 += carry7;
|
|
956
|
+
h7 -= carry7 * ((uint64_t) 1L << 25);
|
|
957
|
+
|
|
958
|
+
carry4 = (h4 + (int64_t)(1L << 25)) >> 26;
|
|
959
|
+
h5 += carry4;
|
|
960
|
+
h4 -= carry4 * ((uint64_t) 1L << 26);
|
|
961
|
+
carry8 = (h8 + (int64_t)(1L << 25)) >> 26;
|
|
962
|
+
h9 += carry8;
|
|
963
|
+
h8 -= carry8 * ((uint64_t) 1L << 26);
|
|
964
|
+
|
|
965
|
+
carry9 = (h9 + (int64_t)(1L << 24)) >> 25;
|
|
966
|
+
h0 += carry9 * 19;
|
|
967
|
+
h9 -= carry9 * ((uint64_t) 1L << 25);
|
|
968
|
+
|
|
969
|
+
carry0 = (h0 + (int64_t)(1L << 25)) >> 26;
|
|
970
|
+
h1 += carry0;
|
|
971
|
+
h0 -= carry0 * ((uint64_t) 1L << 26);
|
|
972
|
+
|
|
973
|
+
h[0] = (int32_t) h0;
|
|
974
|
+
h[1] = (int32_t) h1;
|
|
975
|
+
h[2] = (int32_t) h2;
|
|
976
|
+
h[3] = (int32_t) h3;
|
|
977
|
+
h[4] = (int32_t) h4;
|
|
978
|
+
h[5] = (int32_t) h5;
|
|
979
|
+
h[6] = (int32_t) h6;
|
|
980
|
+
h[7] = (int32_t) h7;
|
|
981
|
+
h[8] = (int32_t) h8;
|
|
982
|
+
h[9] = (int32_t) h9;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
static void
|
|
986
|
+
fe25519_mul32(fe25519 h, const fe25519 f, uint32_t n)
|
|
987
|
+
{
|
|
988
|
+
int64_t sn = (int64_t) n;
|
|
989
|
+
int32_t f0 = f[0];
|
|
990
|
+
int32_t f1 = f[1];
|
|
991
|
+
int32_t f2 = f[2];
|
|
992
|
+
int32_t f3 = f[3];
|
|
993
|
+
int32_t f4 = f[4];
|
|
994
|
+
int32_t f5 = f[5];
|
|
995
|
+
int32_t f6 = f[6];
|
|
996
|
+
int32_t f7 = f[7];
|
|
997
|
+
int32_t f8 = f[8];
|
|
998
|
+
int32_t f9 = f[9];
|
|
999
|
+
int64_t h0 = f0 * sn;
|
|
1000
|
+
int64_t h1 = f1 * sn;
|
|
1001
|
+
int64_t h2 = f2 * sn;
|
|
1002
|
+
int64_t h3 = f3 * sn;
|
|
1003
|
+
int64_t h4 = f4 * sn;
|
|
1004
|
+
int64_t h5 = f5 * sn;
|
|
1005
|
+
int64_t h6 = f6 * sn;
|
|
1006
|
+
int64_t h7 = f7 * sn;
|
|
1007
|
+
int64_t h8 = f8 * sn;
|
|
1008
|
+
int64_t h9 = f9 * sn;
|
|
1009
|
+
int64_t carry0, carry1, carry2, carry3, carry4, carry5, carry6, carry7,
|
|
1010
|
+
carry8, carry9;
|
|
1011
|
+
|
|
1012
|
+
carry9 = (h9 + ((int64_t) 1 << 24)) >> 25;
|
|
1013
|
+
h0 += carry9 * 19;
|
|
1014
|
+
h9 -= carry9 * ((int64_t) 1 << 25);
|
|
1015
|
+
carry1 = (h1 + ((int64_t) 1 << 24)) >> 25;
|
|
1016
|
+
h2 += carry1;
|
|
1017
|
+
h1 -= carry1 * ((int64_t) 1 << 25);
|
|
1018
|
+
carry3 = (h3 + ((int64_t) 1 << 24)) >> 25;
|
|
1019
|
+
h4 += carry3;
|
|
1020
|
+
h3 -= carry3 * ((int64_t) 1 << 25);
|
|
1021
|
+
carry5 = (h5 + ((int64_t) 1 << 24)) >> 25;
|
|
1022
|
+
h6 += carry5;
|
|
1023
|
+
h5 -= carry5 * ((int64_t) 1 << 25);
|
|
1024
|
+
carry7 = (h7 + ((int64_t) 1 << 24)) >> 25;
|
|
1025
|
+
h8 += carry7;
|
|
1026
|
+
h7 -= carry7 * ((int64_t) 1 << 25);
|
|
1027
|
+
|
|
1028
|
+
carry0 = (h0 + ((int64_t) 1 << 25)) >> 26;
|
|
1029
|
+
h1 += carry0;
|
|
1030
|
+
h0 -= carry0 * ((int64_t) 1 << 26);
|
|
1031
|
+
carry2 = (h2 + ((int64_t) 1 << 25)) >> 26;
|
|
1032
|
+
h3 += carry2;
|
|
1033
|
+
h2 -= carry2 * ((int64_t) 1 << 26);
|
|
1034
|
+
carry4 = (h4 + ((int64_t) 1 << 25)) >> 26;
|
|
1035
|
+
h5 += carry4;
|
|
1036
|
+
h4 -= carry4 * ((int64_t) 1 << 26);
|
|
1037
|
+
carry6 = (h6 + ((int64_t) 1 << 25)) >> 26;
|
|
1038
|
+
h7 += carry6;
|
|
1039
|
+
h6 -= carry6 * ((int64_t) 1 << 26);
|
|
1040
|
+
carry8 = (h8 + ((int64_t) 1 << 25)) >> 26;
|
|
1041
|
+
h9 += carry8;
|
|
1042
|
+
h8 -= carry8 * ((int64_t) 1 << 26);
|
|
1043
|
+
|
|
1044
|
+
h[0] = (int32_t) h0;
|
|
1045
|
+
h[1] = (int32_t) h1;
|
|
1046
|
+
h[2] = (int32_t) h2;
|
|
1047
|
+
h[3] = (int32_t) h3;
|
|
1048
|
+
h[4] = (int32_t) h4;
|
|
1049
|
+
h[5] = (int32_t) h5;
|
|
1050
|
+
h[6] = (int32_t) h6;
|
|
1051
|
+
h[7] = (int32_t) h7;
|
|
1052
|
+
h[8] = (int32_t) h8;
|
|
1053
|
+
h[9] = (int32_t) h9;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
#endif
|