├── CMakeLists.txt ├── CMakeLists_IOS.txt ├── Dockerfile ├── Doxyfile ├── LICENSE ├── Makefile ├── README.md ├── cmake ├── CheckLinkerFlag.c ├── CheckLinkerFlag.cmake ├── CheckTrezor.cmake ├── Doxyfile.in ├── Doxygen.extra.css.in ├── FindBacktrace.cmake ├── FindCcache.cmake ├── FindHIDAPI.cmake ├── FindLibUSB.cmake ├── FindLibunwind.cmake ├── FindMiniupnpc.cmake ├── FindReadline.cmake ├── FindSodium.cmake ├── FindUnbound.cmake ├── GitVersion.cmake ├── SetClangTidy.cmake ├── Version.cmake ├── test-libusb-version.c ├── test-protobuf.cpp ├── test-protobuf.proto ├── test-static-assert.c └── test-static-assert.cpp ├── contrib ├── CMakeLists.txt ├── brew │ └── Brewfile ├── depends │ ├── Makefile │ ├── README.md │ ├── builders │ │ ├── darwin.mk │ │ ├── default.mk │ │ └── linux.mk │ ├── config.guess │ ├── config.sub │ ├── description.md │ ├── funcs.mk │ ├── hosts │ │ ├── android.mk │ │ ├── darwin.mk │ │ ├── default.mk │ │ ├── freebsd.mk │ │ ├── linux.mk │ │ └── mingw32.mk │ ├── packages.md │ ├── packages │ │ ├── android_ndk.mk │ │ ├── boost.mk │ │ ├── darwin_sdk.mk │ │ ├── freebsd_base.mk │ │ ├── hidapi.mk │ │ ├── libusb.mk │ │ ├── native_cctools.mk │ │ ├── native_libtapi.mk │ │ ├── native_protobuf.mk │ │ ├── ncurses.mk │ │ ├── openssl.mk │ │ ├── packages.mk │ │ ├── protobuf.mk │ │ ├── readline.mk │ │ ├── sodium.mk │ │ ├── unbound.mk │ │ └── zeromq.mk │ ├── patches │ │ ├── native_cctools │ │ │ └── no-build-date.patch │ │ ├── native_libtapi │ │ │ └── no_embed_git_rev.patch │ │ ├── ncurses │ │ │ └── fallback.c │ │ ├── openssl │ │ │ └── fix-android.patch │ │ └── unbound │ │ │ └── no-expat.patch │ └── toolchain.cmake.in ├── epee │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── README.md │ ├── include │ │ ├── byte_slice.h │ │ ├── byte_stream.h │ │ ├── console_handler.h │ │ ├── file_io_utils.h │ │ ├── fnv1.h │ │ ├── hex.h │ │ ├── include_base_utils.h │ │ ├── int-util.h │ │ ├── math_helper.h │ │ ├── memwipe.h │ │ ├── misc_language.h │ │ ├── misc_log_ex.h │ │ ├── mlocker.h │ │ ├── net │ │ │ ├── abstract_http_client.h │ │ │ ├── abstract_tcp_server2.h │ │ │ ├── abstract_tcp_server2.inl │ │ │ ├── buffer.h │ │ │ ├── connection_basic.hpp │ │ │ ├── enums.h │ │ │ ├── http_auth.h │ │ │ ├── http_base.h │ │ │ ├── http_client.h │ │ │ ├── http_client_base.h │ │ │ ├── http_protocol_handler.h │ │ │ ├── http_protocol_handler.inl │ │ │ ├── http_server_handlers_map2.h │ │ │ ├── http_server_impl_base.h │ │ │ ├── jsonrpc_structs.h │ │ │ ├── levin_base.h │ │ │ ├── levin_protocol_handler_async.h │ │ │ ├── local_ip.h │ │ │ ├── net_helper.h │ │ │ ├── net_parse_helpers.h │ │ │ ├── net_ssl.h │ │ │ ├── net_utils_base.h │ │ │ ├── network_throttle-detail.hpp │ │ │ └── network_throttle.hpp │ │ ├── profile_tools.h │ │ ├── readline_buffer.h │ │ ├── rolling_median.h │ │ ├── serialization │ │ │ ├── keyvalue_serialization.h │ │ │ ├── keyvalue_serialization_overloads.h │ │ │ ├── wire.h │ │ │ └── wire │ │ │ │ ├── adapted │ │ │ │ ├── list.h │ │ │ │ └── vector.h │ │ │ │ ├── error.h │ │ │ │ ├── field.h │ │ │ │ ├── fwd.h │ │ │ │ ├── traits.h │ │ │ │ ├── wrapper │ │ │ │ └── defaulted.h │ │ │ │ └── write.h │ │ ├── span.h │ │ ├── stats.h │ │ ├── stats.inl │ │ ├── storages │ │ │ ├── http_abstract_invoke.h │ │ │ ├── levin_abstract_invoke2.h │ │ │ ├── parserse_base_utils.h │ │ │ ├── portable_storage.h │ │ │ ├── portable_storage_base.h │ │ │ ├── portable_storage_bin_utils.h │ │ │ ├── portable_storage_from_bin.h │ │ │ ├── portable_storage_from_json.h │ │ │ ├── portable_storage_template_helper.h │ │ │ ├── portable_storage_to_bin.h │ │ │ ├── portable_storage_to_json.h │ │ │ └── portable_storage_val_converters.h │ │ ├── string_coding.h │ │ ├── string_tools.h │ │ ├── string_tools_lexical.h │ │ ├── syncobj.h │ │ ├── time_helper.h │ │ ├── warnings.h │ │ └── wipeable_string.h │ └── src │ │ ├── CMakeLists.txt │ │ ├── abstract_http_client.cpp │ │ ├── buffer.cpp │ │ ├── byte_slice.cpp │ │ ├── byte_stream.cpp │ │ ├── connection_basic.cpp │ │ ├── file_io_utils.cpp │ │ ├── hex.cpp │ │ ├── http_auth.cpp │ │ ├── int-util.cpp │ │ ├── levin_base.cpp │ │ ├── memwipe.c │ │ ├── misc_language.cpp │ │ ├── mlocker.cpp │ │ ├── mlog.cpp │ │ ├── net_helper.cpp │ │ ├── net_parse_helpers.cpp │ │ ├── net_ssl.cpp │ │ ├── net_utils_base.cpp │ │ ├── network_throttle-detail.cpp │ │ ├── network_throttle.cpp │ │ ├── parserse_base_utils.cpp │ │ ├── portable_storage.cpp │ │ ├── readline_buffer.cpp │ │ ├── string_tools.cpp │ │ └── wipeable_string.cpp ├── fuzz_testing │ └── fuzz.sh ├── guix │ ├── INSTALL.md │ ├── README.md │ ├── guix-attest │ ├── guix-build │ ├── guix-clean │ ├── guix-verify │ ├── libexec │ │ ├── build.sh │ │ └── prelude.bash │ ├── manifest.scm │ └── patches │ │ ├── gcc-remap-guix-store.patch │ │ ├── glibc-2.27-guix-prefix.patch │ │ ├── glibc-2.27-no-librt.patch │ │ ├── glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch │ │ ├── glibc-2.27-riscv64-fix-incorrect-jal-with-HIDDEN_JUMPTARGET.patch │ │ └── winpthreads-remap-guix-store.patch ├── lsan │ └── lsan.supp ├── rlwrap │ ├── monerocommands_bitmonerod.txt │ └── monerocommands_monero-wallet-cli.txt ├── shell │ └── git-utils.bash ├── tor │ └── monero-over-tor.sh └── valgrind │ └── monero.supp ├── docs ├── ANONYMITY_NETWORKS.md ├── COMPILING_DEBUGGING_TESTING.md ├── CONTRIBUTING.md ├── LEVIN_PROTOCOL.md ├── PORTABLE_STORAGE.md ├── README.i18n.md ├── RELEASE_CHECKLIST.md ├── ZMQ.md └── schema │ ├── pub_chain_full.json │ ├── pub_chain_minimal.json │ ├── pub_miner_full.json │ ├── pub_txpool_full.json │ └── pub_txpool_minimal.json ├── external ├── CMakeLists.txt ├── boost │ └── archive │ │ ├── portable_binary_archive.hpp │ │ ├── portable_binary_iarchive.hpp │ │ └── portable_binary_oarchive.hpp ├── db_drivers │ ├── CMakeLists.txt │ └── liblmdb │ │ ├── CHANGES │ │ ├── CMakeLists.txt │ │ ├── COPYRIGHT │ │ ├── Doxyfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── intro.doc │ │ ├── lmdb.h │ │ ├── mdb.c │ │ ├── mdb_copy.1 │ │ ├── mdb_copy.c │ │ ├── mdb_drop.1 │ │ ├── mdb_drop.c │ │ ├── mdb_dump.1 │ │ ├── mdb_dump.c │ │ ├── mdb_load.1 │ │ ├── mdb_load.c │ │ ├── mdb_stat.1 │ │ ├── mdb_stat.c │ │ ├── midl.c │ │ ├── midl.h │ │ ├── mtest.c │ │ ├── mtest2.c │ │ ├── mtest3.c │ │ ├── mtest4.c │ │ ├── mtest5.c │ │ ├── mtest6.c │ │ ├── sample-bdb.txt │ │ ├── sample-mdb.txt │ │ └── tooltag ├── easylogging++ │ ├── CMakeLists.txt │ ├── ea_config.h │ ├── easylogging++.cc │ └── easylogging++.h └── qrcodegen │ ├── CMakeLists.txt │ ├── QrCode.cpp │ └── QrCode.hpp ├── src ├── CMakeLists.txt ├── blockchain_db │ ├── CMakeLists.txt │ ├── blockchain_db.cpp │ ├── blockchain_db.h │ ├── lmdb │ │ ├── db_lmdb.cpp │ │ └── db_lmdb.h │ ├── locked_txn.h │ └── testdb.h ├── blockchain_utilities │ ├── CMakeLists.txt │ ├── README.md │ ├── blockchain-stats-readme.md │ ├── blockchain_ancestry.cpp │ ├── blockchain_blackball.cpp │ ├── blockchain_depth.cpp │ ├── blockchain_export.cpp │ ├── blockchain_import.cpp │ ├── blockchain_prune.cpp │ ├── blockchain_prune_known_spent_data.cpp │ ├── blockchain_stats.cpp │ ├── blockchain_usage.cpp │ ├── blockchain_utilities.h │ ├── blocksdat_file.cpp │ ├── blocksdat_file.h │ ├── bootstrap_file.cpp │ ├── bootstrap_file.h │ └── bootstrap_serialization.h ├── blocks │ ├── CMakeLists.txt │ ├── blocks.cpp │ ├── blocks.h │ ├── checkpoints.dat │ ├── stagenet_blocks.dat │ └── testnet_blocks.dat ├── checkpoints │ ├── CMakeLists.txt │ ├── checkpoints.cpp │ └── checkpoints.h ├── common │ ├── CMakeLists.txt │ ├── aligned.c │ ├── aligned.h │ ├── apply_permutation.h │ ├── base58.cpp │ ├── base58.h │ ├── combinator.cpp │ ├── combinator.h │ ├── command_line.cpp │ ├── command_line.h │ ├── common_fwd.h │ ├── container_helpers.h │ ├── data_cache.h │ ├── dns_utils.cpp │ ├── dns_utils.h │ ├── download.cpp │ ├── download.h │ ├── error.cpp │ ├── error.h │ ├── expect.cpp │ ├── expect.h │ ├── http_connection.h │ ├── i18n.cpp │ ├── i18n.h │ ├── json_util.h │ ├── notify.cpp │ ├── notify.h │ ├── password.cpp │ ├── password.h │ ├── perf_timer.cpp │ ├── perf_timer.h │ ├── pod-class.h │ ├── powerof.h │ ├── pruning.cpp │ ├── pruning.h │ ├── rpc_client.h │ ├── scoped_message_writer.h │ ├── sfinae_helpers.h │ ├── spawn.cpp │ ├── spawn.h │ ├── stack_trace.cpp │ ├── stack_trace.h │ ├── threadpool.cpp │ ├── threadpool.h │ ├── timings.cc │ ├── timings.h │ ├── unordered_containers_boost_serialization.h │ ├── updates.cpp │ ├── updates.h │ ├── utf8.h │ ├── util.cpp │ ├── util.h │ ├── va_args.h │ ├── variant.h │ └── varint.h ├── crypto │ ├── CMakeLists.txt │ ├── CryptonightR_JIT.c │ ├── CryptonightR_JIT.h │ ├── CryptonightR_template.S │ ├── CryptonightR_template.h │ ├── aesb.c │ ├── blake256.c │ ├── blake256.h │ ├── blake2b.c │ ├── blake2b.h │ ├── c_threads.h │ ├── chacha.c │ ├── chacha.h │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-ops.h │ ├── crypto.cpp │ ├── crypto.h │ ├── crypto_ops_builder │ │ ├── Makefile │ │ ├── README.md │ │ ├── api.h │ │ ├── crypto-ops-data.c │ │ ├── crypto-ops-old.c │ │ ├── crypto-ops.h │ │ ├── crypto_int32.h │ │ ├── crypto_sign.h │ │ ├── crypto_uint32.h │ │ ├── crypto_verify_32.h │ │ ├── ietf.txt │ │ ├── include │ │ │ ├── Makefile.am │ │ │ ├── libsodium_LICENSE │ │ │ ├── sodium.h │ │ │ └── sodium │ │ │ │ ├── crypto_int32.h │ │ │ │ ├── crypto_int64.h │ │ │ │ ├── crypto_uint16.h │ │ │ │ ├── crypto_uint32.h │ │ │ │ ├── crypto_uint64.h │ │ │ │ ├── crypto_uint8.h │ │ │ │ ├── crypto_verify_32.h │ │ │ │ └── randombytes.h │ │ ├── randombytes.c │ │ ├── ref10 │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── api.h │ │ │ ├── base.h │ │ │ ├── base.py │ │ │ ├── base2.h │ │ │ ├── base2.py │ │ │ ├── d.h │ │ │ ├── d.py │ │ │ ├── d2.h │ │ │ ├── d2.py │ │ │ ├── description │ │ │ ├── designers │ │ │ ├── fe.h │ │ │ ├── fe_0.c │ │ │ ├── fe_1.c │ │ │ ├── fe_add.c │ │ │ ├── fe_cmov.c │ │ │ ├── fe_copy.c │ │ │ ├── fe_frombytes.c │ │ │ ├── fe_invert.c │ │ │ ├── fe_isnegative.c │ │ │ ├── fe_isnonzero.c │ │ │ ├── fe_mul.c │ │ │ ├── fe_neg.c │ │ │ ├── fe_pow22523.c │ │ │ ├── fe_sq.c │ │ │ ├── fe_sq2.c │ │ │ ├── fe_sub.c │ │ │ ├── fe_tobytes.c │ │ │ ├── ge.h │ │ │ ├── ge_add.c │ │ │ ├── ge_add.h │ │ │ ├── ge_add.q │ │ │ ├── ge_double_scalarmult.c │ │ │ ├── ge_frombytes.c │ │ │ ├── ge_madd.c │ │ │ ├── ge_madd.h │ │ │ ├── ge_madd.q │ │ │ ├── ge_msub.c │ │ │ ├── ge_msub.h │ │ │ ├── ge_msub.q │ │ │ ├── ge_p1p1_to_p2.c │ │ │ ├── ge_p1p1_to_p3.c │ │ │ ├── ge_p2_0.c │ │ │ ├── ge_p2_dbl.c │ │ │ ├── ge_p2_dbl.h │ │ │ ├── ge_p2_dbl.q │ │ │ ├── ge_p3_0.c │ │ │ ├── ge_p3_dbl.c │ │ │ ├── ge_p3_to_cached.c │ │ │ ├── ge_p3_to_p2.c │ │ │ ├── ge_p3_tobytes.c │ │ │ ├── ge_precomp_0.c │ │ │ ├── ge_scalarmult_base.c │ │ │ ├── ge_sub.c │ │ │ ├── ge_sub.h │ │ │ ├── ge_sub.q │ │ │ ├── ge_tobytes.c │ │ │ ├── keypair.c │ │ │ ├── open.c │ │ │ ├── pow22523.h │ │ │ ├── pow22523.q │ │ │ ├── pow225521.h │ │ │ ├── pow225521.q │ │ │ ├── q2h.sh │ │ │ ├── sc.h │ │ │ ├── sc_muladd.c │ │ │ ├── sc_reduce.c │ │ │ ├── sign.c │ │ │ ├── sqrtm1.h │ │ │ └── sqrtm1.py │ │ ├── ref10CommentedCombined │ │ │ ├── MakeCryptoOps.py │ │ │ ├── api.h │ │ │ ├── base.h │ │ │ ├── base.py │ │ │ ├── base2.h │ │ │ ├── base2.py │ │ │ ├── crypto-ops.h │ │ │ ├── d.h │ │ │ ├── d.py │ │ │ ├── d2.h │ │ │ ├── d2.py │ │ │ ├── description │ │ │ ├── designers │ │ │ ├── fe.h │ │ │ ├── fe_0.c │ │ │ ├── fe_1.c │ │ │ ├── fe_add.c │ │ │ ├── fe_cmov.c │ │ │ ├── fe_copy.c │ │ │ ├── fe_frombytes.c │ │ │ ├── fe_invert.c │ │ │ ├── fe_isnegative.c │ │ │ ├── fe_isnonzero.c │ │ │ ├── fe_mul.c │ │ │ ├── fe_neg.c │ │ │ ├── fe_pow22523.c │ │ │ ├── fe_sq.c │ │ │ ├── fe_sq2.c │ │ │ ├── fe_sub.c │ │ │ ├── fe_tobytes.c │ │ │ ├── ge.h │ │ │ ├── ge_add.c │ │ │ ├── ge_add.h │ │ │ ├── ge_add.q │ │ │ ├── ge_double_scalarmult.c │ │ │ ├── ge_frombytes.c │ │ │ ├── ge_madd.c │ │ │ ├── ge_madd.h │ │ │ ├── ge_madd.q │ │ │ ├── ge_msub.c │ │ │ ├── ge_msub.h │ │ │ ├── ge_msub.q │ │ │ ├── ge_p1p1_to_p2.c │ │ │ ├── ge_p1p1_to_p3.c │ │ │ ├── ge_p2_0.c │ │ │ ├── ge_p2_dbl.c │ │ │ ├── ge_p2_dbl.h │ │ │ ├── ge_p2_dbl.q │ │ │ ├── ge_p3_0.c │ │ │ ├── ge_p3_dbl.c │ │ │ ├── ge_p3_to_cached.c │ │ │ ├── ge_p3_to_p2.c │ │ │ ├── ge_p3_tobytes.c │ │ │ ├── ge_precomp_0.c │ │ │ ├── ge_scalarmult_base.c │ │ │ ├── ge_sub.c │ │ │ ├── ge_sub.h │ │ │ ├── ge_sub.q │ │ │ ├── ge_tobytes.c │ │ │ ├── keypair.c │ │ │ ├── open.c │ │ │ ├── pow22523.h │ │ │ ├── pow22523.q │ │ │ ├── pow225521.h │ │ │ ├── pow225521.q │ │ │ ├── q2h.sh │ │ │ ├── sc.h │ │ │ ├── sc_muladd.c │ │ │ ├── sc_reduce.c │ │ │ ├── sc_sub.xmr.c │ │ │ ├── scrap.txt │ │ │ ├── sign.c │ │ │ ├── sqrtm1.h │ │ │ ├── sqrtm1.py │ │ │ ├── test.py │ │ │ └── xmrSpecificOld.c │ │ ├── sha512-blocks.c │ │ ├── sha512-hash.c │ │ ├── sha512.h │ │ └── verify.c │ ├── duration.h │ ├── generators.cpp │ ├── generators.h │ ├── generic-ops.h │ ├── groestl.c │ ├── groestl.h │ ├── groestl_tables.h │ ├── hash-extra-blake.c │ ├── hash-extra-groestl.c │ ├── hash-extra-jh.c │ ├── hash-extra-skein.c │ ├── hash-ops.h │ ├── hash.c │ ├── hash.h │ ├── hmac-keccak.c │ ├── hmac-keccak.h │ ├── initializer.h │ ├── jh.c │ ├── jh.h │ ├── keccak.c │ ├── keccak.h │ ├── oaes_lib.c │ ├── oaes_lib.h │ ├── random.c │ ├── random.h │ ├── rx-slow-hash.c │ ├── skein.c │ ├── skein.h │ ├── skein_port.h │ ├── slow-hash.c │ ├── tree-hash.c │ ├── variant2_int_sqrt.h │ ├── variant4_random_math.h │ └── wallet │ │ ├── CMakeLists.txt │ │ ├── crypto.h │ │ └── empty.h.in ├── cryptonote_basic │ ├── CMakeLists.txt │ ├── account.cpp │ ├── account.h │ ├── account_boost_serialization.h │ ├── account_generators.h │ ├── blobdatatype.h │ ├── connection_context.cpp │ ├── connection_context.h │ ├── cryptonote_basic.h │ ├── cryptonote_basic_impl.cpp │ ├── cryptonote_basic_impl.h │ ├── cryptonote_boost_serialization.h │ ├── cryptonote_format_utils.cpp │ ├── cryptonote_format_utils.h │ ├── cryptonote_format_utils_basic.cpp │ ├── difficulty.cpp │ ├── difficulty.h │ ├── events.h │ ├── fwd.h │ ├── hardfork.cpp │ ├── hardfork.h │ ├── merge_mining.cpp │ ├── merge_mining.h │ ├── miner.cpp │ ├── miner.h │ ├── subaddress_index.h │ ├── tx_extra.h │ └── verification_context.h ├── cryptonote_config.h ├── cryptonote_core │ ├── CMakeLists.txt │ ├── blockchain.cpp │ ├── blockchain.h │ ├── blockchain_and_pool.h │ ├── blockchain_storage_boost_serialization.h │ ├── cryptonote_core.cpp │ ├── cryptonote_core.h │ ├── cryptonote_tx_utils.cpp │ ├── cryptonote_tx_utils.h │ ├── i_core_events.h │ ├── tx_pool.cpp │ ├── tx_pool.h │ ├── tx_sanity_check.cpp │ ├── tx_sanity_check.h │ ├── tx_verification_utils.cpp │ └── tx_verification_utils.h ├── cryptonote_protocol │ ├── CMakeLists.txt │ ├── block_queue.cpp │ ├── block_queue.h │ ├── cryptonote_protocol_defs.h │ ├── cryptonote_protocol_handler-base.cpp │ ├── cryptonote_protocol_handler.h │ ├── cryptonote_protocol_handler.inl │ ├── cryptonote_protocol_handler_common.h │ ├── enums.h │ ├── fwd.h │ ├── levin_notify.cpp │ └── levin_notify.h ├── daemon │ ├── CMakeLists.txt │ ├── command_line_args.h │ ├── command_parser_executor.cpp │ ├── command_parser_executor.h │ ├── command_server.cpp │ ├── command_server.h │ ├── core.h │ ├── daemon.cpp │ ├── daemon.h │ ├── executor.cpp │ ├── executor.h │ ├── main.cpp │ ├── p2p.h │ ├── protocol.h │ ├── rpc.h │ ├── rpc_command_executor.cpp │ └── rpc_command_executor.h ├── daemonizer │ ├── CMakeLists.txt │ ├── daemonizer.h │ ├── posix_daemonizer.inl │ ├── posix_fork.cpp │ ├── posix_fork.h │ ├── windows_daemonizer.inl │ ├── windows_service.cpp │ ├── windows_service.h │ └── windows_service_runner.h ├── debug_utilities │ ├── CMakeLists.txt │ ├── cn_deserialize.cpp │ ├── dns_checks.cpp │ └── object_sizes.cpp ├── device │ ├── CMakeLists.txt │ ├── device.cpp │ ├── device.hpp │ ├── device_cold.hpp │ ├── device_default.cpp │ ├── device_default.hpp │ ├── device_io.hpp │ ├── device_io_hid.cpp │ ├── device_io_hid.hpp │ ├── device_ledger.cpp │ ├── device_ledger.hpp │ ├── log.cpp │ └── log.hpp ├── device_trezor │ ├── CMakeLists.txt │ ├── README.md │ ├── device_trezor.cpp │ ├── device_trezor.hpp │ ├── device_trezor_base.cpp │ ├── device_trezor_base.hpp │ ├── trezor.hpp │ └── trezor │ │ ├── debug_link.cpp │ │ ├── debug_link.hpp │ │ ├── exceptions.hpp │ │ ├── fetch_protob.sh │ │ ├── messages_map.cpp │ │ ├── messages_map.hpp │ │ ├── protob │ │ ├── COPYING │ │ ├── messages-common.proto │ │ ├── messages-debug.proto │ │ ├── messages-management.proto │ │ ├── messages-monero.proto │ │ └── messages.proto │ │ ├── protocol.cpp │ │ ├── protocol.hpp │ │ ├── transport.cpp │ │ ├── transport.hpp │ │ └── trezor_defs.hpp ├── gen_multisig │ ├── CMakeLists.txt │ └── gen_multisig.cpp ├── gen_ssl_cert │ ├── CMakeLists.txt │ └── gen_ssl_cert.cpp ├── hardforks │ ├── CMakeLists.txt │ ├── hardforks.cpp │ └── hardforks.h ├── lmdb │ ├── CMakeLists.txt │ ├── database.cpp │ ├── database.h │ ├── error.cpp │ ├── error.h │ ├── key_stream.h │ ├── table.cpp │ ├── table.h │ ├── transaction.h │ ├── util.h │ ├── value_stream.cpp │ └── value_stream.h ├── mnemonics │ ├── CMakeLists.txt │ ├── chinese_simplified.h │ ├── dutch.h │ ├── electrum-words.cpp │ ├── electrum-words.h │ ├── english.h │ ├── english_old.h │ ├── esperanto.h │ ├── french.h │ ├── german.h │ ├── italian.h │ ├── japanese.h │ ├── language_base.h │ ├── lojban.h │ ├── portuguese.h │ ├── russian.h │ ├── singleton.h │ └── spanish.h ├── multisig │ ├── CMakeLists.txt │ ├── multisig.cpp │ ├── multisig.h │ ├── multisig_account.cpp │ ├── multisig_account.h │ ├── multisig_account_kex_impl.cpp │ ├── multisig_clsag_context.cpp │ ├── multisig_clsag_context.h │ ├── multisig_kex_msg.cpp │ ├── multisig_kex_msg.h │ ├── multisig_kex_msg_serialization.h │ ├── multisig_tx_builder_ringct.cpp │ └── multisig_tx_builder_ringct.h ├── net │ ├── CMakeLists.txt │ ├── dandelionpp.cpp │ ├── dandelionpp.h │ ├── error.cpp │ ├── error.h │ ├── fwd.h │ ├── http.cpp │ ├── http.h │ ├── i2p_address.cpp │ ├── i2p_address.h │ ├── parse.cpp │ ├── parse.h │ ├── resolve.cpp │ ├── resolve.h │ ├── socks.cpp │ ├── socks.h │ ├── socks_connect.cpp │ ├── socks_connect.h │ ├── tor_address.cpp │ ├── tor_address.h │ ├── zmq.cpp │ └── zmq.h ├── p2p │ ├── CMakeLists.txt │ ├── net_node.cpp │ ├── net_node.h │ ├── net_node.inl │ ├── net_node_common.h │ ├── net_peerlist.cpp │ ├── net_peerlist.h │ ├── net_peerlist_boost_serialization.h │ └── p2p_protocol_defs.h ├── ringct │ ├── CMakeLists.txt │ ├── bulletproofs.cc │ ├── bulletproofs.h │ ├── bulletproofs_plus.cc │ ├── bulletproofs_plus.h │ ├── multiexp.cc │ ├── multiexp.h │ ├── rctCryptoOps.c │ ├── rctCryptoOps.h │ ├── rctOps.cpp │ ├── rctOps.h │ ├── rctSigs.cpp │ ├── rctSigs.h │ ├── rctTypes.cpp │ └── rctTypes.h ├── rpc │ ├── CMakeLists.txt │ ├── bootstrap_daemon.cpp │ ├── bootstrap_daemon.h │ ├── bootstrap_node_selector.cpp │ ├── bootstrap_node_selector.h │ ├── core_rpc_server.cpp │ ├── core_rpc_server.h │ ├── core_rpc_server_commands_defs.h │ ├── core_rpc_server_error_codes.h │ ├── daemon_handler.cpp │ ├── daemon_handler.h │ ├── daemon_messages.cpp │ ├── daemon_messages.h │ ├── daemon_rpc_version.h │ ├── fwd.h │ ├── instanciations.cpp │ ├── message.cpp │ ├── message.h │ ├── message_data_structs.h │ ├── rpc_args.cpp │ ├── rpc_args.h │ ├── rpc_handler.cpp │ ├── rpc_handler.h │ ├── rpc_payment.cpp │ ├── rpc_payment.h │ ├── rpc_payment_costs.h │ ├── rpc_payment_signature.cpp │ ├── rpc_payment_signature.h │ ├── rpc_version_str.cpp │ ├── rpc_version_str.h │ ├── zmq_pub.cpp │ ├── zmq_pub.h │ ├── zmq_server.cpp │ └── zmq_server.h ├── seraphis_crypto │ ├── CMakeLists.txt │ ├── dummy.cpp │ └── sp_transcript.h ├── serialization │ ├── CMakeLists.txt │ ├── binary_archive.h │ ├── binary_utils.h │ ├── container.h │ ├── containers.h │ ├── crypto.h │ ├── debug_archive.h │ ├── difficulty_type.h │ ├── json_archive.h │ ├── json_object.cpp │ ├── json_object.h │ ├── pair.h │ ├── serialization.h │ ├── string.h │ ├── tuple.h │ └── variant.h ├── simplewallet │ ├── CMakeLists.txt │ ├── simplewallet.cpp │ └── simplewallet.h ├── version.cpp.in ├── version.h └── wallet │ ├── CMakeLists.txt │ ├── api │ ├── CMakeLists.txt │ ├── address_book.cpp │ ├── address_book.h │ ├── common_defines.h │ ├── pending_transaction.cpp │ ├── pending_transaction.h │ ├── subaddress.cpp │ ├── subaddress.h │ ├── subaddress_account.cpp │ ├── subaddress_account.h │ ├── transaction_history.cpp │ ├── transaction_history.h │ ├── transaction_info.cpp │ ├── transaction_info.h │ ├── unsigned_transaction.cpp │ ├── unsigned_transaction.h │ ├── utils.cpp │ ├── wallet.cpp │ ├── wallet.h │ ├── wallet2_api.h │ ├── wallet_manager.cpp │ └── wallet_manager.h │ ├── message_store.cpp │ ├── message_store.h │ ├── message_transporter.cpp │ ├── message_transporter.h │ ├── node_rpc_proxy.cpp │ ├── node_rpc_proxy.h │ ├── ringdb.cpp │ ├── ringdb.h │ ├── wallet2.cpp │ ├── wallet2.h │ ├── wallet_args.cpp │ ├── wallet_args.h │ ├── wallet_errors.h │ ├── wallet_rpc_server.cpp │ ├── wallet_rpc_server.h │ ├── wallet_rpc_server_commands_defs.h │ └── wallet_rpc_server_error_codes.h ├── tests ├── CMakeLists.txt ├── README.md ├── benchmark.cpp ├── benchmark.h.in ├── block_weight │ ├── CMakeLists.txt │ ├── block_weight.cpp │ ├── block_weight.py │ └── compare.py ├── core_tests │ ├── CMakeLists.txt │ ├── block_reward.cpp │ ├── block_reward.h │ ├── block_validation.cpp │ ├── block_validation.h │ ├── bulletproof_plus.cpp │ ├── bulletproof_plus.h │ ├── bulletproofs.cpp │ ├── bulletproofs.h │ ├── chain_split_1.cpp │ ├── chain_split_1.h │ ├── chain_switch_1.cpp │ ├── chain_switch_1.h │ ├── chaingen.cpp │ ├── chaingen.h │ ├── chaingen001.cpp │ ├── chaingen_main.cpp │ ├── chaingen_serialization.h │ ├── chaingen_tests_list.h │ ├── double_spend.cpp │ ├── double_spend.h │ ├── double_spend.inl │ ├── integer_overflow.cpp │ ├── integer_overflow.h │ ├── multisig.cpp │ ├── multisig.h │ ├── rct.cpp │ ├── rct.h │ ├── rct2.cpp │ ├── rct2.h │ ├── ring_signature_1.cpp │ ├── ring_signature_1.h │ ├── transaction_tests.cpp │ ├── transaction_tests.h │ ├── tx_pool.cpp │ ├── tx_pool.h │ ├── tx_validation.cpp │ ├── tx_validation.h │ ├── v2_tests.cpp │ ├── v2_tests.h │ ├── wallet_tools.cpp │ └── wallet_tools.h ├── create_test_disks.sh ├── crypto │ ├── CMakeLists.txt │ ├── cnv4-jit.c │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-tests.h │ ├── crypto.cpp │ ├── hash.c │ ├── main.cpp │ ├── random.c │ └── tests.txt ├── data │ ├── account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb │ ├── account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f │ ├── account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 │ ├── account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe │ ├── fuzz │ │ ├── base58 │ │ │ ├── ENC1 │ │ │ └── ENC2 │ │ ├── block │ │ │ ├── BLOCK1 │ │ │ └── BLOCK2 │ │ ├── bulletproof │ │ │ └── BP0 │ │ ├── cold-outputs │ │ │ ├── out-all-6 │ │ │ └── out-none-6 │ │ ├── cold-transaction │ │ │ └── CTX1 │ │ ├── http-client │ │ │ └── RESP1 │ │ ├── levin │ │ │ └── LEVIN1 │ │ ├── load-from-binary │ │ │ └── BINARY1 │ │ ├── load-from-json │ │ │ └── JSON1 │ │ ├── parse-url │ │ │ ├── URL1 │ │ │ └── URL2 │ │ ├── signature │ │ │ ├── SIG1 │ │ │ └── SIG2 │ │ ├── transaction │ │ │ ├── TX1 │ │ │ └── TX2 │ │ ├── tx-extra │ │ │ ├── TXEXTRA1 │ │ │ └── TXEXTRA2 │ │ └── utf8 │ │ │ ├── UTF8_1 │ │ │ └── UTF8_2 │ ├── node │ │ └── banlist_1.txt │ ├── outputs │ ├── sha256sum │ │ ├── CLSAG.pdf │ │ ├── empty.txt │ │ └── small_file.txt │ ├── signed_monero_tx │ ├── txs │ │ └── bpp_tx_e89415.bin │ ├── unsigned_monero_tx │ ├── wallet_00fd416a │ ├── wallet_00fd416a.keys │ ├── wallet_9svHk1 │ └── wallet_9svHk1.keys ├── difficulty │ ├── CMakeLists.txt │ ├── data.txt │ ├── difficulty.cpp │ ├── gen_wide_data.py │ ├── generate-data │ └── wide_difficulty.py ├── functional_tests │ ├── CMakeLists.txt │ ├── address_book.py │ ├── bans.py │ ├── blockchain.py │ ├── check_missing_rpc_methods.py │ ├── cold_signing.py │ ├── cpu_power_test.cpp │ ├── daemon_info.py │ ├── functional_tests_rpc.py │ ├── get_output_distribution.py │ ├── http_digest_auth.py │ ├── integrated_address.py │ ├── k_anonymity.py │ ├── main.cpp │ ├── make_test_signature.cc │ ├── mining.py │ ├── multisig.py │ ├── p2p.py │ ├── proofs.py │ ├── rpc_payment.py │ ├── sign_message.py │ ├── speed.py │ ├── transactions_flow_test.cpp │ ├── transactions_flow_test.h │ ├── transactions_generation_from_blockchain.cpp │ ├── transactions_generation_from_blockchain.h │ ├── transfer.py │ ├── txpool.py │ ├── uri.py │ ├── util_resources.py │ ├── validate_address.py │ └── wallet.py ├── fuzz │ ├── CMakeLists.txt │ ├── base58.cpp │ ├── block.cpp │ ├── bulletproof.cpp │ ├── cold-outputs.cpp │ ├── cold-transaction.cpp │ ├── fuzzer.cpp │ ├── fuzzer.h │ ├── http-client.cpp │ ├── levin.cpp │ ├── load_from_binary.cpp │ ├── load_from_json.cpp │ ├── parse_url.cpp │ ├── signature.cpp │ ├── transaction.cpp │ ├── tx-extra.cpp │ └── utf8.cpp ├── hash-target.cpp ├── hash │ ├── CMakeLists.txt │ ├── main.cpp │ ├── tests-blake2b.txt │ ├── tests-extra-blake.txt │ ├── tests-extra-groestl.txt │ ├── tests-extra-jh.txt │ ├── tests-extra-skein.txt │ ├── tests-fast.txt │ ├── tests-slow-1.txt │ ├── tests-slow-2.txt │ ├── tests-slow-4.txt │ ├── tests-slow.txt │ └── tests-tree.txt ├── io.h ├── libwallet_api_tests │ ├── CMakeLists.txt │ ├── main.cpp │ └── scripts │ │ ├── README.md │ │ ├── create_wallets.sh │ │ ├── mining_start.sh │ │ ├── mining_stop.sh │ │ ├── open_wallet_1.sh │ │ ├── open_wallet_2.sh │ │ ├── open_wallet_3.sh │ │ ├── open_wallet_4.sh │ │ ├── open_wallet_5.sh │ │ ├── open_wallet_miner.sh │ │ └── send_funds.sh ├── net_load_tests │ ├── CMakeLists.txt │ ├── clt.cpp │ ├── net_load_tests.h │ └── srv.cpp ├── performance_tests │ ├── CMakeLists.txt │ ├── bulletproof.h │ ├── bulletproof_plus.h │ ├── check_hash.h │ ├── check_tx_signature.h │ ├── cn_fast_hash.h │ ├── cn_slow_hash.h │ ├── construct_tx.h │ ├── crypto_ops.h │ ├── derive_public_key.h │ ├── derive_secret_key.h │ ├── derive_view_tag.h │ ├── equality.h │ ├── ge_frombytes_vartime.h │ ├── ge_tobytes.h │ ├── generate_key_derivation.h │ ├── generate_key_image.h │ ├── generate_key_image_helper.h │ ├── generate_keypair.h │ ├── is_out_to_acc.h │ ├── is_valid_decomposed_amount.h │ ├── main.cpp │ ├── multi_tx_test_base.h │ ├── multiexp.h │ ├── out_can_be_to_acc.h │ ├── performance_tests.h │ ├── performance_utils.h │ ├── range_proof.h │ ├── rct_mlsag.h │ ├── sc_check.h │ ├── sc_reduce32.h │ ├── sig_clsag.h │ ├── sig_mlsag.h │ ├── signature.h │ ├── single_tx_test_base.h │ └── subaddress_expand.h ├── trezor │ ├── CMakeLists.txt │ ├── daemon.cpp │ ├── daemon.h │ ├── tools.cpp │ ├── tools.h │ ├── trezor_tests.cpp │ └── trezor_tests.h └── unit_tests │ ├── CMakeLists.txt │ ├── account.cpp │ ├── address_from_url.cpp │ ├── aligned.cpp │ ├── apply_permutation.cpp │ ├── base58.cpp │ ├── block_queue.cpp │ ├── block_reward.cpp │ ├── blockchain_db.cpp │ ├── bootstrap_node_selector.cpp │ ├── bulletproofs.cpp │ ├── bulletproofs_plus.cpp │ ├── canonical_amounts.cpp │ ├── chacha.cpp │ ├── checkpoints.cpp │ ├── command_line.cpp │ ├── crypto.cpp │ ├── decompose_amount_into_digits.cpp │ ├── device.cpp │ ├── difficulty.cpp │ ├── dns_resolver.cpp │ ├── epee_boosted_tcp_server.cpp │ ├── epee_http_server.cpp │ ├── epee_levin_protocol_handler_async.cpp │ ├── epee_serialization.cpp │ ├── epee_utils.cpp │ ├── expect.cpp │ ├── get_xtype_from_string.cpp │ ├── hardfork.cpp │ ├── hashchain.cpp │ ├── hmac_keccak.cpp │ ├── http.cpp │ ├── is_hdd.cpp │ ├── json_serialization.cpp │ ├── json_serialization.h │ ├── keccak.cpp │ ├── levin.cpp │ ├── lmdb.cpp │ ├── logging.cpp │ ├── long_term_block_weight.cpp │ ├── main.cpp │ ├── memwipe.cpp │ ├── mlocker.cpp │ ├── mnemonics.cpp │ ├── mul_div.cpp │ ├── multiexp.cpp │ ├── multisig.cpp │ ├── net.cpp │ ├── node_server.cpp │ ├── notify.cpp │ ├── output_distribution.cpp │ ├── output_selection.cpp │ ├── parse_amount.cpp │ ├── pruning.cpp │ ├── random.cpp │ ├── ringct.cpp │ ├── ringdb.cpp │ ├── rolling_median.cpp │ ├── rpc_version_str.cpp │ ├── scaling_2021.cpp │ ├── serialization.cpp │ ├── sha256.cpp │ ├── slow_memmem.cpp │ ├── subaddress.cpp │ ├── test_notifier.cpp │ ├── test_peerlist.cpp │ ├── test_protocol_pack.cpp │ ├── test_tx_utils.cpp │ ├── threadpool.cpp │ ├── tx_proof.cpp │ ├── unbound.cpp │ ├── unit_tests_utils.h │ ├── uri.cpp │ ├── util.cpp │ ├── variant.cpp │ ├── varint.cpp │ ├── ver_rct_non_semantics_simple_cached.cpp │ ├── vercmp.cpp │ ├── wallet_storage.cpp │ ├── wipeable_string.cpp │ └── zmq_rpc.cpp ├── translations ├── CMakeLists.txt ├── generate_translations_header.c ├── monero.ts ├── monero_ar.ts ├── monero_bg.ts ├── monero_bn.ts ├── monero_cat.ts ├── monero_cs.ts ├── monero_da.ts ├── monero_de.ts ├── monero_el.ts ├── monero_eo.ts ├── monero_es.ts ├── monero_fa.ts ├── monero_fi.ts ├── monero_fr.ts ├── monero_ga.ts ├── monero_he.ts ├── monero_hi.ts ├── monero_hr.ts ├── monero_hu.ts ├── monero_id.ts ├── monero_is.ts ├── monero_it.ts ├── monero_ja.ts ├── monero_kmr.ts ├── monero_ko.ts ├── monero_lt.ts ├── monero_nb_NO.ts ├── monero_ne.ts ├── monero_nl.ts ├── monero_pl.ts ├── monero_prt.ts ├── monero_pt-br.ts ├── monero_pt-pt.ts ├── monero_ro.ts ├── monero_ru.ts ├── monero_sk.ts ├── monero_sl.ts ├── monero_sr.ts ├── monero_sv.ts ├── monero_tr.ts ├── monero_uk.ts ├── monero_ur.ts ├── monero_zh-cn.ts ├── monero_zh-tw.ts ├── monero_zu.ts ├── monero_zu.ts.ts └── ready └── utils ├── conf └── monerod.conf ├── doxygen-publish.sh ├── fish ├── README.md ├── monero-wallet-cli.fish ├── monero-wallet-rpc.fish └── monerod.fish ├── gpg_keys ├── 0xfffc0000.asc ├── SNeedlewoods.asc ├── anon.asc ├── anonimal.asc ├── binaryfate.asc ├── erciccione.asc ├── fluffypony.asc ├── guzzi.asc ├── hyc.asc ├── iDunk.asc ├── jaquee.asc ├── jeffro256.asc ├── kenshi84.asc ├── luigi1111.asc ├── mikezackles.asc ├── mishi_choudhary.asc ├── mj-xmr.asc ├── moneromooo.asc ├── nanoakron.asc ├── oranjuice.asc ├── rbrunner7.asc ├── sarang.asc ├── selsta.asc ├── snipa.asc ├── stoffu.asc ├── tewinget.asc ├── thecharlatan.asc ├── tobtoht.asc ├── tomerkon.asc ├── warptangent.asc └── xiphon.asc ├── health ├── README.md ├── build-scripts │ └── clang-build-time-analyzer-clone-build.sh ├── clang-build-time-analyzer-run.sh ├── clang-include-what-you-use-run.sh ├── clang-tidy-run-cc.sh ├── clang-tidy-run-common.sh ├── clang-tidy-run-cpp.sh └── valgrind-tests.sh ├── logs └── levin-traffic.awk ├── python-rpc ├── console ├── console.py └── framework │ ├── __init__.py │ ├── daemon.py │ ├── rpc.py │ ├── test_rpc.py │ ├── wallet.py │ └── zmq.py ├── systemd └── monerod.service └── translations ├── build-translations.sh └── update-translations.sh /cmake/CheckLinkerFlag.c: -------------------------------------------------------------------------------- 1 | #ifdef __CLASSIC_C__ 2 | int main() 3 | { 4 | int ac; 5 | char* av[]; 6 | #else 7 | int main(int ac, char* av[]) 8 | { 9 | #endif 10 | if (ac > 1000) { 11 | return *av[0]; 12 | } 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /cmake/CheckLinkerFlag.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCCompilerFlag) 2 | 3 | macro(CHECK_LINKER_FLAG flag VARIABLE) 4 | if(NOT DEFINED "${VARIABLE}") 5 | if(NOT CMAKE_REQUIRED_QUIET) 6 | message(STATUS "Looking for ${flag} linker flag") 7 | endif() 8 | 9 | set(_cle_source ${monero_SOURCE_DIR}/cmake/CheckLinkerFlag.c) 10 | 11 | set(saved_CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) 12 | set(CMAKE_C_FLAGS "${flag}") 13 | try_compile(${VARIABLE} 14 | ${CMAKE_BINARY_DIR} 15 | ${_cle_source} 16 | COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${flag} 17 | CMAKE_FLAGS 18 | "-DCMAKE_EXE_LINKER_FLAGS=${flag}" 19 | OUTPUT_VARIABLE OUTPUT) 20 | unset(_cle_source) 21 | set(CMAKE_C_FLAGS ${saved_CMAKE_C_FLAGS}) 22 | unset(saved_CMAKE_C_FLAGS) 23 | 24 | if ("${OUTPUT}" MATCHES "warning.*ignored") 25 | set(${VARIABLE} 0) 26 | endif() 27 | 28 | if(${VARIABLE}) 29 | if(NOT CMAKE_REQUIRED_QUIET) 30 | message(STATUS "Looking for ${flag} linker flag - found") 31 | endif() 32 | set(${VARIABLE} 1 CACHE INTERNAL "Have linker flag ${flag}") 33 | file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 34 | "Determining if the ${flag} linker flag is supported " 35 | "passed with the following output:\n" 36 | "${OUTPUT}\n\n") 37 | else() 38 | if(NOT CMAKE_REQUIRED_QUIET) 39 | message(STATUS "Looking for ${flag} linker flag - not found") 40 | endif() 41 | set(${VARIABLE} "" CACHE INTERNAL "Have linker flag ${flag}") 42 | file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 43 | "Determining if the ${flag} linker flag is supported " 44 | "failed with the following output:\n" 45 | "${OUTPUT}\n\n") 46 | endif() 47 | endif() 48 | endmacro() 49 | -------------------------------------------------------------------------------- /cmake/Doxygen.extra.css.in: -------------------------------------------------------------------------------- 1 | /* increase vertical space */ 2 | #titlearea, #nav-path { 3 | display: none; 4 | height: 0px; 5 | } 6 | 7 | 8 | /* uncomment these lines for some extra vertical space */ 9 | 10 | /* 11 | .tablist li { 12 | line-height: 26px; 13 | } 14 | */ 15 | -------------------------------------------------------------------------------- /cmake/FindLibunwind.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find libunwind 2 | # Once done this will define 3 | # 4 | # LIBUNWIND_FOUND - system has libunwind 5 | # LIBUNWIND_INCLUDE_DIR - the libunwind include directory 6 | # LIBUNWIND_LIBRARIES - Link these to use libunwind 7 | # LIBUNWIND_DEFINITIONS - Compiler switches required for using libunwind 8 | 9 | # Copyright (c) 2006, Alexander Dymo, 10 | # 11 | # Redistribution and use is allowed according to the terms of the BSD license. 12 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 13 | 14 | find_path(LIBUNWIND_INCLUDE_DIR libunwind.h 15 | /usr/include 16 | /usr/local/include 17 | ) 18 | 19 | find_library(LIBUNWIND_LIBRARIES NAMES unwind ) 20 | if(NOT LIBUNWIND_LIBRARIES STREQUAL "LIBUNWIND_LIBRARIES-NOTFOUND") 21 | if (CMAKE_COMPILER_IS_GNUCC) 22 | set(LIBUNWIND_LIBRARIES "gcc_eh;${LIBUNWIND_LIBRARIES}") 23 | endif() 24 | endif() 25 | 26 | # some versions of libunwind need liblzma, and we don't use pkg-config 27 | # so we just look whether liblzma is installed, and add it if it is. 28 | # It might not be actually needed, but doesn't hurt if it is not. 29 | # We don't need any headers, just the lib, as it's privately needed. 30 | message(STATUS "looking for liblzma") 31 | find_library(LIBLZMA_LIBRARIES lzma ) 32 | if(NOT LIBLZMA_LIBRARIES STREQUAL "LIBLZMA_LIBRARIES-NOTFOUND") 33 | message(STATUS "liblzma found") 34 | set(LIBUNWIND_LIBRARIES "${LIBUNWIND_LIBRARIES};${LIBLZMA_LIBRARIES}") 35 | endif() 36 | 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(Libunwind "Could not find libunwind" LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES) 39 | # show the LIBUNWIND_INCLUDE_DIR and LIBUNWIND_LIBRARIES variables only in the advanced view 40 | mark_as_advanced(LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES ) 41 | 42 | -------------------------------------------------------------------------------- /cmake/test-protobuf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "google/protobuf/descriptor.proto"; 4 | 5 | message Success { 6 | optional string message = 1; 7 | } 8 | -------------------------------------------------------------------------------- /cmake/test-static-assert.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2024, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #include 30 | 31 | static_assert(1, "FAIL"); 32 | int main(int argc, char *argv[]) { 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /cmake/test-static-assert.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2024, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #include 30 | 31 | static_assert(1, "FAIL"); 32 | int main(int argc, char *argv[]) { 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /contrib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014-2024, The Monero Project 2 | # 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without modification, are 6 | # permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, this list of 9 | # conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | # of conditions and the following disclaimer in the documentation and/or other 13 | # materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | # used to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | monero_enable_coverage() 30 | add_subdirectory(epee) 31 | 32 | -------------------------------------------------------------------------------- /contrib/brew/Brewfile: -------------------------------------------------------------------------------- 1 | # Brewfile for Monero 2 | # A homebrew Brewfile installs all required dependencies in one shot 3 | # see https://coderwall.com/p/afmnbq/homebrew-s-new-feature-brewfiles 4 | # https://github.com/Homebrew/homebrew-bundle 5 | # execute brew bundle in the directory containing the Brewfile 6 | 7 | tap "homebrew/bundle" 8 | 9 | brew "autoconf" 10 | brew "autogen" 11 | brew "automake" 12 | brew "binutils" 13 | brew "coreutils" 14 | brew "cmake" 15 | brew "pkg-config" 16 | brew "boost" 17 | brew "openssl" 18 | brew "hidapi" 19 | brew "zmq" 20 | brew "libpgm" 21 | brew "unbound" 22 | brew "libsodium" 23 | brew "miniupnpc" 24 | brew "readline" 25 | brew "expat" 26 | brew "ccache" 27 | brew "doxygen" 28 | brew "graphviz" 29 | brew "libunwind-headers" 30 | brew "xz" 31 | brew "protobuf" 32 | brew "libusb" 33 | -------------------------------------------------------------------------------- /contrib/depends/builders/darwin.mk: -------------------------------------------------------------------------------- 1 | build_darwin_CC: = $(shell xcrun -f clang) 2 | build_darwin_CXX: = $(shell xcrun -f clang++) 3 | build_darwin_AR: = $(shell xcrun -f ar) 4 | build_darwin_RANLIB: = $(shell xcrun -f ranlib) 5 | build_darwin_STRIP: = $(shell xcrun -f strip) 6 | build_darwin_OTOOL: = $(shell xcrun -f otool) 7 | build_darwin_NM: = $(shell xcrun -f nm) 8 | build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 9 | build_darwin_SHA256SUM = shasum -a 256 10 | build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o 11 | 12 | #darwin host on darwin builder. overrides darwin host preferences. 13 | darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) 14 | darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ 15 | darwin_AR:=$(shell xcrun -f ar) 16 | darwin_RANLIB:=$(shell xcrun -f ranlib) 17 | darwin_STRIP:=$(shell xcrun -f strip) 18 | darwin_LIBTOOL:=$(shell xcrun -f libtool) 19 | darwin_OTOOL:=$(shell xcrun -f otool) 20 | darwin_NM:=$(shell xcrun -f nm) 21 | darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 22 | darwin_native_toolchain= 23 | -------------------------------------------------------------------------------- /contrib/depends/builders/default.mk: -------------------------------------------------------------------------------- 1 | default_build_CC = gcc 2 | default_build_CXX = g++ 3 | default_build_AR = ar 4 | default_build_RANLIB = ranlib 5 | default_build_STRIP = strip 6 | default_build_NM = nm 7 | default_build_OTOOL = otool 8 | default_build_INSTALL_NAME_TOOL = install_name_tool 9 | 10 | define add_build_tool_func 11 | build_$(build_os)_$1 ?= $$(default_build_$1) 12 | build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) 13 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 14 | endef 15 | $(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) 16 | define add_build_flags_func 17 | build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) 18 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 19 | endef 20 | $(foreach flags, CFLAGS CXXFLAGS ARFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags)))) 21 | -------------------------------------------------------------------------------- /contrib/depends/builders/linux.mk: -------------------------------------------------------------------------------- 1 | build_linux_SHA256SUM = sha256sum 2 | build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o 3 | -------------------------------------------------------------------------------- /contrib/depends/hosts/android.mk: -------------------------------------------------------------------------------- 1 | ANDROID_API=21 2 | 3 | ifeq ($(host_arch),arm) 4 | host_toolchain=armv7a-linux-androideabi$(ANDROID_API)- 5 | else ifeq ($(host_arch),aarch64) 6 | host_toolchain=aarch64-linux-android$(ANDROID_API)- 7 | endif 8 | 9 | clear_guix_env=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ 10 | -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ 11 | -u LIBRARY_PATH 12 | 13 | android_CC=$(clear_guix_env) $(build_prefix)/bin/$(host_toolchain)clang 14 | android_CXX=$(clear_guix_env) $(build_prefix)/bin/$(host_toolchain)clang++ 15 | 16 | android_AR=llvm-ar 17 | android_RANLIB=llvm-ranlib 18 | 19 | android_CFLAGS=-pipe 20 | android_CXXFLAGS=$(android_CFLAGS) 21 | android_ARFLAGS=crsD 22 | 23 | android_release_CFLAGS=-O2 24 | android_release_CXXFLAGS=$(android_release_CFLAGS) 25 | 26 | android_debug_CFLAGS=-g -O0 27 | android_debug_CXXFLAGS=$(android_debug_CFLAGS) 28 | 29 | android_native_toolchain=android_ndk 30 | 31 | # CMake 3.24 fails to detect API level for Android, even if set explicitly in 32 | # toolchain.cmake. It also tries to manually construct paths to clang(++), but we 33 | # want it to always use the options defined here. It's easier to just pretend 34 | # we're a generic Linux target, than to hack around it. 35 | android_cmake_system=Linux 36 | -------------------------------------------------------------------------------- /contrib/depends/hosts/default.mk: -------------------------------------------------------------------------------- 1 | default_host_CC = $(host_toolchain)gcc 2 | default_host_CXX = $(host_toolchain)g++ 3 | default_host_AR = $(host_toolchain)ar 4 | default_host_RANLIB = $(host_toolchain)ranlib 5 | default_host_STRIP = $(host_toolchain)strip 6 | default_host_LIBTOOL = $(host_toolchain)libtool 7 | default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool 8 | default_host_OTOOL = $(host_toolchain)otool 9 | default_host_NM = $(host_toolchain)nm 10 | 11 | define add_host_tool_func 12 | $(host_os)_$1?=$$(default_host_$1) 13 | $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) 14 | $(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) 15 | host_$1=$$($(host_arch)_$(host_os)_$1) 16 | endef 17 | 18 | define add_host_flags_func 19 | $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) 20 | $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) 21 | host_$1 = $$($(host_arch)_$(host_os)_$1) 22 | host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) 23 | endef 24 | 25 | $(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) 26 | $(foreach flags,CFLAGS CXXFLAGS ARFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) 27 | -------------------------------------------------------------------------------- /contrib/depends/hosts/freebsd.mk: -------------------------------------------------------------------------------- 1 | clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang") 2 | clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++") 3 | 4 | freebsd_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ 5 | -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ 6 | -u LIBRARY_PATH $(clang_prog) --target=$(host) --sysroot=$(host_prefix)/native -iwithsysroot/usr/include 7 | freebsd_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ 8 | -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ 9 | -u LIBRARY_PATH $(clangxx_prog) --target=$(host) -stdlib=libc++ --sysroot=$(host_prefix)/native \ 10 | -iwithsysroot/usr/include/c++/v1 -iwithsysroot/usr/include 11 | 12 | freebsd_AR=ar 13 | freebsd_RANLIB=ranlib 14 | freebsd_NM=nm 15 | 16 | freebsd_CFLAGS=-pipe 17 | freebsd_CXXFLAGS=$(freebsd_CFLAGS) 18 | freebsd_ARFLAGS=cr 19 | 20 | freebsd_release_CFLAGS=-O2 21 | freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS) 22 | 23 | freebsd_debug_CFLAGS=-g -O0 24 | freebsd_debug_CXXFLAGS=$(freebsd_debug_CFLAGS) 25 | 26 | freebsd_native_toolchain=freebsd_base 27 | 28 | freebsd_cmake_system=FreeBSD 29 | -------------------------------------------------------------------------------- /contrib/depends/hosts/linux.mk: -------------------------------------------------------------------------------- 1 | linux_CFLAGS=-pipe 2 | linux_CXXFLAGS=$(linux_CFLAGS) 3 | linux_ARFLAGS=cr 4 | 5 | linux_release_CFLAGS=-O2 6 | linux_release_CXXFLAGS=$(linux_release_CFLAGS) 7 | 8 | linux_debug_CFLAGS=-O1 9 | linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) 10 | 11 | linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 12 | 13 | ifeq ($(GUIX_ENVIRONMENT),) 14 | ifeq (86,$(findstring 86,$(build_arch))) 15 | i686_linux_CC=gcc -m32 16 | i686_linux_CXX=g++ -m32 17 | i686_linux_AR=ar 18 | i686_linux_RANLIB=ranlib 19 | i686_linux_NM=nm 20 | i686_linux_STRIP=strip 21 | 22 | x86_64_linux_CC=gcc -m64 23 | x86_64_linux_CXX=g++ -m64 24 | x86_64_linux_AR=ar 25 | x86_64_linux_RANLIB=ranlib 26 | x86_64_linux_NM=nm 27 | x86_64_linux_STRIP=strip 28 | else 29 | i686_linux_CC=$(default_host_CC) -m32 30 | i686_linux_CXX=$(default_host_CXX) -m32 31 | x86_64_linux_CC=$(default_host_CC) -m64 32 | x86_64_linux_CXX=$(default_host_CXX) -m64 33 | endif 34 | endif 35 | 36 | linux_cmake_system=Linux 37 | -------------------------------------------------------------------------------- /contrib/depends/hosts/mingw32.mk: -------------------------------------------------------------------------------- 1 | mingw32_CFLAGS=-pipe 2 | mingw32_CXXFLAGS=$(mingw32_CFLAGS) 3 | mingw32_ARFLAGS=cr 4 | 5 | mingw32_release_CFLAGS=-O2 6 | mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) 7 | 8 | mingw32_debug_CFLAGS=-O1 9 | mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) 10 | 11 | mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 12 | 13 | mingw32_cmake_system=Windows 14 | -------------------------------------------------------------------------------- /contrib/depends/packages/android_ndk.mk: -------------------------------------------------------------------------------- 1 | package=android_ndk 2 | $(package)_version=27c 3 | $(package)_download_path=https://dl.google.com/android/repository/ 4 | $(package)_file_name=android-ndk-r$($(package)_version)-linux.zip 5 | $(package)_sha256_hash=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc 6 | 7 | define $(package)_extract_cmds 8 | echo $($(package)_sha256_hash) $($(1)_source_dir)/$($(package)_file_name) | sha256sum -c &&\ 9 | unzip -q $($(1)_source_dir)/$($(package)_file_name) 10 | endef 11 | 12 | define $(package)_stage_cmds 13 | mkdir -p $($(package)_staging_prefix_dir) && \ 14 | mv android-ndk-r$($(package)_version)/toolchains/llvm/prebuilt/linux-x86_64/* $($(package)_staging_prefix_dir) 15 | endef 16 | -------------------------------------------------------------------------------- /contrib/depends/packages/darwin_sdk.mk: -------------------------------------------------------------------------------- 1 | package=darwin_sdk 2 | $(package)_version=12.2 3 | $(package)_download_path=https://bitcoincore.org/depends-sources/sdks 4 | $(package)_file_name=Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz 5 | $(package)_sha256_hash=df75d30ecafc429e905134333aeae56ac65fac67cb4182622398fd717df77619 6 | 7 | # Prevent clang from including readline headers from the SDK. We statically link 8 | # our own version of readline. 9 | 10 | define $(package)_stage_cmds 11 | mkdir -p $($(package)_staging_prefix_dir)/SDK &&\ 12 | rm -rf usr/include/readline && \ 13 | mv * $($(package)_staging_prefix_dir)/SDK 14 | endef 15 | -------------------------------------------------------------------------------- /contrib/depends/packages/freebsd_base.mk: -------------------------------------------------------------------------------- 1 | package=freebsd_base 2 | $(package)_version=12.3 3 | $(package)_download_path=https://archive.freebsd.org/old-releases/amd64/$($(package)_version)-RELEASE/ 4 | $(package)_download_file=base.txz 5 | $(package)_file_name=freebsd-base-$($(package)_version).txz 6 | $(package)_sha256_hash=e85b256930a2fbc04b80334106afecba0f11e52e32ffa197a88d7319cf059840 7 | 8 | define $(package)_extract_cmds 9 | echo $($(package)_sha256_hash) $($(1)_source_dir)/$($(package)_file_name) | sha256sum -c &&\ 10 | tar xf $($(1)_source_dir)/$($(package)_file_name) ./lib/ ./usr/lib/ ./usr/include/ 11 | endef 12 | 13 | # Prevent clang from including OpenSSL headers from the system base. We 14 | # statically link our own version of OpenSSL. 15 | 16 | define $(package)_stage_cmds 17 | mkdir $($(package)_staging_prefix_dir) &&\ 18 | rm -rf usr/include/openssl &&\ 19 | mv lib usr $($(package)_staging_prefix_dir) 20 | endef 21 | -------------------------------------------------------------------------------- /contrib/depends/packages/hidapi.mk: -------------------------------------------------------------------------------- 1 | package=hidapi 2 | $(package)_version=0.14.0 3 | $(package)_download_path=https://github.com/libusb/hidapi/archive/refs/tags 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=a5714234abe6e1f53647dd8cba7d69f65f71c558b7896ed218864ffcf405bcbd 6 | $(package)_linux_dependencies=libusb 7 | 8 | # -DHIDAPI_NO_ICONV=ON 9 | # 10 | # `FindIconv.cmake` in CMake 3.16 fails to detect iconv for riscv64, arm, and aarch64 linux targets. 11 | # Disable it if we're not building in a release environment. 12 | 13 | define $(package)_set_vars 14 | $(package)_config_opts := -DBUILD_SHARED_LIBS=OFF 15 | $(package)_config_opts += -DHIDAPI_WITH_HIDRAW=OFF 16 | ifeq ($(GUIX_ENVIRONMENT),) 17 | $(package)_config_opts += -DHIDAPI_NO_ICONV=ON 18 | endif 19 | endef 20 | 21 | # Remove blobs 22 | define $(package)_preprocess_cmds 23 | rm -rf documentation testgui windows/test/data m4 24 | endef 25 | 26 | define $(package)_config_cmds 27 | $($(package)_cmake) . 28 | endef 29 | 30 | define $(package)_build_cmds 31 | $(MAKE) 32 | endef 33 | 34 | define $(package)_stage_cmds 35 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 36 | endef 37 | -------------------------------------------------------------------------------- /contrib/depends/packages/libusb.mk: -------------------------------------------------------------------------------- 1 | package=libusb 2 | $(package)_version=1.0.27 3 | $(package)_download_path=https://github.com/libusb/libusb/releases/download/v$($(package)_version) 4 | $(package)_file_name=$(package)-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575 6 | 7 | define $(package)_preprocess_cmds 8 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . 9 | endef 10 | 11 | define $(package)_set_vars 12 | $(package)_config_opts=--disable-shared 13 | $(package)_config_opts_linux=--disable-udev 14 | $(package)_config_opts_mingw32=--disable-udev 15 | $(package)_config_opts_darwin=--disable-udev 16 | $(package)_config_opts_freebsd=--disable-udev 17 | endef 18 | 19 | define $(package)_config_cmds 20 | $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) 21 | endef 22 | 23 | define $(package)_build_cmd 24 | $(MAKE) 25 | endef 26 | 27 | define $(package)_stage_cmds 28 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 29 | endef 30 | 31 | define $(package)_postprocess_cmds 32 | cp -f lib/libusb-1.0.a lib/libusb.a 33 | endef 34 | -------------------------------------------------------------------------------- /contrib/depends/packages/native_cctools.mk: -------------------------------------------------------------------------------- 1 | package=native_cctools 2 | $(package)_version=04663295d0425abfac90a42440a7ec02d7155fea 3 | $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive 4 | $(package)_download_file=$($(package)_version).tar.gz 5 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 6 | $(package)_sha256_hash=70a7189418c2086d20c299c5d59250cf5940782c778892ccc899c66516ed240e 7 | $(package)_build_subdir=cctools 8 | $(package)_patches=no-build-date.patch 9 | $(package)_dependencies=native_libtapi 10 | 11 | define $(package)_set_vars 12 | $(package)_config_opts=--target=$(host) --disable-lto-support --with-libtapi=$(host_prefix) 13 | $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib 14 | $(package)_cc=$(clang_prog) 15 | $(package)_cxx=$(clangxx_prog) 16 | endef 17 | 18 | define $(package)_preprocess_cmds 19 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools && \ 20 | patch -p1 < $($(package)_patch_dir)/no-build-date.patch 21 | endef 22 | 23 | define $(package)_config_cmds 24 | $($(package)_autoconf) 25 | endef 26 | 27 | define $(package)_build_cmds 28 | $(MAKE) 29 | endef 30 | 31 | define $(package)_stage_cmds 32 | $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ 33 | cp $($(package)_extract_dir)/cctools/misc/install_name_tool $($(package)_staging_prefix_dir)/bin/ 34 | endef 35 | -------------------------------------------------------------------------------- /contrib/depends/packages/native_libtapi.mk: -------------------------------------------------------------------------------- 1 | package=native_libtapi 2 | $(package)_version=664b8414f89612f2dfd35a9b679c345aa5389026 3 | $(package)_download_path=https://github.com/tpoechtrager/apple-libtapi/archive 4 | $(package)_download_file=$($(package)_version).tar.gz 5 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 6 | $(package)_sha256_hash=62e419c12d1c9fad67cc1cd523132bc00db050998337c734c15bc8d73cc02b61 7 | $(package)_patches=no_embed_git_rev.patch 8 | 9 | define $(package)_preprocess_cmds 10 | patch -p1 -i $($(package)_patch_dir)/no_embed_git_rev.patch 11 | endef 12 | 13 | define $(package)_build_cmds 14 | CC=$(clang_prog) CXX=$(clangxx_prog) INSTALLPREFIX=$($(package)_staging_prefix_dir) ./build.sh 15 | endef 16 | 17 | define $(package)_stage_cmds 18 | ./install.sh 19 | endef 20 | -------------------------------------------------------------------------------- /contrib/depends/packages/native_protobuf.mk: -------------------------------------------------------------------------------- 1 | package=native_protobuf 2 | $(package)_version=21.12 3 | $(package)_version_protobuf_cpp=3.21.12 4 | $(package)_download_path=https://github.com/protocolbuffers/protobuf/releases/download/v$($(package)_version)/ 5 | $(package)_file_name=protobuf-cpp-$($(package)_version_protobuf_cpp).tar.gz 6 | $(package)_sha256_hash=4eab9b524aa5913c6fffb20b2a8abf5ef7f95a80bc0701f3a6dbb4c607f73460 7 | $(package)_cxxflags=-std=c++11 8 | 9 | define $(package)_set_vars 10 | $(package)_config_opts=--disable-shared --prefix=$(build_prefix) 11 | $(package)_config_opts_linux=--with-pic 12 | endef 13 | 14 | define $(package)_config_cmds 15 | $($(package)_autoconf) 16 | endef 17 | 18 | define $(package)_build_cmds 19 | $(MAKE) -C src protoc 20 | endef 21 | 22 | define $(package)_stage_cmds 23 | $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-binPROGRAMS install-nobase_dist_protoDATA 24 | endef 25 | 26 | define $(package)_postprocess_cmds 27 | rm -rf lib/ 28 | endef 29 | -------------------------------------------------------------------------------- /contrib/depends/packages/packages.mk: -------------------------------------------------------------------------------- 1 | native_packages := native_protobuf 2 | packages := boost openssl zeromq unbound sodium protobuf 3 | 4 | ifneq ($(host_os),android) 5 | packages += libusb 6 | endif 7 | 8 | ifneq ($(host_os),freebsd) 9 | ifneq ($(host_os),android) 10 | packages += hidapi 11 | endif 12 | endif 13 | 14 | ifneq ($(host_os),mingw32) 15 | packages += ncurses readline 16 | endif 17 | 18 | linux_native_packages := 19 | linux_packages := 20 | 21 | freebsd_native_packages := freebsd_base 22 | freebsd_packages := 23 | 24 | ifneq ($(build_os),darwin) 25 | darwin_native_packages := darwin_sdk native_cctools native_libtapi 26 | endif 27 | darwin_packages := 28 | 29 | android_native_packages := android_ndk 30 | android_packages := 31 | -------------------------------------------------------------------------------- /contrib/depends/packages/protobuf.mk: -------------------------------------------------------------------------------- 1 | package=protobuf 2 | $(package)_version=$(native_$(package)_version) 3 | $(package)_version_protobuf_cpp=$(native_$(package)_version_protobuf_cpp) 4 | $(package)_download_path=$(native_$(package)_download_path) 5 | $(package)_file_name=$(native_$(package)_file_name) 6 | $(package)_sha256_hash=$(native_$(package)_sha256_hash) 7 | $(package)_dependencies=native_$(package) 8 | $(package)_cxxflags=-std=c++11 9 | 10 | define $(package)_set_vars 11 | $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc 12 | $(package)_config_opts_linux=--with-pic 13 | endef 14 | 15 | define $(package)_config_cmds 16 | $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) 17 | endef 18 | 19 | define $(package)_build_cmds 20 | $(MAKE) -C src libprotobuf.la 21 | endef 22 | 23 | define $(package)_stage_cmds 24 | $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-nobase_includeHEADERS &&\ 25 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA &&\ 26 | cp src/.libs/libprotobuf.a $($(package)_staging_prefix_dir)/lib/ 27 | endef 28 | -------------------------------------------------------------------------------- /contrib/depends/packages/readline.mk: -------------------------------------------------------------------------------- 1 | package=readline 2 | $(package)_version=8.0 3 | $(package)_download_path=https://ftp.gnu.org/gnu/readline 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461 6 | $(package)_dependencies=ncurses 7 | 8 | define $(package)_set_vars 9 | $(package)_build_opts=CC="$($(package)_cc)" 10 | $(package)_config_opts+=--prefix=$(host_prefix) 11 | $(package)_config_opts+=--exec-prefix=$(host_prefix) 12 | $(package)_config_opts+=--host=$(HOST) 13 | $(package)_config_opts+=--disable-shared --with-curses 14 | $(package)_config_opts_release=--disable-debug-mode 15 | $(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC" 16 | endef 17 | 18 | define $(package)_preprocess_cmds 19 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub support 20 | endef 21 | 22 | define $(package)_config_cmds 23 | $($(package)_autoconf) 24 | endef 25 | 26 | define $(package)_build_cmds 27 | $(MAKE) $($(package)_build_opts) 28 | endef 29 | 30 | define $(package)_stage_cmds 31 | $(MAKE) install DESTDIR=$($(package)_staging_dir) prefix=$(host_prefix) exec-prefix=$(host_prefix) 32 | endef 33 | 34 | -------------------------------------------------------------------------------- /contrib/depends/packages/sodium.mk: -------------------------------------------------------------------------------- 1 | package=sodium 2 | $(package)_version=1.0.18 3 | $(package)_download_path=https://download.libsodium.org/libsodium/releases/ 4 | $(package)_file_name=libsodium-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--enable-static --disable-shared 9 | $(package)_config_opts+=--prefix=$(host_prefix) 10 | endef 11 | 12 | define $(package)_preprocess_cmds 13 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux 14 | endef 15 | 16 | define $(package)_config_cmds 17 | $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) 18 | endef 19 | 20 | define $(package)_build_cmds 21 | $(MAKE) 22 | endef 23 | 24 | define $(package)_stage_cmds 25 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 26 | endef 27 | 28 | define $(package)_postprocess_cmds 29 | rm lib/*.la 30 | endef 31 | 32 | -------------------------------------------------------------------------------- /contrib/depends/packages/unbound.mk: -------------------------------------------------------------------------------- 1 | package=unbound 2 | $(package)_version=1.22.0 3 | $(package)_download_path=https://www.nlnetlabs.nl/downloads/$(package)/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=c5dd1bdef5d5685b2cedb749158dd152c52d44f65529a34ac15cd88d4b1b3d43 6 | $(package)_dependencies=openssl 7 | $(package)_patches=no-expat.patch 8 | 9 | define $(package)_set_vars 10 | $(package)_config_opts=--disable-shared --enable-static --without-pyunbound --prefix=$(host_prefix) 11 | $(package)_config_opts+=--with-libexpat=no --with-ssl=$(host_prefix) --with-libevent=no 12 | $(package)_config_opts+=--without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only 13 | $(package)_config_opts_w64=--enable-static-exe --sysconfdir=/etc --prefix=$(host_prefix) --target=$(host_prefix) 14 | $(package)_config_opts_x86_64_darwin=ac_cv_func_SHA384_Init=yes 15 | $(package)_build_opts_mingw32=LDFLAGS="$($(package)_ldflags) -lpthread" 16 | $(package)_cflags_mingw32+="-D_WIN32_WINNT=0x600" 17 | endef 18 | 19 | # Remove blobs 20 | define $(package)_preprocess_cmds 21 | patch -p1 < $($(package)_patch_dir)/no-expat.patch &&\ 22 | rm configure~ doc/*.odp doc/*.pdf contrib/*.tar.gz contrib/*.tar.bz2 &&\ 23 | rm -rf testdata dnscrypt/testdata 24 | endef 25 | 26 | define $(package)_config_cmds 27 | $($(package)_autoconf) ac_cv_func_getentropy=no AR_FLAGS=$($(package)_arflags) 28 | endef 29 | 30 | define $(package)_build_cmds 31 | $(MAKE) $($(package)_build_opts) 32 | endef 33 | 34 | define $(package)_stage_cmds 35 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 36 | endef 37 | 38 | define $(package)_postprocess_cmds 39 | rm -rf share 40 | endef 41 | -------------------------------------------------------------------------------- /contrib/depends/packages/zeromq.mk: -------------------------------------------------------------------------------- 1 | package=zeromq 2 | $(package)_version=4.3.5 3 | $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--without-documentation --disable-shared --without-libsodium --disable-curve 9 | $(package)_cxxflags=-std=c++11 10 | endef 11 | 12 | define $(package)_preprocess_cmds 13 | cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config 14 | endef 15 | 16 | define $(package)_config_cmds 17 | $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) 18 | endef 19 | 20 | define $(package)_build_cmds 21 | $(MAKE) src/libzmq.la 22 | endef 23 | 24 | define $(package)_stage_cmds 25 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA 26 | endef 27 | 28 | define $(package)_postprocess_cmds 29 | rm -rf bin share &&\ 30 | rm lib/*.la 31 | endef 32 | 33 | -------------------------------------------------------------------------------- /contrib/depends/patches/native_cctools/no-build-date.patch: -------------------------------------------------------------------------------- 1 | diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp 2 | index 3bb8324..033760d 100644 3 | --- a/cctools/ld64/src/ld/Options.cpp 4 | +++ b/cctools/ld64/src/ld/Options.cpp 5 | @@ -4279,7 +4279,6 @@ void Options::buildSearchPaths(int argc, const char* argv[]) 6 | fVerbose = true; 7 | extern const char ldVersionString[]; 8 | fprintf(stderr, "%s", ldVersionString); 9 | - fprintf(stderr, "BUILD " __TIME__ " " __DATE__"\n"); 10 | fprintf(stderr, "configured to support archs: %s\n", ALL_SUPPORTED_ARCHS); 11 | // if only -v specified, exit cleanly 12 | if ( argc == 2 ) { 13 | -------------------------------------------------------------------------------- /contrib/depends/patches/native_libtapi/no_embed_git_rev.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/llvm/CMakeLists.txt b/src/llvm/CMakeLists.txt 2 | index ab92717c8..4ad621ea3 100644 3 | --- a/src/llvm/CMakeLists.txt 4 | +++ b/src/llvm/CMakeLists.txt 5 | @@ -752,9 +752,10 @@ set(LLVM_SRPM_USER_BINARY_SPECFILE ${CMAKE_CURRENT_SOURCE_DIR}/llvm.spec.in 6 | set(LLVM_SRPM_BINARY_SPECFILE ${CMAKE_CURRENT_BINARY_DIR}/llvm.spec) 7 | set(LLVM_SRPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/srpm") 8 | 9 | -# SVN_REVISION and GIT_COMMIT get set by the call to add_version_info_from_vcs. 10 | -# DUMMY_VAR contains a version string which we don't care about. 11 | -add_version_info_from_vcs(DUMMY_VAR) 12 | +# A call to add_version_info_from_vcs() was removed, leaving SVN_REVISION 13 | +# and GIT_COMMIT unset. Accordingly, LLVM_RPM_SPEC_REVISION is left empty. 14 | +# This variable appears to be unused. Since it may be used in a future 15 | +# update of native_libtapi this change serves as a precautionairy measure. 16 | if ( SVN_REVISION ) 17 | set(LLVM_RPM_SPEC_REVISION "r${SVN_REVISION}") 18 | elseif ( GIT_COMMIT ) 19 | diff --git a/src/llvm/cmake/modules/GenerateVersionFromCVS.cmake b/src/llvm/cmake/modules/GenerateVersionFromCVS.cmake 20 | index 6b1c71983..e16326ed6 100644 21 | --- a/src/llvm/cmake/modules/GenerateVersionFromCVS.cmake 22 | +++ b/src/llvm/cmake/modules/GenerateVersionFromCVS.cmake 23 | @@ -24,7 +24,7 @@ include(VersionFromVCS) 24 | set(ENV{TERM} "dumb") 25 | 26 | function(append_info name path) 27 | - add_version_info_from_vcs(REVISION ${path}) 28 | + set(REVISION "git-0000000") 29 | string(STRIP "${REVISION}" REVISION) 30 | file(APPEND "${HEADER_FILE}.txt" 31 | "#define ${name} \"${REVISION}\"\n") 32 | -------------------------------------------------------------------------------- /contrib/depends/patches/openssl/fix-android.patch: -------------------------------------------------------------------------------- 1 | OpenSSL's build system tries to be helpful by constructing the compiler name 2 | for us. This doesn't work with our setup. Instead, we want it to use 3 | $($(package)_cc), to ensure certain environment flags are unset. 4 | 5 | diff --git a/Configurations/15-android.conf b/Configurations/15-android.conf 6 | index 41ad9223e0..ea27a3bbba 100644 7 | --- a/Configurations/15-android.conf 8 | +++ b/Configurations/15-android.conf 9 | @@ -124,17 +124,7 @@ 10 | $user{RANLIB} = ":"; 11 | } 12 | } elsif ($is_standalone_toolchain) { 13 | - my $cc = $user{CC} // "clang"; 14 | - # One can probably argue that both clang and gcc should be 15 | - # probed, but support for "standalone toolchain" was added 16 | - # *after* announcement that gcc is being phased out, so 17 | - # favouring clang is considered adequate. Those who insist 18 | - # have option to enforce test for gcc with CC=gcc. 19 | - if (which("$triarch-$cc") !~ m|^$ndk|) { 20 | - die "no NDK $triarch-$cc on \$PATH"; 21 | - } 22 | - $user{CC} = $cc; 23 | - $user{CROSS_COMPILE} = "$triarch-"; 24 | + 25 | } elsif ($user{CC} eq "clang") { 26 | die "no NDK clang on \$PATH"; 27 | } else { 28 | -------------------------------------------------------------------------------- /contrib/depends/patches/unbound/no-expat.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index a41e3e1e..7d6a58f0 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -22053,6 +22053,7 @@ else $as_nop 6 | withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" 7 | fi 8 | 9 | +if test x_$withval = x_yes -o x_$withval != x_no; then 10 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libexpat" >&5 11 | printf %s "checking for libexpat... " >&6; } 12 | found_libexpat="no" 13 | @@ -22090,6 +22091,7 @@ else $as_nop 14 | ac_have_decl=0 15 | fi 16 | printf "%s\n" "#define HAVE_DECL_XML_STOPPARSER $ac_have_decl" >>confdefs.h 17 | +fi 18 | 19 | 20 | # hiredis (redis C client for cachedb) 21 | -------------------------------------------------------------------------------- /contrib/epee/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014-2024, The Monero Project 2 | # 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without modification, are 6 | # permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, this list of 9 | # conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | # of conditions and the following disclaimer in the documentation and/or other 13 | # materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | # used to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | add_subdirectory(src) 30 | 31 | -------------------------------------------------------------------------------- /contrib/epee/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Andrey N. Sabelnikov nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Andrey N. Sabelnikov BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /contrib/epee/README.md: -------------------------------------------------------------------------------- 1 | epee - is a small library of helpers, wrappers, tools and so on, used to make my life easier. 2 | -------------------------------------------------------------------------------- /contrib/epee/include/include_base_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above copyright 9 | // notice, this list of conditions and the following disclaimer in the 10 | // documentation and/or other materials provided with the distribution. 11 | // * Neither the name of the Andrey N. Sabelnikov nor the 12 | // names of its contributors may be used to endorse or promote products 13 | // derived from this software without specific prior written permission. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY 19 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | 27 | #pragma once 28 | 29 | #define BOOST_FILESYSTEM_VERSION 3 30 | #define ENABLE_RELEASE_LOGGING 31 | 32 | #include "misc_log_ex.h" 33 | 34 | 35 | -------------------------------------------------------------------------------- /contrib/epee/include/readline_buffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace rdln 8 | { 9 | typedef enum { empty, partial, full } linestatus; 10 | class readline_buffer : public std::stringbuf 11 | { 12 | public: 13 | readline_buffer(); 14 | void start(); 15 | void stop(); 16 | bool is_running() const 17 | { 18 | return m_cout_buf != NULL; 19 | } 20 | linestatus get_line(std::string& line) const; 21 | void set_prompt(const std::string& prompt); 22 | static void add_completion(const std::string& command); 23 | static const std::vector& get_completions(); 24 | 25 | protected: 26 | virtual int sync(); 27 | 28 | private: 29 | std::streambuf* m_cout_buf; 30 | size_t m_prompt_length; 31 | static std::vector& completion_commands(); 32 | }; 33 | 34 | class suspend_readline 35 | { 36 | public: 37 | suspend_readline(); 38 | ~suspend_readline(); 39 | private: 40 | readline_buffer* m_buffer; 41 | bool m_restart; 42 | }; 43 | 44 | void clear_screen(); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /contrib/epee/include/warnings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_MSC_VER) 4 | 5 | #define PUSH_WARNINGS __pragma(warning(push)) 6 | #define POP_WARNINGS __pragma(warning(pop)) 7 | #define DISABLE_VS_WARNINGS(w) __pragma(warning(disable: w)) 8 | #define DISABLE_GCC_WARNING(w) 9 | #define DISABLE_CLANG_WARNING(w) 10 | #define DISABLE_GCC_AND_CLANG_WARNING(w) 11 | 12 | #else 13 | 14 | #include 15 | 16 | #define PUSH_WARNINGS _Pragma("GCC diagnostic push") 17 | #define POP_WARNINGS _Pragma("GCC diagnostic pop") 18 | #define DISABLE_VS_WARNINGS(w) 19 | 20 | #if defined(__clang__) 21 | #define DISABLE_GCC_WARNING(w) 22 | #define DISABLE_CLANG_WARNING DISABLE_GCC_AND_CLANG_WARNING 23 | #else 24 | #define DISABLE_GCC_WARNING DISABLE_GCC_AND_CLANG_WARNING 25 | #define DISABLE_CLANG_WARNING(w) 26 | #endif 27 | 28 | #define DISABLE_GCC_AND_CLANG_WARNING(w) _Pragma(BOOST_PP_STRINGIZE(GCC diagnostic ignored BOOST_PP_STRINGIZE(-W##w))) 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /contrib/fuzz_testing/fuzz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | AFLFUZZ=$(which afl-fuzz) 4 | if ! test -x "$AFLFUZZ" 5 | then 6 | echo "afl-fuzz not found - install american-fuzzy-lop" 7 | exit 1 8 | fi 9 | 10 | type="$1" 11 | if test -z "$type" 12 | then 13 | echo "usage: $0 block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof" 14 | exit 1 15 | fi 16 | case "$type" in 17 | block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof|utf8) ;; 18 | *) echo "usage: $0 block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof|utf8"; exit 1 ;; 19 | esac 20 | 21 | if test -d "fuzz-out/$type" 22 | then 23 | dir="-" 24 | else 25 | dir="tests/data/fuzz/$type" 26 | fi 27 | 28 | mkdir -p fuzz-out 29 | afl-fuzz -i "$dir" -m none -t 250 -o fuzz-out/$type build/fuzz/tests/fuzz/${type}_fuzz_tests @@ 30 | -------------------------------------------------------------------------------- /contrib/guix/patches/gcc-remap-guix-store.patch: -------------------------------------------------------------------------------- 1 | Without ffile-prefix-map, the debug symbols will contain paths for the 2 | guix store which will include the hashes of each package. However, the 3 | hash for the same package will differ when on different architectures. 4 | In order to be reproducible regardless of the architecture used to build 5 | the package, map all guix store prefixes to something fixed, e.g. /usr. 6 | 7 | --- a/libgcc/Makefile.in 8 | +++ b/libgcc/Makefile.in 9 | @@ -854,7 +854,7 @@ endif 10 | # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and 11 | # LIB2ADDEHSHARED matter. (Usually all three are identical.) 12 | 13 | -c_flags := -fexceptions 14 | +c_flags := -fexceptions $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) 15 | 16 | ifeq ($(enable_shared),yes) 17 | 18 | -- 19 | 2.37.0 20 | 21 | -------------------------------------------------------------------------------- /contrib/guix/patches/glibc-2.27-guix-prefix.patch: -------------------------------------------------------------------------------- 1 | Without ffile-prefix-map, the debug symbols will contain paths for the 2 | guix store which will include the hashes of each package. However, the 3 | hash for the same package will differ when on different architectures. 4 | In order to be reproducible regardless of the architecture used to build 5 | the package, map all guix store prefixes to something fixed, e.g. /usr. 6 | 7 | We might be able to drop this in favour of using --with-nonshared-cflags 8 | when we being using newer versions of glibc. 9 | 10 | --- a/Makeconfig 11 | +++ b/Makeconfig 12 | @@ -992,6 +992,10 @@ object-suffixes := 13 | CPPFLAGS-.o = $(pic-default) 14 | # libc.a must be compiled with -fPIE/-fpie for static PIE. 15 | CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) $(pie-default) 16 | + 17 | +# Map Guix store paths to /usr 18 | +CFLAGS-.o += `find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;` 19 | + 20 | libtype.o := lib%.a 21 | object-suffixes += .o 22 | ifeq (yes,$(build-shared)) 23 | -------------------------------------------------------------------------------- /contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch: -------------------------------------------------------------------------------- 1 | Fixes a missing include in glibc. It is needed for riscv64 targets. 2 | This patch can be removed when we upgrade glibc to > 2.27. 3 | 4 | diff --git a/sysdeps/unix/sysv/linux/riscv/flush-icache.c b/sysdeps/unix/sysv/linux/riscv/flush-icache.c 5 | index d612ef4c6c..0b2042620b 100644 6 | --- a/sysdeps/unix/sysv/linux/riscv/flush-icache.c 7 | +++ b/sysdeps/unix/sysv/linux/riscv/flush-icache.c 8 | @@ -21,7 +21,11 @@ 9 | #include 10 | #include 11 | #include 12 | -#include 13 | +#if __has_include () 14 | +# include 15 | +#else 16 | +# include 17 | +#endif 18 | 19 | typedef int (*func_type) (void *, void *, unsigned long int); 20 | 21 | -- 22 | 2.31.1 23 | 24 | -------------------------------------------------------------------------------- /contrib/guix/patches/glibc-2.27-riscv64-fix-incorrect-jal-with-HIDDEN_JUMPTARGET.patch: -------------------------------------------------------------------------------- 1 | Backported from: https://sourceware.org/git/?p=glibc.git;a=commit;h=68389203832ab39dd0dbaabbc4059e7fff51c29b 2 | Context: https://sourceware.org/bugzilla/show_bug.cgi?id=28509 3 | 4 | Resolves a build failure with glibc 2.27 + binutils >=2.40. 5 | Patch can be removed if we update glibc to >= 2.35. 6 | 7 | diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S 8 | index cfbd276fc3..e2f8088a6e 100644 9 | --- a/sysdeps/riscv/setjmp.S 10 | +++ b/sysdeps/riscv/setjmp.S 11 | @@ -21,7 +21,7 @@ 12 | 13 | ENTRY (_setjmp) 14 | li a1, 0 15 | - j __sigsetjmp 16 | + j HIDDEN_JUMPTARGET (__sigsetjmp) 17 | END (_setjmp) 18 | ENTRY (setjmp) 19 | li a1, 1 20 | diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S 21 | index 9f1c7b41fd..a0d9575a08 100644 22 | --- a/sysdeps/unix/sysv/linux/riscv/setcontext.S 23 | +++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S 24 | @@ -95,6 +95,7 @@ LEAF (__setcontext) 25 | 99: j __syscall_error 26 | 27 | PSEUDO_END (__setcontext) 28 | +libc_hidden_def (__setcontext) 29 | weak_alias (__setcontext, setcontext) 30 | 31 | LEAF (__start_context) 32 | @@ -108,7 +109,7 @@ LEAF (__start_context) 33 | /* Invoke subsequent context if present, else exit(0). */ 34 | mv a0, s2 35 | beqz s2, 1f 36 | - jal __setcontext 37 | -1: j exit 38 | + jal HIDDEN_JUMPTARGET (__setcontext) 39 | +1: j HIDDEN_JUMPTARGET (exit) 40 | 41 | PSEUDO_END (__start_context) 42 | -------------------------------------------------------------------------------- /contrib/guix/patches/winpthreads-remap-guix-store.patch: -------------------------------------------------------------------------------- 1 | Without ffile-prefix-map, the debug symbols will contain paths for the 2 | guix store which will include the hashes of each package. However, the 3 | hash for the same package will differ when on different architectures. 4 | In order to be reproducible regardless of the architecture used to build 5 | the package, map all guix store prefixes to something fixed, e.g. /usr. 6 | 7 | --- a/mingw-w64-libraries/winpthreads/Makefile.in 8 | +++ b/mingw-w64-libraries/winpthreads/Makefile.in 9 | @@ -478,7 +478,7 @@ top_build_prefix = @top_build_prefix@ 10 | top_builddir = @top_builddir@ 11 | top_srcdir = @top_srcdir@ 12 | SUBDIRS = . tests 13 | -AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) 14 | +AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) 15 | ACLOCAL_AMFLAGS = -I m4 16 | lib_LTLIBRARIES = libwinpthread.la 17 | include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h 18 | -------------------------------------------------------------------------------- /contrib/lsan/lsan.supp: -------------------------------------------------------------------------------- 1 | leak:slow_hash_allocate_state 2 | -------------------------------------------------------------------------------- /contrib/rlwrap/monerocommands_bitmonerod.txt: -------------------------------------------------------------------------------- 1 | ban 2 | bans 3 | diff 4 | exit 5 | flush_txpool 6 | hard_fork_info 7 | help 8 | hide_hr 9 | is_key_image_spent 10 | limit 11 | limit_down 12 | limit_up 13 | out_peers 14 | output_histogram 15 | print_bc 16 | print_block 17 | print_cn 18 | print_height 19 | print_pl 20 | print_pool 21 | print_pool_sh 22 | print_pool_stats 23 | print_status 24 | print_tx 25 | q 26 | save 27 | set_log 28 | show_hr 29 | start_mining 30 | status 31 | stop_daemon 32 | stop_mining 33 | sync_info 34 | unban 35 | -------------------------------------------------------------------------------- /contrib/rlwrap/monerocommands_monero-wallet-cli.txt: -------------------------------------------------------------------------------- 1 | address 2 | balance 3 | bc_height 4 | check_tx_key 5 | export_key_images 6 | get_tx_key 7 | get_tx_note 8 | help 9 | import_key_images 10 | incoming_transfers 11 | integrated_address 12 | payments 13 | refresh 14 | rescan_bc 15 | rescan_spent 16 | save 17 | save_bc 18 | save_watch_only 19 | seed 20 | set 21 | set_tx_note 22 | show_transfers 23 | sign 24 | spendkey 25 | start_mining 26 | status 27 | stop_mining 28 | sweep_all 29 | sweep_unmixable 30 | transfer 31 | transfer_original 32 | verify 33 | viewkey 34 | -------------------------------------------------------------------------------- /contrib/shell/git-utils.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git_root() { 4 | git rev-parse --show-toplevel 2> /dev/null 5 | } 6 | 7 | git_head_version() { 8 | local recent_tag 9 | if recent_tag="$(git describe --exact-match HEAD 2> /dev/null)"; then 10 | echo "${recent_tag}" 11 | else 12 | git rev-parse --short=12 HEAD 13 | fi 14 | } 15 | -------------------------------------------------------------------------------- /docs/schema/pub_chain_minimal.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema", 3 | "definitions": { 4 | "binary32": { 5 | "type": "string", 6 | "description": "32-bytes binary data as hex", 7 | "minLength": 64, 8 | "maxLength": 64, 9 | "pattern": "^[0-9A-Fa-f]{64}$" 10 | }, 11 | "uint64": { 12 | "type": "integer", 13 | "minimum": 0, 14 | "maximum": 18446744073709551615 15 | } 16 | }, 17 | "title": "json-minimal-chain_main", 18 | "description": "Notification of new blocks added to main chain", 19 | "type": "object", 20 | "properties": { 21 | "first_height": { 22 | "description": "Height of the first block", 23 | "$ref": "#/definitions/uint64" 24 | }, 25 | "first_prev_id": { 26 | "description": "The previous hash of the first block", 27 | "$ref": "#/definitions/binary32" 28 | }, 29 | "ids": { 30 | "type": "array", 31 | "description": "The hash of each new block, in order", 32 | "minItems": 1, 33 | "items": { "$ref": "#/definitions/binary32" } 34 | } 35 | }, 36 | "required": ["first_height", "first_prev_id", "ids"] 37 | } 38 | -------------------------------------------------------------------------------- /docs/schema/pub_txpool_minimal.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema", 3 | "definitions": { 4 | "binary32": { 5 | "type": "string", 6 | "description": "32-bytes binary data as hex", 7 | "minLength": 64, 8 | "maxLength": 64, 9 | "pattern": "^[0-9A-Fa-f]{64}$" 10 | }, 11 | "uint64": { 12 | "type": "integer", 13 | "minimum": 0, 14 | "maximum": 18446744073709551615 15 | }, 16 | "transaction": { 17 | "type": "object", 18 | "properties": { 19 | "blob_size": { "$ref": "#/definitions/uint64" }, 20 | "fee": { "$ref": "#/definitions/uint64" }, 21 | "id": { 22 | "description": "Unique (cryptographic hash) identifier", 23 | "$ref": "#/definitions/binary32" 24 | }, 25 | "weight": { "$ref": "#/definitions/uint64" } 26 | 27 | }, 28 | "required": ["id", "blob_size", "fee", "weight"] 29 | } 30 | }, 31 | "title": "json-minimal-txpool_add", 32 | "description": "List of newly observed transactions", 33 | "type": "array", 34 | "items": { "$ref": "#/definitions/transaction" } 35 | } 36 | -------------------------------------------------------------------------------- /external/db_drivers/liblmdb/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright 2011-2019 Howard Chu, Symas Corp. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted only as authorized by the OpenLDAP 6 | Public License. 7 | 8 | A copy of this license is available in the file LICENSE in the 9 | top-level directory of the distribution or, alternatively, at 10 | . 11 | 12 | OpenLDAP is a registered trademark of the OpenLDAP Foundation. 13 | 14 | Individual files and/or contributed packages may be copyright by 15 | other parties and/or subject to additional restrictions. 16 | 17 | This work also contains materials derived from public sources. 18 | 19 | Additional information about OpenLDAP can be obtained at 20 | . 21 | -------------------------------------------------------------------------------- /external/db_drivers/liblmdb/mdb_drop.1: -------------------------------------------------------------------------------- 1 | .TH MDB_DROP 1 "2017/11/19" "LMDB 0.9.70" 2 | .\" Copyright 2014-2018 Howard Chu, Symas Corp. All Rights Reserved. 3 | .\" Copying restrictions apply. See COPYRIGHT/LICENSE. 4 | .SH NAME 5 | mdb_drop \- LMDB database delete tool 6 | .SH SYNOPSIS 7 | .B mdb_drop 8 | [\c 9 | .BR \-V ] 10 | [\c 11 | .BR \-n ] 12 | [\c 13 | .BR \-d ] 14 | [\c 15 | .BI \-s \ subdb\fR] 16 | .BR \ envpath 17 | .SH DESCRIPTION 18 | The 19 | .B mdb_drop 20 | utility empties or deletes a database in the specified 21 | environment. 22 | .SH OPTIONS 23 | .TP 24 | .BR \-V 25 | Write the library version number to the standard output, and exit. 26 | .TP 27 | .BR \-n 28 | Operate on an LMDB database which does not use subdirectories. 29 | .TP 30 | .BR \-d 31 | Delete the specified database, don't just empty it. 32 | .TP 33 | .BR \-s \ subdb 34 | Operate on a specific subdatabase. If no database is specified, only the main database is dropped. 35 | .SH DIAGNOSTICS 36 | Exit status is zero if no errors occur. 37 | Errors result in a non-zero exit status and 38 | a diagnostic message being written to standard error. 39 | .SH AUTHOR 40 | Howard Chu of Symas Corporation 41 | -------------------------------------------------------------------------------- /external/db_drivers/liblmdb/tooltag: -------------------------------------------------------------------------------- 1 | 2 | 3 | mdb_copy_1 4 | mdb_copy - environment copy tool 5 | mdb_copy.1 6 | 7 | 8 | mdb_drop_1 9 | mdb_drop - database delete tool 10 | mdb_drop.1 11 | 12 | 13 | mdb_dump_1 14 | mdb_dump - environment export tool 15 | mdb_dump.1 16 | 17 | 18 | mdb_load_1 19 | mdb_load - environment import tool 20 | mdb_load.1 21 | 22 | 23 | mdb_stat_1 24 | mdb_stat - environment status tool 25 | mdb_stat.1 26 | 27 | 28 | -------------------------------------------------------------------------------- /external/easylogging++/ea_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define ELPP_THREAD_SAFE 6 | #define ELPP_DEFAULT_LOG_FILE "" 7 | #define ELPP_DISABLE_DEFAULT_CRASH_HANDLING 8 | #define ELPP_NO_CHECK_MACROS 9 | #define ELPP_WINSOCK2 10 | #define ELPP_NO_DEBUG_MACROS 11 | #define ELPP_UTC_DATETIME 12 | 13 | #ifdef EASYLOGGING_CC 14 | #if !(!defined __GLIBC__ || !defined __GNUC__ || defined __MINGW32__ || defined __MINGW64__ || defined __ANDROID__ || defined __NetBSD__) || (defined __FreeBSD__) 15 | #define ELPP_FEATURE_CRASH_LOG 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /external/qrcodegen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(libqrcodegen) 2 | 3 | add_library(qrcodegen STATIC QrCode.cpp) 4 | set_target_properties(qrcodegen PROPERTIES POSITION_INDEPENDENT_CODE ON) 5 | set_target_properties(qrcodegen PROPERTIES CXX_STANDARD 11) 6 | 7 | target_include_directories(qrcodegen PUBLIC 8 | ${CMAKE_CURRENT_SOURCE_DIR}) 9 | -------------------------------------------------------------------------------- /src/blockchain_utilities/blockchain-stats-readme.md: -------------------------------------------------------------------------------- 1 | # Monero Blockchain Stats 2 | 3 | Monero Blockchain Stats utlity exports daily statistics for the monero blockchain from creation through current state. 4 | 5 | ## Usage: 6 | 7 | See also the utility's help option. `monero-blockchain-stats --help` 8 | 9 | From the command line run: 10 | 11 | `$ monero-blockchain-stats` 12 | 13 | This loads the existing blockchain and prints the results to the terminal. Default printed data includes Blocks per Day, Total Blocks, Transactions per Day, Total Transactions, Bytes per Day and Total Bytes. The format of the output is in tab delimited csv which is printed to the console. Redirecting or piping the output of the command allows for saving the output to a csv file or feeding your own script accordingly, i.e.: 14 | 15 | - `monero-blockchain-stats > stats-$(date +'%Y-%m-%d').csv` 16 | - `monero-blockchain-stats | save-to-database.sh` 17 | 18 | ### Options 19 | `--data-dir arg` 20 | to specify location of blockchain storage 21 | 22 | `--testnet` 23 | Run on testnet. 24 | 25 | `--stagenet` 26 | Run on stagenet. 27 | 28 | `--log-level arg` 29 | 0-4 or categories 30 | 31 | `--block-start arg (=0)` 32 | start at block number 33 | 34 | `--block-stop arg (=0)` 35 | Stop at block number 36 | 37 | `--with-inputs` 38 | with input stats 39 | 40 | `--with-outputs` 41 | with output stats 42 | 43 | `--with-ringsize` 44 | with ringsize stats 45 | 46 | `--with-hours` 47 | with txns per hour 48 | 49 | `--with-emission` 50 | with coin emission 51 | 52 | `--with-fees` 53 | with txn fees 54 | 55 | `--with-diff` 56 | with difficulty 57 | -------------------------------------------------------------------------------- /src/blocks/blocks.cpp: -------------------------------------------------------------------------------- 1 | #include "blocks.h" 2 | 3 | #include 4 | 5 | extern const unsigned char checkpoints[]; 6 | extern const size_t checkpoints_len; 7 | extern const unsigned char stagenet_blocks[]; 8 | extern const size_t stagenet_blocks_len; 9 | extern const unsigned char testnet_blocks[]; 10 | extern const size_t testnet_blocks_len; 11 | 12 | namespace blocks 13 | { 14 | 15 | const std::unordered_map, std::hash> CheckpointsByNetwork = { 16 | {cryptonote::network_type::MAINNET, {checkpoints, checkpoints_len}}, 17 | {cryptonote::network_type::STAGENET, {stagenet_blocks, stagenet_blocks_len}}, 18 | {cryptonote::network_type::TESTNET, {testnet_blocks, testnet_blocks_len}} 19 | }; 20 | 21 | const epee::span GetCheckpointsData(cryptonote::network_type network) 22 | { 23 | const auto it = CheckpointsByNetwork.find(network); 24 | if (it != CheckpointsByNetwork.end()) 25 | { 26 | return it->second; 27 | } 28 | return nullptr; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/blocks/blocks.h: -------------------------------------------------------------------------------- 1 | #ifndef SRC_BLOCKS_BLOCKS_H_ 2 | #define SRC_BLOCKS_BLOCKS_H_ 3 | 4 | #include "cryptonote_config.h" 5 | #include "span.h" 6 | 7 | namespace blocks 8 | { 9 | const epee::span GetCheckpointsData(cryptonote::network_type network); 10 | } 11 | 12 | #endif /* SRC_BLOCKS_BLOCKS_H_ */ 13 | -------------------------------------------------------------------------------- /src/blocks/checkpoints.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/src/blocks/checkpoints.dat -------------------------------------------------------------------------------- /src/blocks/stagenet_blocks.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/src/blocks/stagenet_blocks.dat -------------------------------------------------------------------------------- /src/blocks/testnet_blocks.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/src/blocks/testnet_blocks.dat -------------------------------------------------------------------------------- /src/common/pod-class.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2024, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #define POD_CLASS struct 34 | -------------------------------------------------------------------------------- /src/common/powerof.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tools 6 | { 7 | template 8 | struct PowerOf 9 | { 10 | enum Data : uint64_t 11 | { 12 | // a^b = a * a^(b-1) 13 | Value = a * PowerOf::Value, 14 | }; 15 | }; 16 | 17 | template 18 | struct PowerOf 19 | { 20 | enum Data : uint64_t 21 | { 22 | // a^0 = 1 23 | Value = 1, 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /src/common/timings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class TimingsDatabase 9 | { 10 | public: 11 | struct instance 12 | { 13 | time_t t; 14 | size_t npoints; 15 | double min, max, mean, median, stddev, npskew; 16 | std::vector deciles; 17 | }; 18 | 19 | public: 20 | TimingsDatabase(); 21 | TimingsDatabase(const std::string &filename, const bool load_previous = false); 22 | ~TimingsDatabase(); 23 | 24 | const instance* get_most_recent(const char *name) const; 25 | void add(const char *name, const instance &data); 26 | bool save(const bool print_current_time = true); 27 | 28 | private: 29 | bool load(); 30 | 31 | private: 32 | std::string filename; 33 | std::vector> instances; 34 | }; 35 | -------------------------------------------------------------------------------- /src/crypto/CryptonightR_JIT.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTONIGHTR_JIT_H 2 | #define CRYPTONIGHTR_JIT_H 3 | 4 | #include 5 | #include 6 | 7 | // Minimalistic JIT code generator for random math sequence in CryptonightR 8 | // 9 | // Usage: 10 | // - Allocate writable and executable memory 11 | // - Call v4_generate_JIT_code with "buf" pointed to memory allocated on previous step 12 | // - Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter 13 | 14 | typedef void (*v4_random_math_JIT_func)(uint32_t* r) 15 | #if defined __i386 || defined __x86_64__ 16 | __attribute__((sysv_abi)) 17 | #endif 18 | ; 19 | 20 | // Given the random math sequence, generates machine code (x86-64) for it 21 | // Returns 0 if code was generated successfully 22 | // Returns -1 if provided buffer was too small 23 | int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_func buf, const size_t buf_size); 24 | 25 | #endif // CRYPTONIGHTR_JIT_H 26 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CC=gcc 3 | CFLAGS=-O2 -Wall 4 | 5 | OBJS= fe25519.o ge25519.o sc25519.o sha512-blocks.o sha512-hash.o ed25519.o randombytes.o verify.o 6 | test: test.o $(OBJS) 7 | gcc -o $@ $^ 8 | 9 | clean: 10 | rm -f *.o test 11 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/api.h: -------------------------------------------------------------------------------- 1 | #define CRYPTO_BYTES 32 2 | #define CRYPTO_SCALARBYTES 32 3 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/crypto_int32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int32_h 2 | #define crypto_int32_h 3 | 4 | typedef int crypto_int32; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/crypto_sign.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_sign_edwards25519sha512batch_H 2 | #define crypto_sign_edwards25519sha512batch_H 3 | 4 | #define SECRETKEYBYTES 64 5 | #define PUBLICKEYBYTES 32 6 | #define SIGNATUREBYTES 64 7 | 8 | extern int crypto_sign(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); 9 | extern int crypto_sign_open(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); 10 | extern int crypto_sign_keypair(unsigned char *,unsigned char *); 11 | extern int crypto_sign_publickey(unsigned char *pk, unsigned char *sk, unsigned char *seed); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/crypto_uint32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint32_h 2 | #define crypto_uint32_h 3 | 4 | typedef unsigned int crypto_uint32; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/crypto_verify_32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_32_H 2 | #define crypto_verify_32_H 3 | 4 | #define crypto_verify_32_ref_BYTES 32 5 | extern int crypto_verify_32(const unsigned char *,const unsigned char *); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ietf.txt: -------------------------------------------------------------------------------- 1 | https://tools.ietf.org/id/draft-josefsson-eddsa-ed25519-02.txt 2 | 3 | Note: This draft is now superseded by https://datatracker.ietf.org/doc/rfc8032/ 4 | (review of the differences is left as an exercise for the reader) 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/libsodium_LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 3 | * Frank Denis 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_int32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int32_H 2 | #define crypto_int32_H 3 | 4 | #include 5 | 6 | typedef int32_t crypto_int32; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_int64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int64_H 2 | #define crypto_int64_H 3 | 4 | #include 5 | 6 | typedef int64_t crypto_int64; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_uint16.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint16_H 2 | #define crypto_uint16_H 3 | 4 | #include 5 | 6 | typedef uint16_t crypto_uint16; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_uint32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint32_H 2 | #define crypto_uint32_H 3 | 4 | #include 5 | 6 | typedef uint32_t crypto_uint32; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_uint64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint64_H 2 | #define crypto_uint64_H 3 | 4 | #include 5 | 6 | typedef uint64_t crypto_uint64; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_uint8.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint8_H 2 | #define crypto_uint8_H 3 | 4 | #include 5 | 6 | typedef uint8_t crypto_uint8; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/crypto_verify_32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_32_H 2 | #define crypto_verify_32_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_32_BYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_32_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_32(const unsigned char *x, const unsigned char *y); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/include/sodium/randombytes.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_H 3 | #define randombytes_H 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include "export.h" 11 | 12 | #ifdef __cplusplus 13 | # if __GNUC__ 14 | # pragma GCC diagnostic ignored "-Wlong-long" 15 | # endif 16 | extern "C" { 17 | #endif 18 | 19 | typedef struct randombytes_implementation { 20 | const char *(*implementation_name)(void); /* required */ 21 | uint32_t (*random)(void); /* required */ 22 | void (*stir)(void); /* optional */ 23 | uint32_t (*uniform)(const uint32_t upper_bound); /* optional, a default implementation will be used if NULL */ 24 | void (*buf)(void * const buf, const size_t size); /* required */ 25 | int (*close)(void); /* optional */ 26 | } randombytes_implementation; 27 | 28 | SODIUM_EXPORT 29 | void randombytes_buf(void * const buf, const size_t size); 30 | 31 | SODIUM_EXPORT 32 | uint32_t randombytes_random(void); 33 | 34 | SODIUM_EXPORT 35 | uint32_t randombytes_uniform(const uint32_t upper_bound); 36 | 37 | SODIUM_EXPORT 38 | void randombytes_stir(void); 39 | 40 | SODIUM_EXPORT 41 | int randombytes_close(void); 42 | 43 | SODIUM_EXPORT 44 | int randombytes_set_implementation(randombytes_implementation *impl); 45 | 46 | SODIUM_EXPORT 47 | const char *randombytes_implementation_name(void); 48 | 49 | /* -- NaCl compatibility interface -- */ 50 | 51 | SODIUM_EXPORT 52 | void randombytes(unsigned char * const buf, const unsigned long long buf_len); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/randombytes.c: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* it's really stupid that there isn't a syscall for this */ 8 | 9 | static int ed25519_random_fd = -1; 10 | 11 | static inline void ed25519_randombytes(unsigned char *x,unsigned long long xlen) 12 | { 13 | int i; 14 | 15 | if (ed25519_random_fd == -1) { 16 | for (;;) { 17 | ed25519_random_fd = open("/dev/urandom",O_RDONLY); 18 | if (ed25519_random_fd != -1) break; 19 | sleep(1); 20 | } 21 | } 22 | 23 | while (xlen > 0) { 24 | if (xlen < 1048576) i = xlen; else i = 1048576; 25 | 26 | i = read(ed25519_random_fd,x,i); 27 | if (i < 1) { 28 | sleep(1); 29 | continue; 30 | } 31 | 32 | x += i; 33 | xlen -= i; 34 | } 35 | } 36 | 37 | #else 38 | #include 39 | #include 40 | 41 | static inline void ed25519_randombytes(unsigned char *x,unsigned long long xlen) 42 | { 43 | HCRYPTPROV prov = 0; 44 | 45 | CryptAcquireContextW(&prov, NULL, NULL, 46 | PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT); 47 | 48 | CryptGenRandom(prov, xlen, x); 49 | CryptReleaseContext(prov, 0); 50 | } 51 | 52 | #endif /* _WIN32 */ 53 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/Makefile: -------------------------------------------------------------------------------- 1 | all: d.h d2.h sqrtm1.h base.h base2.h \ 2 | ge_add.h ge_sub.h \ 3 | ge_madd.h ge_msub.h \ 4 | ge_p2_dbl.h \ 5 | pow225521.h pow22523.h 6 | 7 | d.h: d.py 8 | python d.py > d.h 9 | 10 | d2.h: d2.py 11 | python d2.py > d2.h 12 | 13 | sqrtm1.h: sqrtm1.py 14 | python sqrtm1.py > sqrtm1.h 15 | 16 | base.h: base.py 17 | python base.py > base.h 18 | 19 | base2.h: base2.py 20 | python base2.py > base2.h 21 | 22 | ge_add.h: ge_add.q q2h.sh 23 | ./q2h.sh < ge_add.q > ge_add.h 24 | 25 | ge_sub.h: ge_sub.q q2h.sh 26 | ./q2h.sh < ge_sub.q > ge_sub.h 27 | 28 | ge_madd.h: ge_madd.q q2h.sh 29 | ./q2h.sh < ge_madd.q > ge_madd.h 30 | 31 | ge_msub.h: ge_msub.q q2h.sh 32 | ./q2h.sh < ge_msub.q > ge_msub.h 33 | 34 | ge_p2_dbl.h: ge_p2_dbl.q q2h.sh 35 | ./q2h.sh < ge_p2_dbl.q > ge_p2_dbl.h 36 | 37 | pow22523.h: pow22523.q q2h.sh 38 | ./q2h.sh < pow22523.q > pow22523.h 39 | 40 | pow225521.h: pow225521.q q2h.sh 41 | ./q2h.sh < pow225521.q > pow225521.h 42 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/README.md: -------------------------------------------------------------------------------- 1 | This code comes from Daniel J. Bernstein's SUPERCOP source, 2 | released in the public domain. 3 | 4 | [http://ed25519.cr.yp.to/software.html](http://ed25519.cr.yp.to/software.html) 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/api.h: -------------------------------------------------------------------------------- 1 | #define CRYPTO_SECRETKEYBYTES 64 2 | #define CRYPTO_PUBLICKEYBYTES 32 3 | #define CRYPTO_BYTES 64 4 | #define CRYPTO_DETERMINISTIC 1 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/base.py: -------------------------------------------------------------------------------- 1 | b = 256 2 | q = 2**255 - 19 3 | l = 2**252 + 27742317777372353535851937790883648493 4 | 5 | def expmod(b,e,m): 6 | if e == 0: return 1 7 | t = expmod(b,e/2,m)**2 % m 8 | if e & 1: t = (t*b) % m 9 | return t 10 | 11 | def inv(x): 12 | return expmod(x,q-2,q) 13 | 14 | d = -121665 * inv(121666) 15 | I = expmod(2,(q-1)/4,q) 16 | 17 | def xrecover(y): 18 | xx = (y*y-1) * inv(d*y*y+1) 19 | x = expmod(xx,(q+3)/8,q) 20 | if (x*x - xx) % q != 0: x = (x*I) % q 21 | if x % 2 != 0: x = q-x 22 | return x 23 | 24 | By = 4 * inv(5) 25 | Bx = xrecover(By) 26 | B = [Bx % q,By % q] 27 | 28 | def edwards(P,Q): 29 | x1 = P[0] 30 | y1 = P[1] 31 | x2 = Q[0] 32 | y2 = Q[1] 33 | x3 = (x1*y2+x2*y1) * inv(1+d*x1*x2*y1*y2) 34 | y3 = (y1*y2+x1*x2) * inv(1-d*x1*x2*y1*y2) 35 | return [x3 % q,y3 % q] 36 | 37 | def radix255(x): 38 | x = x % q 39 | if x + x > q: x -= q 40 | x = [x,0,0,0,0,0,0,0,0,0] 41 | bits = [26,25,26,25,26,25,26,25,26,25] 42 | for i in range(9): 43 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 44 | x[i] -= carry * 2**bits[i] 45 | x[i + 1] += carry 46 | result = "" 47 | for i in range(9): 48 | result = result+str(x[i])+"," 49 | result = result+str(x[9]) 50 | return result 51 | 52 | Bi = B 53 | for i in range(32): 54 | print "{" 55 | Bij = Bi 56 | for j in range(8): 57 | print " {" 58 | print " {",radix255(Bij[1]+Bij[0]),"}," 59 | print " {",radix255(Bij[1]-Bij[0]),"}," 60 | print " {",radix255(2*d*Bij[0]*Bij[1]),"}," 61 | Bij = edwards(Bij,Bi) 62 | print " }," 63 | print "}," 64 | for k in range(8): 65 | Bi = edwards(Bi,Bi) 66 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/base2.py: -------------------------------------------------------------------------------- 1 | b = 256 2 | q = 2**255 - 19 3 | l = 2**252 + 27742317777372353535851937790883648493 4 | 5 | def expmod(b,e,m): 6 | if e == 0: return 1 7 | t = expmod(b,e/2,m)**2 % m 8 | if e & 1: t = (t*b) % m 9 | return t 10 | 11 | def inv(x): 12 | return expmod(x,q-2,q) 13 | 14 | d = -121665 * inv(121666) 15 | I = expmod(2,(q-1)/4,q) 16 | 17 | def xrecover(y): 18 | xx = (y*y-1) * inv(d*y*y+1) 19 | x = expmod(xx,(q+3)/8,q) 20 | if (x*x - xx) % q != 0: x = (x*I) % q 21 | if x % 2 != 0: x = q-x 22 | return x 23 | 24 | By = 4 * inv(5) 25 | Bx = xrecover(By) 26 | B = [Bx % q,By % q] 27 | 28 | def edwards(P,Q): 29 | x1 = P[0] 30 | y1 = P[1] 31 | x2 = Q[0] 32 | y2 = Q[1] 33 | x3 = (x1*y2+x2*y1) * inv(1+d*x1*x2*y1*y2) 34 | y3 = (y1*y2+x1*x2) * inv(1-d*x1*x2*y1*y2) 35 | return [x3 % q,y3 % q] 36 | 37 | def radix255(x): 38 | x = x % q 39 | if x + x > q: x -= q 40 | x = [x,0,0,0,0,0,0,0,0,0] 41 | bits = [26,25,26,25,26,25,26,25,26,25] 42 | for i in range(9): 43 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 44 | x[i] -= carry * 2**bits[i] 45 | x[i + 1] += carry 46 | result = "" 47 | for i in range(9): 48 | result = result+str(x[i])+"," 49 | result = result+str(x[9]) 50 | return result 51 | 52 | Bi = B 53 | 54 | for i in range(8): 55 | print " {" 56 | print " {",radix255(Bi[1]+Bi[0]),"}," 57 | print " {",radix255(Bi[1]-Bi[0]),"}," 58 | print " {",radix255(2*d*Bi[0]*Bi[1]),"}," 59 | print " }," 60 | Bi = edwards(B,edwards(B,Bi)) 61 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/d.h: -------------------------------------------------------------------------------- 1 | -10913610,13857413,-15372611,6949391,114729,-8787816,-6275908,-3247719,-18696448,-12055116 2 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/d.py: -------------------------------------------------------------------------------- 1 | q = 2**255 - 19 2 | 3 | def expmod(b,e,m): 4 | if e == 0: return 1 5 | t = expmod(b,e/2,m)**2 % m 6 | if e & 1: t = (t*b) % m 7 | return t 8 | 9 | def inv(x): 10 | return expmod(x,q-2,q) 11 | 12 | def radix255(x): 13 | x = x % q 14 | if x + x > q: x -= q 15 | x = [x,0,0,0,0,0,0,0,0,0] 16 | bits = [26,25,26,25,26,25,26,25,26,25] 17 | for i in range(9): 18 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 19 | x[i] -= carry * 2**bits[i] 20 | x[i + 1] += carry 21 | result = "" 22 | for i in range(9): 23 | result = result+str(x[i])+"," 24 | result = result+str(x[9]) 25 | return result 26 | 27 | d = -121665 * inv(121666) 28 | print radix255(d) 29 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/d2.h: -------------------------------------------------------------------------------- 1 | -21827239,-5839606,-30745221,13898782,229458,15978800,-12551817,-6495438,29715968,9444199 2 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/d2.py: -------------------------------------------------------------------------------- 1 | q = 2**255 - 19 2 | 3 | def expmod(b,e,m): 4 | if e == 0: return 1 5 | t = expmod(b,e/2,m)**2 % m 6 | if e & 1: t = (t*b) % m 7 | return t 8 | 9 | def inv(x): 10 | return expmod(x,q-2,q) 11 | 12 | def radix255(x): 13 | x = x % q 14 | if x + x > q: x -= q 15 | x = [x,0,0,0,0,0,0,0,0,0] 16 | bits = [26,25,26,25,26,25,26,25,26,25] 17 | for i in range(9): 18 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 19 | x[i] -= carry * 2**bits[i] 20 | x[i + 1] += carry 21 | result = "" 22 | for i in range(9): 23 | result = result+str(x[i])+"," 24 | result = result+str(x[9]) 25 | return result 26 | 27 | d = -121665 * inv(121666) 28 | print radix255(d*2) 29 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/description: -------------------------------------------------------------------------------- 1 | EdDSA signatures using Curve25519 2 | from https://hyperelliptic.org/ebats/supercop-20141124.tar.bz2 3 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/designers: -------------------------------------------------------------------------------- 1 | Daniel J. Bernstein 2 | Niels Duif 3 | Tanja Lange 4 | Peter Schwabe 5 | Bo-Yin Yang 6 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_0.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = 0 5 | */ 6 | 7 | void fe_0(fe h) 8 | { 9 | h[0] = 0; 10 | h[1] = 0; 11 | h[2] = 0; 12 | h[3] = 0; 13 | h[4] = 0; 14 | h[5] = 0; 15 | h[6] = 0; 16 | h[7] = 0; 17 | h[8] = 0; 18 | h[9] = 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_1.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = 1 5 | */ 6 | 7 | void fe_1(fe h) 8 | { 9 | h[0] = 1; 10 | h[1] = 0; 11 | h[2] = 0; 12 | h[3] = 0; 13 | h[4] = 0; 14 | h[5] = 0; 15 | h[6] = 0; 16 | h[7] = 0; 17 | h[8] = 0; 18 | h[9] = 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_add.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f + g 5 | Can overlap h with f or g. 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 9 | |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 10 | 11 | Postconditions: 12 | |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 13 | */ 14 | 15 | void fe_add(fe h,const fe f,const fe g) 16 | { 17 | crypto_int32 f0 = f[0]; 18 | crypto_int32 f1 = f[1]; 19 | crypto_int32 f2 = f[2]; 20 | crypto_int32 f3 = f[3]; 21 | crypto_int32 f4 = f[4]; 22 | crypto_int32 f5 = f[5]; 23 | crypto_int32 f6 = f[6]; 24 | crypto_int32 f7 = f[7]; 25 | crypto_int32 f8 = f[8]; 26 | crypto_int32 f9 = f[9]; 27 | crypto_int32 g0 = g[0]; 28 | crypto_int32 g1 = g[1]; 29 | crypto_int32 g2 = g[2]; 30 | crypto_int32 g3 = g[3]; 31 | crypto_int32 g4 = g[4]; 32 | crypto_int32 g5 = g[5]; 33 | crypto_int32 g6 = g[6]; 34 | crypto_int32 g7 = g[7]; 35 | crypto_int32 g8 = g[8]; 36 | crypto_int32 g9 = g[9]; 37 | crypto_int32 h0 = f0 + g0; 38 | crypto_int32 h1 = f1 + g1; 39 | crypto_int32 h2 = f2 + g2; 40 | crypto_int32 h3 = f3 + g3; 41 | crypto_int32 h4 = f4 + g4; 42 | crypto_int32 h5 = f5 + g5; 43 | crypto_int32 h6 = f6 + g6; 44 | crypto_int32 h7 = f7 + g7; 45 | crypto_int32 h8 = f8 + g8; 46 | crypto_int32 h9 = f9 + g9; 47 | h[0] = h0; 48 | h[1] = h1; 49 | h[2] = h2; 50 | h[3] = h3; 51 | h[4] = h4; 52 | h[5] = h5; 53 | h[6] = h6; 54 | h[7] = h7; 55 | h[8] = h8; 56 | h[9] = h9; 57 | } 58 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_cmov.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | Replace (f,g) with (g,g) if b == 1; 5 | replace (f,g) with (f,g) if b == 0. 6 | 7 | Preconditions: b in {0,1}. 8 | */ 9 | 10 | void fe_cmov(fe f,const fe g,unsigned int b) 11 | { 12 | crypto_int32 f0 = f[0]; 13 | crypto_int32 f1 = f[1]; 14 | crypto_int32 f2 = f[2]; 15 | crypto_int32 f3 = f[3]; 16 | crypto_int32 f4 = f[4]; 17 | crypto_int32 f5 = f[5]; 18 | crypto_int32 f6 = f[6]; 19 | crypto_int32 f7 = f[7]; 20 | crypto_int32 f8 = f[8]; 21 | crypto_int32 f9 = f[9]; 22 | crypto_int32 g0 = g[0]; 23 | crypto_int32 g1 = g[1]; 24 | crypto_int32 g2 = g[2]; 25 | crypto_int32 g3 = g[3]; 26 | crypto_int32 g4 = g[4]; 27 | crypto_int32 g5 = g[5]; 28 | crypto_int32 g6 = g[6]; 29 | crypto_int32 g7 = g[7]; 30 | crypto_int32 g8 = g[8]; 31 | crypto_int32 g9 = g[9]; 32 | crypto_int32 x0 = f0 ^ g0; 33 | crypto_int32 x1 = f1 ^ g1; 34 | crypto_int32 x2 = f2 ^ g2; 35 | crypto_int32 x3 = f3 ^ g3; 36 | crypto_int32 x4 = f4 ^ g4; 37 | crypto_int32 x5 = f5 ^ g5; 38 | crypto_int32 x6 = f6 ^ g6; 39 | crypto_int32 x7 = f7 ^ g7; 40 | crypto_int32 x8 = f8 ^ g8; 41 | crypto_int32 x9 = f9 ^ g9; 42 | b = -b; 43 | x0 &= b; 44 | x1 &= b; 45 | x2 &= b; 46 | x3 &= b; 47 | x4 &= b; 48 | x5 &= b; 49 | x6 &= b; 50 | x7 &= b; 51 | x8 &= b; 52 | x9 &= b; 53 | f[0] = f0 ^ x0; 54 | f[1] = f1 ^ x1; 55 | f[2] = f2 ^ x2; 56 | f[3] = f3 ^ x3; 57 | f[4] = f4 ^ x4; 58 | f[5] = f5 ^ x5; 59 | f[6] = f6 ^ x6; 60 | f[7] = f7 ^ x7; 61 | f[8] = f8 ^ x8; 62 | f[9] = f9 ^ x9; 63 | } 64 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_copy.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f 5 | */ 6 | 7 | void fe_copy(fe h,const fe f) 8 | { 9 | crypto_int32 f0 = f[0]; 10 | crypto_int32 f1 = f[1]; 11 | crypto_int32 f2 = f[2]; 12 | crypto_int32 f3 = f[3]; 13 | crypto_int32 f4 = f[4]; 14 | crypto_int32 f5 = f[5]; 15 | crypto_int32 f6 = f[6]; 16 | crypto_int32 f7 = f[7]; 17 | crypto_int32 f8 = f[8]; 18 | crypto_int32 f9 = f[9]; 19 | h[0] = f0; 20 | h[1] = f1; 21 | h[2] = f2; 22 | h[3] = f3; 23 | h[4] = f4; 24 | h[5] = f5; 25 | h[6] = f6; 26 | h[7] = f7; 27 | h[8] = f8; 28 | h[9] = f9; 29 | } 30 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_invert.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | void fe_invert(fe out,const fe z) 4 | { 5 | fe t0; 6 | fe t1; 7 | fe t2; 8 | fe t3; 9 | int i; 10 | 11 | #include "pow225521.h" 12 | 13 | return; 14 | } 15 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_isnegative.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | return 1 if f is in {1,3,5,...,q-2} 5 | return 0 if f is in {0,2,4,...,q-1} 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 9 | */ 10 | 11 | int fe_isnegative(const fe f) 12 | { 13 | unsigned char s[32]; 14 | fe_tobytes(s,f); 15 | return s[0] & 1; 16 | } 17 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_isnonzero.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | #include "crypto_verify_32.h" 3 | 4 | /* 5 | return 1 if f == 0 6 | return 0 if f != 0 7 | 8 | Preconditions: 9 | |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 10 | */ 11 | 12 | static const unsigned char zero[32]; 13 | 14 | int fe_isnonzero(const fe f) 15 | { 16 | unsigned char s[32]; 17 | fe_tobytes(s,f); 18 | return crypto_verify_32(s,zero); 19 | } 20 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_neg.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = -f 5 | 6 | Preconditions: 7 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 8 | 9 | Postconditions: 10 | |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 11 | */ 12 | 13 | void fe_neg(fe h,const fe f) 14 | { 15 | crypto_int32 f0 = f[0]; 16 | crypto_int32 f1 = f[1]; 17 | crypto_int32 f2 = f[2]; 18 | crypto_int32 f3 = f[3]; 19 | crypto_int32 f4 = f[4]; 20 | crypto_int32 f5 = f[5]; 21 | crypto_int32 f6 = f[6]; 22 | crypto_int32 f7 = f[7]; 23 | crypto_int32 f8 = f[8]; 24 | crypto_int32 f9 = f[9]; 25 | crypto_int32 h0 = -f0; 26 | crypto_int32 h1 = -f1; 27 | crypto_int32 h2 = -f2; 28 | crypto_int32 h3 = -f3; 29 | crypto_int32 h4 = -f4; 30 | crypto_int32 h5 = -f5; 31 | crypto_int32 h6 = -f6; 32 | crypto_int32 h7 = -f7; 33 | crypto_int32 h8 = -f8; 34 | crypto_int32 h9 = -f9; 35 | h[0] = h0; 36 | h[1] = h1; 37 | h[2] = h2; 38 | h[3] = h3; 39 | h[4] = h4; 40 | h[5] = h5; 41 | h[6] = h6; 42 | h[7] = h7; 43 | h[8] = h8; 44 | h[9] = h9; 45 | } 46 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_pow22523.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | void fe_pow22523(fe out,const fe z) 4 | { 5 | fe t0; 6 | fe t1; 7 | fe t2; 8 | int i; 9 | 10 | #include "pow22523.h" 11 | 12 | return; 13 | } 14 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/fe_sub.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f - g 5 | Can overlap h with f or g. 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 9 | |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 10 | 11 | Postconditions: 12 | |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 13 | */ 14 | 15 | void fe_sub(fe h,const fe f,const fe g) 16 | { 17 | crypto_int32 f0 = f[0]; 18 | crypto_int32 f1 = f[1]; 19 | crypto_int32 f2 = f[2]; 20 | crypto_int32 f3 = f[3]; 21 | crypto_int32 f4 = f[4]; 22 | crypto_int32 f5 = f[5]; 23 | crypto_int32 f6 = f[6]; 24 | crypto_int32 f7 = f[7]; 25 | crypto_int32 f8 = f[8]; 26 | crypto_int32 f9 = f[9]; 27 | crypto_int32 g0 = g[0]; 28 | crypto_int32 g1 = g[1]; 29 | crypto_int32 g2 = g[2]; 30 | crypto_int32 g3 = g[3]; 31 | crypto_int32 g4 = g[4]; 32 | crypto_int32 g5 = g[5]; 33 | crypto_int32 g6 = g[6]; 34 | crypto_int32 g7 = g[7]; 35 | crypto_int32 g8 = g[8]; 36 | crypto_int32 g9 = g[9]; 37 | crypto_int32 h0 = f0 - g0; 38 | crypto_int32 h1 = f1 - g1; 39 | crypto_int32 h2 = f2 - g2; 40 | crypto_int32 h3 = f3 - g3; 41 | crypto_int32 h4 = f4 - g4; 42 | crypto_int32 h5 = f5 - g5; 43 | crypto_int32 h6 = f6 - g6; 44 | crypto_int32 h7 = f7 - g7; 45 | crypto_int32 h8 = f8 - g8; 46 | crypto_int32 h9 = f9 - g9; 47 | h[0] = h0; 48 | h[1] = h1; 49 | h[2] = h2; 50 | h[3] = h3; 51 | h[4] = h4; 52 | h[5] = h5; 53 | h[6] = h6; 54 | h[7] = h7; 55 | h[8] = h8; 56 | h[9] = h9; 57 | } 58 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_add.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_add(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | #include "ge_add.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_add.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->YplusX:q->YminusX:q->Z:q->T2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>YpX2=fe#15:>YmX2=fe#16:>Z2=fe#17:>T2d2=fe#18: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,Y,s); 20 | fe_1(h->Z); 21 | fe_sq(u,h->Y); 22 | fe_mul(v,u,d); 23 | fe_sub(u,u,h->Z); /* u = y^2-1 */ 24 | fe_add(v,v,h->Z); /* v = dy^2+1 */ 25 | 26 | fe_sq(v3,v); 27 | fe_mul(v3,v3,v); /* v3 = v^3 */ 28 | fe_sq(h->X,v3); 29 | fe_mul(h->X,h->X,v); 30 | fe_mul(h->X,h->X,u); /* x = uv^7 */ 31 | 32 | fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ 33 | fe_mul(h->X,h->X,v3); 34 | fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ 35 | 36 | fe_sq(vxx,h->X); 37 | fe_mul(vxx,vxx,v); 38 | fe_sub(check,vxx,u); /* vx^2-u */ 39 | if (fe_isnonzero(check)) { 40 | fe_add(check,vxx,u); /* vx^2+u */ 41 | if (fe_isnonzero(check)) return -1; 42 | fe_mul(h->X,h->X,sqrtm1); 43 | } 44 | 45 | if (fe_isnegative(h->X) == (s[31] >> 7)) 46 | fe_neg(h->X,h->X); 47 | 48 | fe_mul(h->T,h->X,h->Y); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_madd.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_madd(ge_p1p1 *r,const ge_p3 *p,const ge_precomp *q) 8 | { 9 | fe t0; 10 | #include "ge_madd.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_madd.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->yplusx:q->yminusx:q->xy2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>ypx2=fe#15:>ymx2=fe#16:>xy2d2=fe#17: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->yplusx:q->yminusx:q->xy2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>ypx2=fe#15:>ymx2=fe#16:>xy2d2=fe#17: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,X,p->X,p->T); 10 | fe_mul(r->Y,p->Y,p->Z); 11 | fe_mul(r->Z,p->Z,p->T); 12 | } 13 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p1p1_to_p3.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p1p1_to_p3(ge_p3 *r,const ge_p1p1 *p) 8 | { 9 | fe_mul(r->X,p->X,p->T); 10 | fe_mul(r->Y,p->Y,p->Z); 11 | fe_mul(r->Z,p->Z,p->T); 12 | fe_mul(r->T,p->X,p->Y); 13 | } 14 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p2_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p2_0(ge_p2 *h) 4 | { 5 | fe_0(h->X); 6 | fe_1(h->Y); 7 | fe_1(h->Z); 8 | } 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p2_dbl.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = 2 * p 5 | */ 6 | 7 | void ge_p2_dbl(ge_p1p1 *r,const ge_p2 *p) 8 | { 9 | fe t0; 10 | #include "ge_p2_dbl.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p2_dbl.h: -------------------------------------------------------------------------------- 1 | 2 | /* qhasm: enter ge_p2_dbl */ 3 | 4 | /* qhasm: fe X1 */ 5 | 6 | /* qhasm: fe Y1 */ 7 | 8 | /* qhasm: fe Z1 */ 9 | 10 | /* qhasm: fe A */ 11 | 12 | /* qhasm: fe AA */ 13 | 14 | /* qhasm: fe XX */ 15 | 16 | /* qhasm: fe YY */ 17 | 18 | /* qhasm: fe B */ 19 | 20 | /* qhasm: fe X3 */ 21 | 22 | /* qhasm: fe Y3 */ 23 | 24 | /* qhasm: fe Z3 */ 25 | 26 | /* qhasm: fe T3 */ 27 | 28 | /* qhasm: XX=X1^2 */ 29 | /* asm 1: fe_sq(>XX=fe#1,XX=r->X,X); */ 31 | fe_sq(r->X,p->X); 32 | 33 | /* qhasm: YY=Y1^2 */ 34 | /* asm 1: fe_sq(>YY=fe#3,YY=r->Z,Y); */ 36 | fe_sq(r->Z,p->Y); 37 | 38 | /* qhasm: B=2*Z1^2 */ 39 | /* asm 1: fe_sq2(>B=fe#4,B=r->T,Z); */ 41 | fe_sq2(r->T,p->Z); 42 | 43 | /* qhasm: A=X1+Y1 */ 44 | /* asm 1: fe_add(>A=fe#2,A=r->Y,X,Y); */ 46 | fe_add(r->Y,p->X,p->Y); 47 | 48 | /* qhasm: AA=A^2 */ 49 | /* asm 1: fe_sq(>AA=fe#5,AA=t0,Y); */ 51 | fe_sq(t0,r->Y); 52 | 53 | /* qhasm: Y3=YY+XX */ 54 | /* asm 1: fe_add(>Y3=fe#2,Y3=r->Y,Z,X); */ 56 | fe_add(r->Y,r->Z,r->X); 57 | 58 | /* qhasm: Z3=YY-XX */ 59 | /* asm 1: fe_sub(>Z3=fe#3,Z3=r->Z,Z,X); */ 61 | fe_sub(r->Z,r->Z,r->X); 62 | 63 | /* qhasm: X3=AA-Y3 */ 64 | /* asm 1: fe_sub(>X3=fe#1,X3=r->X,Y); */ 66 | fe_sub(r->X,t0,r->Y); 67 | 68 | /* qhasm: T3=B-Z3 */ 69 | /* asm 1: fe_sub(>T3=fe#4,T3=r->T,T,Z); */ 71 | fe_sub(r->T,r->T,r->Z); 72 | 73 | /* qhasm: return */ 74 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p2_dbl.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_sq2(>h,h=fe:asm/fe_add(>h,X); 6 | fe_1(h->Y); 7 | fe_1(h->Z); 8 | fe_0(h->T); 9 | } 10 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p3_dbl.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = 2 * p 5 | */ 6 | 7 | void ge_p3_dbl(ge_p1p1 *r,const ge_p3 *p) 8 | { 9 | ge_p2 q; 10 | ge_p3_to_p2(&q,p); 11 | ge_p2_dbl(r,&q); 12 | } 13 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p3_to_cached.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | static const fe d2 = { 8 | #include "d2.h" 9 | } ; 10 | 11 | extern void ge_p3_to_cached(ge_cached *r,const ge_p3 *p) 12 | { 13 | fe_add(r->YplusX,p->Y,p->X); 14 | fe_sub(r->YminusX,p->Y,p->X); 15 | fe_copy(r->Z,p->Z); 16 | fe_mul(r->T2d,p->T,d2); 17 | } 18 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p3_to_p2.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p3_to_p2(ge_p2 *r,const ge_p3 *p) 8 | { 9 | fe_copy(r->X,p->X); 10 | fe_copy(r->Y,p->Y); 11 | fe_copy(r->Z,p->Z); 12 | } 13 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_p3_tobytes.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p3_tobytes(unsigned char *s,const ge_p3 *h) 4 | { 5 | fe recip; 6 | fe x; 7 | fe y; 8 | 9 | fe_invert(recip,h->Z); 10 | fe_mul(x,h->X,recip); 11 | fe_mul(y,h->Y,recip); 12 | fe_tobytes(s,y); 13 | s[31] ^= fe_isnegative(x) << 7; 14 | } 15 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_precomp_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_precomp_0(ge_precomp *h) 4 | { 5 | fe_1(h->yplusx); 6 | fe_1(h->yminusx); 7 | fe_0(h->xy2d); 8 | } 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_sub.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p - q 5 | */ 6 | 7 | void ge_sub(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | #include "ge_sub.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/ge_sub.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->YplusX:q->YminusX:q->Z:q->T2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>YpX2=fe#15:>YmX2=fe#16:>Z2=fe#17:>T2d2=fe#18: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,Z); 10 | fe_mul(x,h->X,recip); 11 | fe_mul(y,h->Y,recip); 12 | fe_tobytes(s,y); 13 | s[31] ^= fe_isnegative(x) << 7; 14 | } 15 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/keypair.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "randombytes.h" 3 | #include "crypto_sign.h" 4 | #include "crypto_hash_sha512.h" 5 | #include "ge.h" 6 | 7 | int crypto_sign_keypair(unsigned char *pk,unsigned char *sk) 8 | { 9 | unsigned char az[64]; 10 | ge_p3 A; 11 | 12 | randombytes(sk,32); 13 | crypto_hash_sha512(az,sk,32); 14 | az[0] &= 248; 15 | az[31] &= 63; 16 | az[31] |= 64; 17 | 18 | ge_scalarmult_base(&A,az); 19 | ge_p3_tobytes(pk,&A); 20 | 21 | memmove(sk + 32,pk,32); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/open.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "crypto_sign.h" 3 | #include "crypto_hash_sha512.h" 4 | #include "crypto_verify_32.h" 5 | #include "ge.h" 6 | #include "sc.h" 7 | 8 | int crypto_sign_open( 9 | unsigned char *m,unsigned long long *mlen, 10 | const unsigned char *sm,unsigned long long smlen, 11 | const unsigned char *pk 12 | ) 13 | { 14 | unsigned char pkcopy[32]; 15 | unsigned char rcopy[32]; 16 | unsigned char scopy[32]; 17 | unsigned char h[64]; 18 | unsigned char rcheck[32]; 19 | ge_p3 A; 20 | ge_p2 R; 21 | 22 | if (smlen < 64) goto badsig; 23 | if (sm[63] & 224) goto badsig; 24 | if (ge_frombytes_negate_vartime(&A,pk) != 0) goto badsig; 25 | 26 | memmove(pkcopy,pk,32); 27 | memmove(rcopy,sm,32); 28 | memmove(scopy,sm + 32,32); 29 | 30 | memmove(m,sm,smlen); 31 | memmove(m + 32,pkcopy,32); 32 | crypto_hash_sha512(h,m,smlen); 33 | sc_reduce(h); 34 | 35 | ge_double_scalarmult_vartime(&R,h,&A,scopy); 36 | ge_tobytes(rcheck,&R); 37 | if (crypto_verify_32(rcheck,rcopy) == 0) { 38 | memmove(m,m + 64,smlen - 64); 39 | memset(m + smlen - 64,0,64); 40 | *mlen = smlen - 64; 41 | return 0; 42 | } 43 | 44 | badsig: 45 | *mlen = -1; 46 | memset(m,0,smlen); 47 | return -1; 48 | } 49 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/pow22523.q: -------------------------------------------------------------------------------- 1 | :name:fe:t0:t1:t2:t3:t4:t5:t6:t7:t8:t9:z:out: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>z1=fe#11: 5 | return:nofallthrough:h=fe:asm/fe_mul(>h,h=fe:#k:asm/fe_sq(>h,h,>h);: 9 | 10 | : 11 | 12 | fe z1 13 | fe z2 14 | fe z8 15 | fe z9 16 | fe z11 17 | fe z22 18 | fe z_5_0 19 | fe z_10_5 20 | fe z_10_0 21 | fe z_20_10 22 | fe z_20_0 23 | fe z_40_20 24 | fe z_40_0 25 | fe z_50_10 26 | fe z_50_0 27 | fe z_100_50 28 | fe z_100_0 29 | fe z_200_100 30 | fe z_200_0 31 | fe z_250_50 32 | fe z_250_0 33 | fe z_252_2 34 | fe z_252_3 35 | 36 | enter pow22523 37 | 38 | z2 = z1^2^1 39 | z8 = z2^2^2 40 | z9 = z1*z8 41 | z11 = z2*z9 42 | z22 = z11^2^1 43 | z_5_0 = z9*z22 44 | z_10_5 = z_5_0^2^5 45 | z_10_0 = z_10_5*z_5_0 46 | z_20_10 = z_10_0^2^10 47 | z_20_0 = z_20_10*z_10_0 48 | z_40_20 = z_20_0^2^20 49 | z_40_0 = z_40_20*z_20_0 50 | z_50_10 = z_40_0^2^10 51 | z_50_0 = z_50_10*z_10_0 52 | z_100_50 = z_50_0^2^50 53 | z_100_0 = z_100_50*z_50_0 54 | z_200_100 = z_100_0^2^100 55 | z_200_0 = z_200_100*z_100_0 56 | z_250_50 = z_200_0^2^50 57 | z_250_0 = z_250_50*z_50_0 58 | z_252_2 = z_250_0^2^2 59 | z_252_3 = z_252_2*z1 60 | 61 | return 62 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/pow225521.q: -------------------------------------------------------------------------------- 1 | :name:fe:t0:t1:t2:t3:t4:t5:t6:t7:t8:t9:z:out: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>z1=fe#11: 5 | return:nofallthrough:h=fe:asm/fe_mul(>h,h=fe:#k:asm/fe_sq(>h,h,>h);: 9 | 10 | : 11 | 12 | fe z1 13 | fe z2 14 | fe z8 15 | fe z9 16 | fe z11 17 | fe z22 18 | fe z_5_0 19 | fe z_10_5 20 | fe z_10_0 21 | fe z_20_10 22 | fe z_20_0 23 | fe z_40_20 24 | fe z_40_0 25 | fe z_50_10 26 | fe z_50_0 27 | fe z_100_50 28 | fe z_100_0 29 | fe z_200_100 30 | fe z_200_0 31 | fe z_250_50 32 | fe z_250_0 33 | fe z_255_5 34 | fe z_255_21 35 | 36 | enter pow225521 37 | 38 | z2 = z1^2^1 39 | z8 = z2^2^2 40 | z9 = z1*z8 41 | z11 = z2*z9 42 | z22 = z11^2^1 43 | z_5_0 = z9*z22 44 | z_10_5 = z_5_0^2^5 45 | z_10_0 = z_10_5*z_5_0 46 | z_20_10 = z_10_0^2^10 47 | z_20_0 = z_20_10*z_10_0 48 | z_40_20 = z_20_0^2^20 49 | z_40_0 = z_40_20*z_20_0 50 | z_50_10 = z_40_0^2^10 51 | z_50_0 = z_50_10*z_10_0 52 | z_100_50 = z_50_0^2^50 53 | z_100_0 = z_100_50*z_50_0 54 | z_200_100 = z_100_0^2^100 55 | z_200_0 = z_200_100*z_100_0 56 | z_250_50 = z_200_0^2^50 57 | z_250_0 = z_250_50*z_50_0 58 | z_255_5 = z_250_0^2^5 59 | z_255_21 = z_255_5*z11 60 | 61 | return 62 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/q2h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sed 's/^#.*//' \ 3 | | qhasm-generic \ 4 | | sed 's_//\(.*\)$_/*\1 */_' 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/sc.h: -------------------------------------------------------------------------------- 1 | #ifndef SC_H 2 | #define SC_H 3 | 4 | /* 5 | The set of scalars is \Z/l 6 | where l = 2^252 + 27742317777372353535851937790883648493. 7 | */ 8 | 9 | #define sc_reduce crypto_sign_ed25519_ref10_sc_reduce 10 | #define sc_muladd crypto_sign_ed25519_ref10_sc_muladd 11 | 12 | extern void sc_reduce(unsigned char *); 13 | extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/sign.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "crypto_sign.h" 3 | #include "crypto_hash_sha512.h" 4 | #include "ge.h" 5 | #include "sc.h" 6 | 7 | int crypto_sign( 8 | unsigned char *sm,unsigned long long *smlen, 9 | const unsigned char *m,unsigned long long mlen, 10 | const unsigned char *sk 11 | ) 12 | { 13 | unsigned char pk[32]; 14 | unsigned char az[64]; 15 | unsigned char nonce[64]; 16 | unsigned char hram[64]; 17 | ge_p3 R; 18 | 19 | memmove(pk,sk + 32,32); 20 | 21 | crypto_hash_sha512(az,sk,32); 22 | az[0] &= 248; 23 | az[31] &= 63; 24 | az[31] |= 64; 25 | 26 | *smlen = mlen + 64; 27 | memmove(sm + 64,m,mlen); 28 | memmove(sm + 32,az + 32,32); 29 | crypto_hash_sha512(nonce,sm + 32,mlen + 32); 30 | memmove(sm + 32,pk,32); 31 | 32 | sc_reduce(nonce); 33 | ge_scalarmult_base(&R,nonce); 34 | ge_p3_tobytes(sm,&R); 35 | 36 | crypto_hash_sha512(hram,sm,mlen + 64); 37 | sc_reduce(hram); 38 | sc_muladd(sm + 32,hram,az,nonce); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/sqrtm1.h: -------------------------------------------------------------------------------- 1 | -32595792,-7943725,9377950,3500415,12389472,-272473,-25146209,-2005654,326686,11406482 2 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10/sqrtm1.py: -------------------------------------------------------------------------------- 1 | q = 2**255 - 19 2 | 3 | def expmod(b,e,m): 4 | if e == 0: return 1 5 | t = expmod(b,e/2,m)**2 % m 6 | if e & 1: t = (t*b) % m 7 | return t 8 | 9 | def inv(x): 10 | return expmod(x,q-2,q) 11 | 12 | def radix255(x): 13 | x = x % q 14 | if x + x > q: x -= q 15 | x = [x,0,0,0,0,0,0,0,0,0] 16 | bits = [26,25,26,25,26,25,26,25,26,25] 17 | for i in range(9): 18 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 19 | x[i] -= carry * 2**bits[i] 20 | x[i + 1] += carry 21 | result = "" 22 | for i in range(9): 23 | result = result+str(x[i])+"," 24 | result = result+str(x[9]) 25 | return result 26 | 27 | I = expmod(2,(q-1)/4,q) 28 | print radix255(I) 29 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/api.h: -------------------------------------------------------------------------------- 1 | #define CRYPTO_SECRETKEYBYTES 64 2 | #define CRYPTO_PUBLICKEYBYTES 32 3 | #define CRYPTO_BYTES 64 4 | #define CRYPTO_DETERMINISTIC 1 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/base.py: -------------------------------------------------------------------------------- 1 | b = 256 2 | q = 2**255 - 19 3 | l = 2**252 + 27742317777372353535851937790883648493 4 | 5 | def expmod(b,e,m): 6 | if e == 0: return 1 7 | t = expmod(b,e/2,m)**2 % m 8 | if e & 1: t = (t*b) % m 9 | return t 10 | 11 | def inv(x): 12 | return expmod(x,q-2,q) 13 | 14 | d = -121665 * inv(121666) 15 | I = expmod(2,(q-1)/4,q) 16 | 17 | def xrecover(y): 18 | xx = (y*y-1) * inv(d*y*y+1) 19 | x = expmod(xx,(q+3)/8,q) 20 | if (x*x - xx) % q != 0: x = (x*I) % q 21 | if x % 2 != 0: x = q-x 22 | return x 23 | 24 | By = 4 * inv(5) 25 | Bx = xrecover(By) 26 | B = [Bx % q,By % q] 27 | 28 | def edwards(P,Q): 29 | x1 = P[0] 30 | y1 = P[1] 31 | x2 = Q[0] 32 | y2 = Q[1] 33 | x3 = (x1*y2+x2*y1) * inv(1+d*x1*x2*y1*y2) 34 | y3 = (y1*y2+x1*x2) * inv(1-d*x1*x2*y1*y2) 35 | return [x3 % q,y3 % q] 36 | 37 | def radix255(x): 38 | x = x % q 39 | if x + x > q: x -= q 40 | x = [x,0,0,0,0,0,0,0,0,0] 41 | bits = [26,25,26,25,26,25,26,25,26,25] 42 | for i in range(9): 43 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 44 | x[i] -= carry * 2**bits[i] 45 | x[i + 1] += carry 46 | result = "" 47 | for i in range(9): 48 | result = result+str(x[i])+"," 49 | result = result+str(x[9]) 50 | return result 51 | 52 | Bi = B 53 | for i in range(32): 54 | print "{" 55 | Bij = Bi 56 | for j in range(8): 57 | print " {" 58 | print " {",radix255(Bij[1]+Bij[0]),"}," 59 | print " {",radix255(Bij[1]-Bij[0]),"}," 60 | print " {",radix255(2*d*Bij[0]*Bij[1]),"}," 61 | Bij = edwards(Bij,Bi) 62 | print " }," 63 | print "}," 64 | for k in range(8): 65 | Bi = edwards(Bi,Bi) 66 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/base2.py: -------------------------------------------------------------------------------- 1 | b = 256 2 | q = 2**255 - 19 3 | l = 2**252 + 27742317777372353535851937790883648493 4 | 5 | def expmod(b,e,m): 6 | if e == 0: return 1 7 | t = expmod(b,e/2,m)**2 % m 8 | if e & 1: t = (t*b) % m 9 | return t 10 | 11 | def inv(x): 12 | return expmod(x,q-2,q) 13 | 14 | d = -121665 * inv(121666) 15 | I = expmod(2,(q-1)/4,q) 16 | 17 | def xrecover(y): 18 | xx = (y*y-1) * inv(d*y*y+1) 19 | x = expmod(xx,(q+3)/8,q) 20 | if (x*x - xx) % q != 0: x = (x*I) % q 21 | if x % 2 != 0: x = q-x 22 | return x 23 | 24 | By = 4 * inv(5) 25 | Bx = xrecover(By) 26 | B = [Bx % q,By % q] 27 | 28 | def edwards(P,Q): 29 | x1 = P[0] 30 | y1 = P[1] 31 | x2 = Q[0] 32 | y2 = Q[1] 33 | x3 = (x1*y2+x2*y1) * inv(1+d*x1*x2*y1*y2) 34 | y3 = (y1*y2+x1*x2) * inv(1-d*x1*x2*y1*y2) 35 | return [x3 % q,y3 % q] 36 | 37 | def radix255(x): 38 | x = x % q 39 | if x + x > q: x -= q 40 | x = [x,0,0,0,0,0,0,0,0,0] 41 | bits = [26,25,26,25,26,25,26,25,26,25] 42 | for i in range(9): 43 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 44 | x[i] -= carry * 2**bits[i] 45 | x[i + 1] += carry 46 | result = "" 47 | for i in range(9): 48 | result = result+str(x[i])+"," 49 | result = result+str(x[9]) 50 | return result 51 | 52 | Bi = B 53 | 54 | for i in range(8): 55 | print " {" 56 | print " {",radix255(Bi[1]+Bi[0]),"}," 57 | print " {",radix255(Bi[1]-Bi[0]),"}," 58 | print " {",radix255(2*d*Bi[0]*Bi[1]),"}," 59 | print " }," 60 | Bi = edwards(B,edwards(B,Bi)) 61 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/d.h: -------------------------------------------------------------------------------- 1 | -10913610,13857413,-15372611,6949391,114729,-8787816,-6275908,-3247719,-18696448,-12055116 2 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/d.py: -------------------------------------------------------------------------------- 1 | q = 2**255 - 19 2 | 3 | def expmod(b,e,m): 4 | if e == 0: return 1 5 | t = expmod(b,e/2,m)**2 % m 6 | if e & 1: t = (t*b) % m 7 | return t 8 | 9 | def inv(x): 10 | return expmod(x,q-2,q) 11 | 12 | def radix255(x): 13 | x = x % q 14 | if x + x > q: x -= q 15 | x = [x,0,0,0,0,0,0,0,0,0] 16 | bits = [26,25,26,25,26,25,26,25,26,25] 17 | for i in range(9): 18 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 19 | x[i] -= carry * 2**bits[i] 20 | x[i + 1] += carry 21 | result = "" 22 | for i in range(9): 23 | result = result+str(x[i])+"," 24 | result = result+str(x[9]) 25 | return result 26 | 27 | d = -121665 * inv(121666) 28 | print radix255(d) 29 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/d2.h: -------------------------------------------------------------------------------- 1 | -21827239,-5839606,-30745221,13898782,229458,15978800,-12551817,-6495438,29715968,9444199 2 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/d2.py: -------------------------------------------------------------------------------- 1 | q = 2**255 - 19 2 | 3 | def expmod(b,e,m): 4 | if e == 0: return 1 5 | t = expmod(b,e/2,m)**2 % m 6 | if e & 1: t = (t*b) % m 7 | return t 8 | 9 | def inv(x): 10 | return expmod(x,q-2,q) 11 | 12 | def radix255(x): 13 | x = x % q 14 | if x + x > q: x -= q 15 | x = [x,0,0,0,0,0,0,0,0,0] 16 | bits = [26,25,26,25,26,25,26,25,26,25] 17 | for i in range(9): 18 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 19 | x[i] -= carry * 2**bits[i] 20 | x[i + 1] += carry 21 | result = "" 22 | for i in range(9): 23 | result = result+str(x[i])+"," 24 | result = result+str(x[9]) 25 | return result 26 | 27 | d = -121665 * inv(121666) 28 | print radix255(d*2) 29 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/description: -------------------------------------------------------------------------------- 1 | shen_ed25519_ref10 2 | MakeCryptoOps.py makes crypto-ops.c in the Monero source from the ref10 implementation 3 | 4 | EdDSA signatures using Curve25519 5 | from https://hyperelliptic.org/ebats/supercop-20141124.tar.bz2 6 | 7 | Commented / combined by Shen Noether, Monero Research Lab 8 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/designers: -------------------------------------------------------------------------------- 1 | ref10: 2 | Daniel J. Bernstein 3 | Niels Duif 4 | Tanja Lange 5 | Peter Schwabe 6 | Bo-Yin Yang 7 | 8 | MakeCryptoOps.py: 9 | Shen Noether, Monero Research Labs 10 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_0.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = 0 5 | */ 6 | 7 | void fe_0(fe h) 8 | { 9 | h[0] = 0; 10 | h[1] = 0; 11 | h[2] = 0; 12 | h[3] = 0; 13 | h[4] = 0; 14 | h[5] = 0; 15 | h[6] = 0; 16 | h[7] = 0; 17 | h[8] = 0; 18 | h[9] = 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_1.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = 1 5 | */ 6 | 7 | void fe_1(fe h) 8 | { 9 | h[0] = 1; 10 | h[1] = 0; 11 | h[2] = 0; 12 | h[3] = 0; 13 | h[4] = 0; 14 | h[5] = 0; 15 | h[6] = 0; 16 | h[7] = 0; 17 | h[8] = 0; 18 | h[9] = 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_add.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f + g 5 | Can overlap h with f or g. 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 9 | |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 10 | 11 | Postconditions: 12 | |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 13 | */ 14 | 15 | void fe_add(fe h,const fe f,const fe g) 16 | { 17 | crypto_int32 f0 = f[0]; 18 | crypto_int32 f1 = f[1]; 19 | crypto_int32 f2 = f[2]; 20 | crypto_int32 f3 = f[3]; 21 | crypto_int32 f4 = f[4]; 22 | crypto_int32 f5 = f[5]; 23 | crypto_int32 f6 = f[6]; 24 | crypto_int32 f7 = f[7]; 25 | crypto_int32 f8 = f[8]; 26 | crypto_int32 f9 = f[9]; 27 | crypto_int32 g0 = g[0]; 28 | crypto_int32 g1 = g[1]; 29 | crypto_int32 g2 = g[2]; 30 | crypto_int32 g3 = g[3]; 31 | crypto_int32 g4 = g[4]; 32 | crypto_int32 g5 = g[5]; 33 | crypto_int32 g6 = g[6]; 34 | crypto_int32 g7 = g[7]; 35 | crypto_int32 g8 = g[8]; 36 | crypto_int32 g9 = g[9]; 37 | crypto_int32 h0 = f0 + g0; 38 | crypto_int32 h1 = f1 + g1; 39 | crypto_int32 h2 = f2 + g2; 40 | crypto_int32 h3 = f3 + g3; 41 | crypto_int32 h4 = f4 + g4; 42 | crypto_int32 h5 = f5 + g5; 43 | crypto_int32 h6 = f6 + g6; 44 | crypto_int32 h7 = f7 + g7; 45 | crypto_int32 h8 = f8 + g8; 46 | crypto_int32 h9 = f9 + g9; 47 | h[0] = h0; 48 | h[1] = h1; 49 | h[2] = h2; 50 | h[3] = h3; 51 | h[4] = h4; 52 | h[5] = h5; 53 | h[6] = h6; 54 | h[7] = h7; 55 | h[8] = h8; 56 | h[9] = h9; 57 | } 58 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_cmov.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | Replace (f,g) with (g,g) if b == 1; 5 | replace (f,g) with (f,g) if b == 0. 6 | 7 | Preconditions: b in {0,1}. 8 | */ 9 | 10 | void fe_cmov(fe f,const fe g,unsigned int b) 11 | { 12 | crypto_int32 f0 = f[0]; 13 | crypto_int32 f1 = f[1]; 14 | crypto_int32 f2 = f[2]; 15 | crypto_int32 f3 = f[3]; 16 | crypto_int32 f4 = f[4]; 17 | crypto_int32 f5 = f[5]; 18 | crypto_int32 f6 = f[6]; 19 | crypto_int32 f7 = f[7]; 20 | crypto_int32 f8 = f[8]; 21 | crypto_int32 f9 = f[9]; 22 | crypto_int32 g0 = g[0]; 23 | crypto_int32 g1 = g[1]; 24 | crypto_int32 g2 = g[2]; 25 | crypto_int32 g3 = g[3]; 26 | crypto_int32 g4 = g[4]; 27 | crypto_int32 g5 = g[5]; 28 | crypto_int32 g6 = g[6]; 29 | crypto_int32 g7 = g[7]; 30 | crypto_int32 g8 = g[8]; 31 | crypto_int32 g9 = g[9]; 32 | crypto_int32 x0 = f0 ^ g0; 33 | crypto_int32 x1 = f1 ^ g1; 34 | crypto_int32 x2 = f2 ^ g2; 35 | crypto_int32 x3 = f3 ^ g3; 36 | crypto_int32 x4 = f4 ^ g4; 37 | crypto_int32 x5 = f5 ^ g5; 38 | crypto_int32 x6 = f6 ^ g6; 39 | crypto_int32 x7 = f7 ^ g7; 40 | crypto_int32 x8 = f8 ^ g8; 41 | crypto_int32 x9 = f9 ^ g9; 42 | b = -b; 43 | x0 &= b; 44 | x1 &= b; 45 | x2 &= b; 46 | x3 &= b; 47 | x4 &= b; 48 | x5 &= b; 49 | x6 &= b; 50 | x7 &= b; 51 | x8 &= b; 52 | x9 &= b; 53 | f[0] = f0 ^ x0; 54 | f[1] = f1 ^ x1; 55 | f[2] = f2 ^ x2; 56 | f[3] = f3 ^ x3; 57 | f[4] = f4 ^ x4; 58 | f[5] = f5 ^ x5; 59 | f[6] = f6 ^ x6; 60 | f[7] = f7 ^ x7; 61 | f[8] = f8 ^ x8; 62 | f[9] = f9 ^ x9; 63 | } 64 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_copy.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f 5 | */ 6 | 7 | void fe_copy(fe h,const fe f) 8 | { 9 | crypto_int32 f0 = f[0]; 10 | crypto_int32 f1 = f[1]; 11 | crypto_int32 f2 = f[2]; 12 | crypto_int32 f3 = f[3]; 13 | crypto_int32 f4 = f[4]; 14 | crypto_int32 f5 = f[5]; 15 | crypto_int32 f6 = f[6]; 16 | crypto_int32 f7 = f[7]; 17 | crypto_int32 f8 = f[8]; 18 | crypto_int32 f9 = f[9]; 19 | h[0] = f0; 20 | h[1] = f1; 21 | h[2] = f2; 22 | h[3] = f3; 23 | h[4] = f4; 24 | h[5] = f5; 25 | h[6] = f6; 26 | h[7] = f7; 27 | h[8] = f8; 28 | h[9] = f9; 29 | } 30 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_invert.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | void fe_invert(fe out,const fe z) 4 | { 5 | fe t0; 6 | fe t1; 7 | fe t2; 8 | fe t3; 9 | int i; 10 | 11 | #include "pow225521.h" 12 | 13 | return; 14 | } 15 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_isnegative.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | return 1 if f is in {1,3,5,...,q-2} 5 | return 0 if f is in {0,2,4,...,q-1} 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 9 | */ 10 | 11 | int fe_isnegative(const fe f) 12 | { 13 | unsigned char s[32]; 14 | fe_tobytes(s,f); 15 | return s[0] & 1; 16 | } 17 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_isnonzero.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | #include "crypto_verify_32.h" 3 | 4 | /* 5 | return 1 if f == 0 6 | return 0 if f != 0 7 | 8 | Preconditions: 9 | |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 10 | */ 11 | 12 | static const unsigned char zero[32]; 13 | 14 | int fe_isnonzero(const fe f) 15 | { 16 | unsigned char s[32]; 17 | fe_tobytes(s,f); 18 | return crypto_verify_32(s,zero); 19 | } 20 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_neg.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = -f 5 | 6 | Preconditions: 7 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 8 | 9 | Postconditions: 10 | |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 11 | */ 12 | 13 | void fe_neg(fe h,const fe f) 14 | { 15 | crypto_int32 f0 = f[0]; 16 | crypto_int32 f1 = f[1]; 17 | crypto_int32 f2 = f[2]; 18 | crypto_int32 f3 = f[3]; 19 | crypto_int32 f4 = f[4]; 20 | crypto_int32 f5 = f[5]; 21 | crypto_int32 f6 = f[6]; 22 | crypto_int32 f7 = f[7]; 23 | crypto_int32 f8 = f[8]; 24 | crypto_int32 f9 = f[9]; 25 | crypto_int32 h0 = -f0; 26 | crypto_int32 h1 = -f1; 27 | crypto_int32 h2 = -f2; 28 | crypto_int32 h3 = -f3; 29 | crypto_int32 h4 = -f4; 30 | crypto_int32 h5 = -f5; 31 | crypto_int32 h6 = -f6; 32 | crypto_int32 h7 = -f7; 33 | crypto_int32 h8 = -f8; 34 | crypto_int32 h9 = -f9; 35 | h[0] = h0; 36 | h[1] = h1; 37 | h[2] = h2; 38 | h[3] = h3; 39 | h[4] = h4; 40 | h[5] = h5; 41 | h[6] = h6; 42 | h[7] = h7; 43 | h[8] = h8; 44 | h[9] = h9; 45 | } 46 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_pow22523.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | void fe_pow22523(fe out,const fe z) 4 | { 5 | fe t0; 6 | fe t1; 7 | fe t2; 8 | int i; 9 | 10 | #include "pow22523.h" 11 | 12 | return; 13 | } 14 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/fe_sub.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f - g 5 | Can overlap h with f or g. 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 9 | |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 10 | 11 | Postconditions: 12 | |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 13 | */ 14 | 15 | void fe_sub(fe h,const fe f,const fe g) 16 | { 17 | crypto_int32 f0 = f[0]; 18 | crypto_int32 f1 = f[1]; 19 | crypto_int32 f2 = f[2]; 20 | crypto_int32 f3 = f[3]; 21 | crypto_int32 f4 = f[4]; 22 | crypto_int32 f5 = f[5]; 23 | crypto_int32 f6 = f[6]; 24 | crypto_int32 f7 = f[7]; 25 | crypto_int32 f8 = f[8]; 26 | crypto_int32 f9 = f[9]; 27 | crypto_int32 g0 = g[0]; 28 | crypto_int32 g1 = g[1]; 29 | crypto_int32 g2 = g[2]; 30 | crypto_int32 g3 = g[3]; 31 | crypto_int32 g4 = g[4]; 32 | crypto_int32 g5 = g[5]; 33 | crypto_int32 g6 = g[6]; 34 | crypto_int32 g7 = g[7]; 35 | crypto_int32 g8 = g[8]; 36 | crypto_int32 g9 = g[9]; 37 | crypto_int32 h0 = f0 - g0; 38 | crypto_int32 h1 = f1 - g1; 39 | crypto_int32 h2 = f2 - g2; 40 | crypto_int32 h3 = f3 - g3; 41 | crypto_int32 h4 = f4 - g4; 42 | crypto_int32 h5 = f5 - g5; 43 | crypto_int32 h6 = f6 - g6; 44 | crypto_int32 h7 = f7 - g7; 45 | crypto_int32 h8 = f8 - g8; 46 | crypto_int32 h9 = f9 - g9; 47 | h[0] = h0; 48 | h[1] = h1; 49 | h[2] = h2; 50 | h[3] = h3; 51 | h[4] = h4; 52 | h[5] = h5; 53 | h[6] = h6; 54 | h[7] = h7; 55 | h[8] = h8; 56 | h[9] = h9; 57 | } 58 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_add.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_add(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | #include "ge_add.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_add.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->YplusX:q->YminusX:q->Z:q->T2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>YpX2=fe#15:>YmX2=fe#16:>Z2=fe#17:>T2d2=fe#18: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,Y,s); 20 | fe_1(h->Z); 21 | fe_sq(u,h->Y); 22 | fe_mul(v,u,d); 23 | fe_sub(u,u,h->Z); /* u = y^2-1 */ 24 | fe_add(v,v,h->Z); /* v = dy^2+1 */ 25 | 26 | fe_sq(v3,v); 27 | fe_mul(v3,v3,v); /* v3 = v^3 */ 28 | fe_sq(h->X,v3); 29 | fe_mul(h->X,h->X,v); 30 | fe_mul(h->X,h->X,u); /* x = uv^7 */ 31 | 32 | fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ 33 | fe_mul(h->X,h->X,v3); 34 | fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ 35 | 36 | fe_sq(vxx,h->X); 37 | fe_mul(vxx,vxx,v); 38 | fe_sub(check,vxx,u); /* vx^2-u */ 39 | if (fe_isnonzero(check)) { 40 | fe_add(check,vxx,u); /* vx^2+u */ 41 | if (fe_isnonzero(check)) return -1; 42 | fe_mul(h->X,h->X,sqrtm1); 43 | } 44 | 45 | if (fe_isnegative(h->X) == (s[31] >> 7)) 46 | fe_neg(h->X,h->X); 47 | 48 | fe_mul(h->T,h->X,h->Y); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_madd.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_madd(ge_p1p1 *r,const ge_p3 *p,const ge_precomp *q) 8 | { 9 | fe t0; 10 | #include "ge_madd.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_madd.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->yplusx:q->yminusx:q->xy2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>ypx2=fe#15:>ymx2=fe#16:>xy2d2=fe#17: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->yplusx:q->yminusx:q->xy2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>ypx2=fe#15:>ymx2=fe#16:>xy2d2=fe#17: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,X,p->X,p->T); 10 | fe_mul(r->Y,p->Y,p->Z); 11 | fe_mul(r->Z,p->Z,p->T); 12 | } 13 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p1p1_to_p3.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p1p1_to_p3(ge_p3 *r,const ge_p1p1 *p) 8 | { 9 | fe_mul(r->X,p->X,p->T); 10 | fe_mul(r->Y,p->Y,p->Z); 11 | fe_mul(r->Z,p->Z,p->T); 12 | fe_mul(r->T,p->X,p->Y); 13 | } 14 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p2_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p2_0(ge_p2 *h) 4 | { 5 | fe_0(h->X); 6 | fe_1(h->Y); 7 | fe_1(h->Z); 8 | } 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p2_dbl.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = 2 * p 5 | */ 6 | 7 | void ge_p2_dbl(ge_p1p1 *r,const ge_p2 *p) 8 | { 9 | fe t0; 10 | #include "ge_p2_dbl.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p2_dbl.h: -------------------------------------------------------------------------------- 1 | 2 | /* qhasm: enter ge_p2_dbl */ 3 | 4 | /* qhasm: fe X1 */ 5 | 6 | /* qhasm: fe Y1 */ 7 | 8 | /* qhasm: fe Z1 */ 9 | 10 | /* qhasm: fe A */ 11 | 12 | /* qhasm: fe AA */ 13 | 14 | /* qhasm: fe XX */ 15 | 16 | /* qhasm: fe YY */ 17 | 18 | /* qhasm: fe B */ 19 | 20 | /* qhasm: fe X3 */ 21 | 22 | /* qhasm: fe Y3 */ 23 | 24 | /* qhasm: fe Z3 */ 25 | 26 | /* qhasm: fe T3 */ 27 | 28 | /* qhasm: XX=X1^2 */ 29 | /* asm 1: fe_sq(>XX=fe#1,XX=r->X,X); */ 31 | fe_sq(r->X,p->X); 32 | 33 | /* qhasm: YY=Y1^2 */ 34 | /* asm 1: fe_sq(>YY=fe#3,YY=r->Z,Y); */ 36 | fe_sq(r->Z,p->Y); 37 | 38 | /* qhasm: B=2*Z1^2 */ 39 | /* asm 1: fe_sq2(>B=fe#4,B=r->T,Z); */ 41 | fe_sq2(r->T,p->Z); 42 | 43 | /* qhasm: A=X1+Y1 */ 44 | /* asm 1: fe_add(>A=fe#2,A=r->Y,X,Y); */ 46 | fe_add(r->Y,p->X,p->Y); 47 | 48 | /* qhasm: AA=A^2 */ 49 | /* asm 1: fe_sq(>AA=fe#5,AA=t0,Y); */ 51 | fe_sq(t0,r->Y); 52 | 53 | /* qhasm: Y3=YY+XX */ 54 | /* asm 1: fe_add(>Y3=fe#2,Y3=r->Y,Z,X); */ 56 | fe_add(r->Y,r->Z,r->X); 57 | 58 | /* qhasm: Z3=YY-XX */ 59 | /* asm 1: fe_sub(>Z3=fe#3,Z3=r->Z,Z,X); */ 61 | fe_sub(r->Z,r->Z,r->X); 62 | 63 | /* qhasm: X3=AA-Y3 */ 64 | /* asm 1: fe_sub(>X3=fe#1,X3=r->X,Y); */ 66 | fe_sub(r->X,t0,r->Y); 67 | 68 | /* qhasm: T3=B-Z3 */ 69 | /* asm 1: fe_sub(>T3=fe#4,T3=r->T,T,Z); */ 71 | fe_sub(r->T,r->T,r->Z); 72 | 73 | /* qhasm: return */ 74 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p2_dbl.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_sq2(>h,h=fe:asm/fe_add(>h,X); 6 | fe_1(h->Y); 7 | fe_1(h->Z); 8 | fe_0(h->T); 9 | } 10 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p3_dbl.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = 2 * p 5 | */ 6 | 7 | void ge_p3_dbl(ge_p1p1 *r,const ge_p3 *p) 8 | { 9 | ge_p2 q; 10 | ge_p3_to_p2(&q,p); 11 | ge_p2_dbl(r,&q); 12 | } 13 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p3_to_cached.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | static const fe d2 = { 8 | #include "d2.h" 9 | } ; 10 | 11 | extern void ge_p3_to_cached(ge_cached *r,const ge_p3 *p) 12 | { 13 | fe_add(r->YplusX,p->Y,p->X); 14 | fe_sub(r->YminusX,p->Y,p->X); 15 | fe_copy(r->Z,p->Z); 16 | fe_mul(r->T2d,p->T,d2); 17 | } 18 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p3_to_p2.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p3_to_p2(ge_p2 *r,const ge_p3 *p) 8 | { 9 | fe_copy(r->X,p->X); 10 | fe_copy(r->Y,p->Y); 11 | fe_copy(r->Z,p->Z); 12 | } 13 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_p3_tobytes.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p3_tobytes(unsigned char *s,const ge_p3 *h) 4 | { 5 | fe recip; 6 | fe x; 7 | fe y; 8 | 9 | fe_invert(recip,h->Z); 10 | fe_mul(x,h->X,recip); 11 | fe_mul(y,h->Y,recip); 12 | fe_tobytes(s,y); 13 | s[31] ^= fe_isnegative(x) << 7; 14 | } 15 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_precomp_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_precomp_0(ge_precomp *h) 4 | { 5 | fe_1(h->yplusx); 6 | fe_1(h->yminusx); 7 | fe_0(h->xy2d); 8 | } 9 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_sub.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p - q 5 | */ 6 | 7 | void ge_sub(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | #include "ge_sub.h" 11 | } 12 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/ge_sub.q: -------------------------------------------------------------------------------- 1 | :name:fe:r->X:r->Y:r->Z:r->T:t0:t1:t2:t3:t4:t5:p->X:p->Y:p->Z:p->T:q->YplusX:q->YminusX:q->Z:q->T2d: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>X1=fe#11:>Y1=fe#12:>Z1=fe#13:>T1=fe#14:>YpX2=fe#15:>YmX2=fe#16:>Z2=fe#17:>T2d2=fe#18: 5 | return:nofallthrough:h=fe:asm/fe_add(>h,h=fe:asm/fe_sub(>h,h=fe:asm/fe_mul(>h,h=fe:asm/fe_sq(>h,h=fe:asm/fe_add(>h,Z); 10 | fe_mul(x,h->X,recip); 11 | fe_mul(y,h->Y,recip); 12 | fe_tobytes(s,y); 13 | s[31] ^= fe_isnegative(x) << 7; 14 | } 15 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/keypair.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "randombytes.h" 3 | #include "crypto_sign.h" 4 | #include "crypto_hash_sha512.h" 5 | #include "ge.h" 6 | 7 | int crypto_sign_keypair(unsigned char *pk,unsigned char *sk) 8 | { 9 | unsigned char az[64]; 10 | ge_p3 A; 11 | 12 | randombytes(sk,32); 13 | crypto_hash_sha512(az,sk,32); 14 | az[0] &= 248; 15 | az[31] &= 63; 16 | az[31] |= 64; 17 | 18 | ge_scalarmult_base(&A,az); 19 | ge_p3_tobytes(pk,&A); 20 | 21 | memmove(sk + 32,pk,32); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/open.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "crypto_sign.h" 3 | #include "crypto_hash_sha512.h" 4 | #include "crypto_verify_32.h" 5 | #include "ge.h" 6 | #include "sc.h" 7 | 8 | int crypto_sign_open( 9 | unsigned char *m,unsigned long long *mlen, 10 | const unsigned char *sm,unsigned long long smlen, 11 | const unsigned char *pk 12 | ) 13 | { 14 | unsigned char pkcopy[32]; 15 | unsigned char rcopy[32]; 16 | unsigned char scopy[32]; 17 | unsigned char h[64]; 18 | unsigned char rcheck[32]; 19 | ge_p3 A; 20 | ge_p2 R; 21 | 22 | if (smlen < 64) goto badsig; 23 | if (sm[63] & 224) goto badsig; 24 | if (ge_frombytes_negate_vartime(&A,pk) != 0) goto badsig; 25 | 26 | memmove(pkcopy,pk,32); 27 | memmove(rcopy,sm,32); 28 | memmove(scopy,sm + 32,32); 29 | 30 | memmove(m,sm,smlen); 31 | memmove(m + 32,pkcopy,32); 32 | crypto_hash_sha512(h,m,smlen); 33 | sc_reduce(h); 34 | 35 | ge_double_scalarmult_vartime(&R,h,&A,scopy); 36 | ge_tobytes(rcheck,&R); 37 | if (crypto_verify_32(rcheck,rcopy) == 0) { 38 | memmove(m,m + 64,smlen - 64); 39 | memset(m + smlen - 64,0,64); 40 | *mlen = smlen - 64; 41 | return 0; 42 | } 43 | 44 | badsig: 45 | *mlen = -1; 46 | memset(m,0,smlen); 47 | return -1; 48 | } 49 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/pow22523.q: -------------------------------------------------------------------------------- 1 | :name:fe:t0:t1:t2:t3:t4:t5:t6:t7:t8:t9:z:out: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>z1=fe#11: 5 | return:nofallthrough:h=fe:asm/fe_mul(>h,h=fe:#k:asm/fe_sq(>h,h,>h);: 9 | 10 | : 11 | 12 | fe z1 13 | fe z2 14 | fe z8 15 | fe z9 16 | fe z11 17 | fe z22 18 | fe z_5_0 19 | fe z_10_5 20 | fe z_10_0 21 | fe z_20_10 22 | fe z_20_0 23 | fe z_40_20 24 | fe z_40_0 25 | fe z_50_10 26 | fe z_50_0 27 | fe z_100_50 28 | fe z_100_0 29 | fe z_200_100 30 | fe z_200_0 31 | fe z_250_50 32 | fe z_250_0 33 | fe z_252_2 34 | fe z_252_3 35 | 36 | enter pow22523 37 | 38 | z2 = z1^2^1 39 | z8 = z2^2^2 40 | z9 = z1*z8 41 | z11 = z2*z9 42 | z22 = z11^2^1 43 | z_5_0 = z9*z22 44 | z_10_5 = z_5_0^2^5 45 | z_10_0 = z_10_5*z_5_0 46 | z_20_10 = z_10_0^2^10 47 | z_20_0 = z_20_10*z_10_0 48 | z_40_20 = z_20_0^2^20 49 | z_40_0 = z_40_20*z_20_0 50 | z_50_10 = z_40_0^2^10 51 | z_50_0 = z_50_10*z_10_0 52 | z_100_50 = z_50_0^2^50 53 | z_100_0 = z_100_50*z_50_0 54 | z_200_100 = z_100_0^2^100 55 | z_200_0 = z_200_100*z_100_0 56 | z_250_50 = z_200_0^2^50 57 | z_250_0 = z_250_50*z_50_0 58 | z_252_2 = z_250_0^2^2 59 | z_252_3 = z_252_2*z1 60 | 61 | return 62 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/pow225521.q: -------------------------------------------------------------------------------- 1 | :name:fe:t0:t1:t2:t3:t4:t5:t6:t7:t8:t9:z:out: 2 | fe r:var/r=fe: 3 | 4 | enter f:enter/f:>z1=fe#11: 5 | return:nofallthrough:h=fe:asm/fe_mul(>h,h=fe:#k:asm/fe_sq(>h,h,>h);: 9 | 10 | : 11 | 12 | fe z1 13 | fe z2 14 | fe z8 15 | fe z9 16 | fe z11 17 | fe z22 18 | fe z_5_0 19 | fe z_10_5 20 | fe z_10_0 21 | fe z_20_10 22 | fe z_20_0 23 | fe z_40_20 24 | fe z_40_0 25 | fe z_50_10 26 | fe z_50_0 27 | fe z_100_50 28 | fe z_100_0 29 | fe z_200_100 30 | fe z_200_0 31 | fe z_250_50 32 | fe z_250_0 33 | fe z_255_5 34 | fe z_255_21 35 | 36 | enter pow225521 37 | 38 | z2 = z1^2^1 39 | z8 = z2^2^2 40 | z9 = z1*z8 41 | z11 = z2*z9 42 | z22 = z11^2^1 43 | z_5_0 = z9*z22 44 | z_10_5 = z_5_0^2^5 45 | z_10_0 = z_10_5*z_5_0 46 | z_20_10 = z_10_0^2^10 47 | z_20_0 = z_20_10*z_10_0 48 | z_40_20 = z_20_0^2^20 49 | z_40_0 = z_40_20*z_20_0 50 | z_50_10 = z_40_0^2^10 51 | z_50_0 = z_50_10*z_10_0 52 | z_100_50 = z_50_0^2^50 53 | z_100_0 = z_100_50*z_50_0 54 | z_200_100 = z_100_0^2^100 55 | z_200_0 = z_200_100*z_100_0 56 | z_250_50 = z_200_0^2^50 57 | z_250_0 = z_250_50*z_50_0 58 | z_255_5 = z_250_0^2^5 59 | z_255_21 = z_255_5*z11 60 | 61 | return 62 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/q2h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sed 's/^#.*//' \ 3 | | qhasm-generic \ 4 | | sed 's_//\(.*\)$_/*\1 */_' 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/sc.h: -------------------------------------------------------------------------------- 1 | #ifndef SC_H 2 | #define SC_H 3 | 4 | /* 5 | The set of scalars is \Z/l 6 | where l = 2^252 + 27742317777372353535851937790883648493. 7 | */ 8 | 9 | #define sc_reduce crypto_sign_ed25519_ref10_sc_reduce 10 | #define sc_muladd crypto_sign_ed25519_ref10_sc_muladd 11 | 12 | extern void sc_reduce(unsigned char *); 13 | extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/scrap.txt: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_add(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | fe_add(r->X,p->Y,p->X); 32 | 33 | fe_sub(r->Y,p->Y,p->X); 34 | 35 | fe_mul(r->Z,r->X,q->YplusX); 36 | 37 | fe_mul(r->Y,r->Y,q->YminusX); 38 | 39 | fe_mul(r->T,q->T2d,p->T); 40 | 41 | fe_mul(r->X,p->Z,q->Z); 42 | 43 | fe_add(t0,r->X,r->X); 44 | 45 | fe_sub(r->X,r->Z,r->Y); 46 | 47 | fe_add(r->Y,r->Z,r->Y); 48 | 49 | fe_add(r->Z,t0,r->T); 50 | 51 | fe_sub(r->T,t0,r->T); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/sign.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "crypto_sign.h" 3 | #include "crypto_hash_sha512.h" 4 | #include "ge.h" 5 | #include "sc.h" 6 | 7 | int crypto_sign( 8 | unsigned char *sm,unsigned long long *smlen, 9 | const unsigned char *m,unsigned long long mlen, 10 | const unsigned char *sk 11 | ) 12 | { 13 | unsigned char pk[32]; 14 | unsigned char az[64]; 15 | unsigned char nonce[64]; 16 | unsigned char hram[64]; 17 | ge_p3 R; 18 | 19 | memmove(pk,sk + 32,32); 20 | 21 | crypto_hash_sha512(az,sk,32); 22 | az[0] &= 248; 23 | az[31] &= 63; 24 | az[31] |= 64; 25 | 26 | *smlen = mlen + 64; 27 | memmove(sm + 64,m,mlen); 28 | memmove(sm + 32,az + 32,32); 29 | crypto_hash_sha512(nonce,sm + 32,mlen + 32); 30 | memmove(sm + 32,pk,32); 31 | 32 | sc_reduce(nonce); 33 | ge_scalarmult_base(&R,nonce); 34 | ge_p3_tobytes(sm,&R); 35 | 36 | crypto_hash_sha512(hram,sm,mlen + 64); 37 | sc_reduce(hram); 38 | sc_muladd(sm + 32,hram,az,nonce); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/sqrtm1.h: -------------------------------------------------------------------------------- 1 | -32595792,-7943725,9377950,3500415,12389472,-272473,-25146209,-2005654,326686,11406482 2 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/sqrtm1.py: -------------------------------------------------------------------------------- 1 | q = 2**255 - 19 2 | 3 | def expmod(b,e,m): 4 | if e == 0: return 1 5 | t = expmod(b,e/2,m)**2 % m 6 | if e & 1: t = (t*b) % m 7 | return t 8 | 9 | def inv(x): 10 | return expmod(x,q-2,q) 11 | 12 | def radix255(x): 13 | x = x % q 14 | if x + x > q: x -= q 15 | x = [x,0,0,0,0,0,0,0,0,0] 16 | bits = [26,25,26,25,26,25,26,25,26,25] 17 | for i in range(9): 18 | carry = (x[i] + 2**(bits[i]-1)) / 2**bits[i] 19 | x[i] -= carry * 2**bits[i] 20 | x[i + 1] += carry 21 | result = "" 22 | for i in range(9): 23 | result = result+str(x[i])+"," 24 | result = result+str(x[9]) 25 | return result 26 | 27 | I = expmod(2,(q-1)/4,q) 28 | print radix255(I) 29 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/ref10CommentedCombined/test.py: -------------------------------------------------------------------------------- 1 | import os 2 | l = "(((int) (s[0] | s[1] | s[2] | s[3] | s[4] | s[5] | s[6] | s[7] | s[8] | s[9] | s[10] | s[11] | s[12] | s[13] | s[14] | s[15] | s[16] | s[17] | s[18] | s[19] | s[20] | s[21] | s[22] | s[23] | s[24] | s[25] | s[26] | s[27] | s[28] | s[29] | s[30] | s[31]) - 1) >> 8) + 1;" 3 | 4 | os.system("sed -i 's/crypto_verify_32(s, zero)/"+l+"/' crypto-ops.c") 5 | 6 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/sha512.h: -------------------------------------------------------------------------------- 1 | extern int crypto_hashblocks(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen); 2 | extern int crypto_hash_sha512(unsigned char *out,const unsigned char *in,unsigned long long inlen); 3 | 4 | #define crypto_hash_sha512_BYTES 64 5 | -------------------------------------------------------------------------------- /src/crypto/crypto_ops_builder/verify.c: -------------------------------------------------------------------------------- 1 | #include "crypto_verify_32.h" 2 | 3 | int crypto_verify_32(const unsigned char *x,const unsigned char *y) 4 | { 5 | unsigned int differentbits = 0; 6 | #define F(i) differentbits |= x[i] ^ y[i]; 7 | F(0) 8 | F(1) 9 | F(2) 10 | F(3) 11 | F(4) 12 | F(5) 13 | F(6) 14 | F(7) 15 | F(8) 16 | F(9) 17 | F(10) 18 | F(11) 19 | F(12) 20 | F(13) 21 | F(14) 22 | F(15) 23 | F(16) 24 | F(17) 25 | F(18) 26 | F(19) 27 | F(20) 28 | F(21) 29 | F(22) 30 | F(23) 31 | F(24) 32 | F(25) 33 | F(26) 34 | F(27) 35 | F(28) 36 | F(29) 37 | F(30) 38 | F(31) 39 | return (1 & ((differentbits - 1) >> 8)) - 1; 40 | } 41 | -------------------------------------------------------------------------------- /src/crypto/jh.h: -------------------------------------------------------------------------------- 1 | /*This program gives the 64-bit optimized bitslice implementation of JH using ANSI C 2 | 3 | -------------------------------- 4 | Performance 5 | 6 | Microprocessor: Intel CORE 2 processor (Core 2 Duo Mobile T6600 2.2GHz) 7 | Operating System: 64-bit Ubuntu 10.04 (Linux kernel 2.6.32-22-generic) 8 | Speed for long message: 9 | 1) 45.8 cycles/byte compiler: Intel C++ Compiler 11.1 compilation option: icc -O2 10 | 2) 56.8 cycles/byte compiler: gcc 4.4.3 compilation option: gcc -O3 11 | 12 | -------------------------------- 13 | Last Modified: January 16, 2011 14 | */ 15 | #pragma once 16 | 17 | typedef unsigned char BitSequence; 18 | typedef unsigned long long DataLength; 19 | typedef enum {SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2} HashReturn; 20 | 21 | HashReturn jh_hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval); 22 | -------------------------------------------------------------------------------- /src/crypto/keccak.h: -------------------------------------------------------------------------------- 1 | // keccak.h 2 | // 19-Nov-11 Markku-Juhani O. Saarinen 3 | 4 | #ifndef KECCAK_H 5 | #define KECCAK_H 6 | 7 | #include 8 | #include 9 | 10 | #ifndef KECCAK_ROUNDS 11 | #define KECCAK_ROUNDS 24 12 | #endif 13 | 14 | #ifndef ROTL64 15 | #define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) 16 | #endif 17 | 18 | // SHA3 Algorithm context. 19 | typedef struct KECCAK_CTX 20 | { 21 | // 1600 bits algorithm hashing state 22 | uint64_t hash[25]; 23 | // 1088-bit buffer for leftovers, block size = 136 B for 256-bit keccak 24 | uint64_t message[17]; 25 | // count of bytes in the message[] buffer 26 | size_t rest; 27 | } KECCAK_CTX; 28 | 29 | // compute a keccak hash (md) of given byte length from "in" 30 | void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen); 31 | 32 | // update the state 33 | void keccakf(uint64_t st[25], int norounds); 34 | 35 | void keccak1600(const uint8_t *in, size_t inlen, uint8_t *md); 36 | 37 | void keccak_init(KECCAK_CTX * ctx); 38 | void keccak_update(KECCAK_CTX * ctx, const uint8_t *in, size_t inlen); 39 | void keccak_finish(KECCAK_CTX * ctx, uint8_t *md); 40 | #endif 41 | -------------------------------------------------------------------------------- /src/crypto/wallet/empty.h.in: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020-2024, The Monero Project 2 | 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without modification, are 7 | // permitted provided that the following conditions are met: 8 | // 9 | // 1. Redistributions of source code must retain the above copyright notice, this list of 10 | // conditions and the following disclaimer. 11 | // 12 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 13 | // of conditions and the following disclaimer in the documentation and/or other 14 | // materials provided with the distribution. 15 | // 16 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 17 | // used to endorse or promote products derived from this software without specific 18 | // prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 21 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 23 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 28 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #pragma once 31 | 32 | // Left empty so internal cryptonote crypto library is used. 33 | -------------------------------------------------------------------------------- /src/device_trezor/trezor/fetch_protob.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | cd "$(dirname "$0")" 5 | 6 | if [ ! -d "trezor-common" ]; then 7 | git clone https://github.com/trezor/trezor-common.git 8 | fi 9 | 10 | cd trezor-common 11 | git fetch 12 | git reset --hard bc28c316d05bf1e9ebfe3d7df1ab25831d98d168 13 | cd .. 14 | 15 | rm -rf protob 16 | mkdir protob 17 | 18 | proto_files="messages.proto messages-common.proto messages-monero.proto messages-management.proto messages-debug.proto" 19 | 20 | for file in ${proto_files} 21 | do 22 | cp "trezor-common/protob/${file}" protob/ 23 | done 24 | cp "trezor-common/COPYING" protob/ 25 | 26 | cd protob 27 | echo "Checksums:" 28 | find . -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum 29 | -------------------------------------------------------------------------------- /src/rpc/fwd.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019-2024, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #pragma once 30 | 31 | namespace cryptonote 32 | { 33 | namespace listener 34 | { 35 | class zmq_pub; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/seraphis_crypto/dummy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/src/seraphis_crypto/dummy.cpp -------------------------------------------------------------------------------- /src/version.cpp.in: -------------------------------------------------------------------------------- 1 | #define DEF_MONERO_VERSION_TAG "@VERSIONTAG@" 2 | #define DEF_MONERO_VERSION "0.18.1.0" 3 | #define DEF_MONERO_RELEASE_NAME "Fluorine Fermi" 4 | #define DEF_MONERO_VERSION_FULL DEF_MONERO_VERSION "-" DEF_MONERO_VERSION_TAG 5 | #define DEF_MONERO_VERSION_IS_RELEASE @VERSION_IS_RELEASE@ 6 | 7 | #include "version.h" 8 | 9 | const char* const MONERO_VERSION_TAG = DEF_MONERO_VERSION_TAG; 10 | const char* const MONERO_VERSION = DEF_MONERO_VERSION; 11 | const char* const MONERO_RELEASE_NAME = DEF_MONERO_RELEASE_NAME; 12 | const char* const MONERO_VERSION_FULL = DEF_MONERO_VERSION_FULL; 13 | const bool MONERO_VERSION_IS_RELEASE = DEF_MONERO_VERSION_IS_RELEASE; 14 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern const char* const MONERO_VERSION_TAG; 4 | extern const char* const MONERO_VERSION; 5 | extern const char* const MONERO_RELEASE_NAME; 6 | extern const char* const MONERO_VERSION_FULL; 7 | extern const bool MONERO_VERSION_IS_RELEASE; 8 | -------------------------------------------------------------------------------- /src/wallet/api/common_defines.h: -------------------------------------------------------------------------------- 1 | #ifndef WALLET_API_COMMON_DEFINES_H__ 2 | #define WALLET_API_COMMON_DEFINES_H__ 3 | 4 | #define tr(x) (x) 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /tests/benchmark.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // A Boost PP sequence 4 | #define BENCHMARK_LIBRARIES @MONERO_WALLET_CRYPTO_BENCH_NAMES@ 5 | 6 | -------------------------------------------------------------------------------- /tests/block_weight/compare.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import subprocess 5 | 6 | if len(sys.argv) == 4: 7 | first = [sys.argv[1], sys.argv[2]] 8 | second = [sys.argv[3]] 9 | else: 10 | first = [sys.argv[1]] 11 | second = [sys.argv[2]] 12 | 13 | print('running: ', first) 14 | S0 = subprocess.check_output(first, stderr=subprocess.STDOUT) 15 | print('running: ', second) 16 | S1 = subprocess.check_output(second, stderr=subprocess.STDOUT) 17 | print('comparing') 18 | if S0 != S1: 19 | sys.exit(1) 20 | sys.exit(0) 21 | -------------------------------------------------------------------------------- /tests/crypto/crypto-ops-data.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2024, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "crypto/crypto-ops-data.c" 32 | -------------------------------------------------------------------------------- /tests/crypto/crypto-ops.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2024, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "crypto/crypto-ops.c" 32 | -------------------------------------------------------------------------------- /tests/data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb -------------------------------------------------------------------------------- /tests/data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f -------------------------------------------------------------------------------- /tests/data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 -------------------------------------------------------------------------------- /tests/data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe -------------------------------------------------------------------------------- /tests/data/fuzz/base58/ENC1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/base58/ENC1 -------------------------------------------------------------------------------- /tests/data/fuzz/base58/ENC2: -------------------------------------------------------------------------------- 1 | 9zZBkWRgMNPEnVofRFqWK9MKBwgXNyKELBJSttxb1t2UhDM114URntt5iYcXzXusoHZygfSojsbviXZhnP9pJ4p2SDcv81L -------------------------------------------------------------------------------- /tests/data/fuzz/block/BLOCK1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/block/BLOCK1 -------------------------------------------------------------------------------- /tests/data/fuzz/block/BLOCK2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/block/BLOCK2 -------------------------------------------------------------------------------- /tests/data/fuzz/bulletproof/BP0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/bulletproof/BP0 -------------------------------------------------------------------------------- /tests/data/fuzz/cold-outputs/out-all-6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/cold-outputs/out-all-6 -------------------------------------------------------------------------------- /tests/data/fuzz/cold-outputs/out-none-6: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tests/data/fuzz/cold-transaction/CTX1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/cold-transaction/CTX1 -------------------------------------------------------------------------------- /tests/data/fuzz/http-client/RESP1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 Ok 2 | Server: Epee-based 3 | Content-Length: 5 4 | Content-Type: text/plain 5 | Last-Modified: Mon, 11 Dec 2017 09:03:03 GMT 6 | Accept-Ranges: bytes 7 | 8 | foo 9 | -------------------------------------------------------------------------------- /tests/data/fuzz/levin/LEVIN1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/levin/LEVIN1 -------------------------------------------------------------------------------- /tests/data/fuzz/load-from-binary/BINARY1: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tests/data/fuzz/load-from-json/JSON1: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/data/fuzz/parse-url/URL1: -------------------------------------------------------------------------------- 1 | 127.0.0.1 -------------------------------------------------------------------------------- /tests/data/fuzz/parse-url/URL2: -------------------------------------------------------------------------------- 1 | iframe_test.html?api_url=https://api.vk.com/api.php&api_id=3289090&api_settings=1&viewer_id=562964060&viewer_type=0&sid=0aad8d1c5713130f9ca0076f2b7b47e532877424961367d81e7fa92455f069be7e21bc3193cbd0be11895&secret=368ebbc0ef&access_token=668bc03f43981d883f73876ffff4aa8564254b359cc745dfa1b3cde7bdab2e94105d8f6d8250717569c0a7&user_id=0&group_id=0&is_app_user=1&auth_key=d2f7a895ca5ff3fdb2a2a8ae23fe679a&language=0&parent_language=0&ad_info=ElsdCQBaQlxiAQRdFUVUXiN2AVBzBx5pU1BXIgZUJlIEAWcgAUoLQg==&referrer=unknown&lc_name=9834b6a3&hash= -------------------------------------------------------------------------------- /tests/data/fuzz/signature/SIG1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/signature/SIG1 -------------------------------------------------------------------------------- /tests/data/fuzz/signature/SIG2: -------------------------------------------------------------------------------- 1 | SigV1WbMcLkLKXz3Su9iFUp9aYF5vSfpVetcytVWAgqhn3KNe1kidn7M2KfTRpuK8G1ba1w2u5mbyoWbkLPy2Gm97BM4W -------------------------------------------------------------------------------- /tests/data/fuzz/transaction/TX1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/transaction/TX1 -------------------------------------------------------------------------------- /tests/data/fuzz/transaction/TX2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/transaction/TX2 -------------------------------------------------------------------------------- /tests/data/fuzz/tx-extra/TXEXTRA1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/tx-extra/TXEXTRA1 -------------------------------------------------------------------------------- /tests/data/fuzz/tx-extra/TXEXTRA2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/tx-extra/TXEXTRA2 -------------------------------------------------------------------------------- /tests/data/fuzz/utf8/UTF8_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/utf8/UTF8_1 -------------------------------------------------------------------------------- /tests/data/fuzz/utf8/UTF8_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/fuzz/utf8/UTF8_2 -------------------------------------------------------------------------------- /tests/data/node/banlist_1.txt: -------------------------------------------------------------------------------- 1 | # magicfolk 2 | 255.255.255.0 # Saruman the White 3 | 128.128.128.0 # Gandalf the Gray 4 | 150.75.0.0 # Radagast the Brown 5 | 99.98.0.0/16 # All of Misty Mountain 6 | 7 | # personal enemies 8 | 1.2.3.4 # this woman used to give me swirlies 9 | 6.7.8.9 # I just don't like the cut of his jib 10 | 1.0.0.7#Literally James Bond, he wrecked my aston martin 11 | 100.98.1.13 # Earl from HOA 12 | 100.98.1.0/24 #The rest of the HOA for good measure 13 | # 14 | 15 | #7.7.7.7 16 | #^^^We're chill now, she's truly an angel 17 | 18 | -------------------------------------------------------------------------------- /tests/data/outputs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/outputs -------------------------------------------------------------------------------- /tests/data/sha256sum/CLSAG.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/sha256sum/CLSAG.pdf -------------------------------------------------------------------------------- /tests/data/sha256sum/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/sha256sum/empty.txt -------------------------------------------------------------------------------- /tests/data/signed_monero_tx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/signed_monero_tx -------------------------------------------------------------------------------- /tests/data/txs/bpp_tx_e89415.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/txs/bpp_tx_e89415.bin -------------------------------------------------------------------------------- /tests/data/unsigned_monero_tx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/unsigned_monero_tx -------------------------------------------------------------------------------- /tests/data/wallet_00fd416a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/wallet_00fd416a -------------------------------------------------------------------------------- /tests/data/wallet_00fd416a.keys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/wallet_00fd416a.keys -------------------------------------------------------------------------------- /tests/data/wallet_9svHk1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/wallet_9svHk1 -------------------------------------------------------------------------------- /tests/data/wallet_9svHk1.keys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/tests/data/wallet_9svHk1.keys -------------------------------------------------------------------------------- /tests/difficulty/gen_wide_data.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import random 4 | 5 | DIFFICULTY_TARGET = 120 6 | DIFFICULTY_WINDOW = 720 7 | DIFFICULTY_LAG = 15 8 | DIFFICULTY_CUT = 60 9 | 10 | def difficulty(): 11 | times = [] 12 | diffs = [] 13 | while True: 14 | if len(times) <= 1: 15 | diff = 1 16 | else: 17 | begin = max(len(times) - DIFFICULTY_WINDOW - DIFFICULTY_LAG, 0) 18 | end = min(begin + DIFFICULTY_WINDOW, len(times)) 19 | length = end - begin 20 | assert length >= 2 21 | if length <= DIFFICULTY_WINDOW - 2 * DIFFICULTY_CUT: 22 | cut_begin = 0 23 | cut_end = length 24 | else: 25 | excess = length - (DIFFICULTY_WINDOW - 2 * DIFFICULTY_CUT) 26 | cut_begin = (excess + 1) // 2 27 | cut_end = length - excess // 2 28 | assert cut_begin + 2 <= cut_end 29 | wnd = times[begin:end] 30 | wnd.sort() 31 | dtime = wnd[cut_end - 1] - wnd[cut_begin] 32 | dtime = max(dtime, 1) 33 | ddiff = sum(diffs[begin + cut_begin + 1:begin + cut_end]) 34 | diff = (ddiff * DIFFICULTY_TARGET + dtime - 1) // dtime 35 | times.append((yield diff)) 36 | diffs.append(diff) 37 | 38 | random.seed(1) 39 | time = 1000 40 | gen = difficulty() 41 | diff = next(gen) 42 | for i in range(100000): 43 | power = 100 if i < 10000 else 100000000 if i < 500 else 1000000000000 if i < 1000 else 1000000000000000 if i < 2000 else 10000000000000000000 if i < 4000 else 1000000000000000000000000 44 | time += random.randint(-diff // power - 10, 3 * diff // power + 10) 45 | print(time, diff) 46 | diff = gen.send(time) 47 | -------------------------------------------------------------------------------- /tests/difficulty/wide_difficulty.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import subprocess 5 | 6 | python = sys.argv[1] 7 | py = sys.argv[2] 8 | c = sys.argv[3] 9 | data = sys.argv[4] 10 | 11 | first = python + " " + py + " > " + data 12 | second = [c, '--wide', data] 13 | 14 | try: 15 | print('running: ', first) 16 | subprocess.check_call(first, shell=True) 17 | print('running: ', second) 18 | subprocess.check_call(second) 19 | except: 20 | sys.exit(1) 21 | 22 | -------------------------------------------------------------------------------- /tests/functional_tests/check_missing_rpc_methods.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import re 5 | 6 | USAGE = 'usage: check_untested_methods.py ' 7 | try: 8 | rootdir = sys.argv[1] 9 | except: 10 | print(USAGE) 11 | sys.exit(1) 12 | 13 | sys.path.insert(0, rootdir + '/utils/python-rpc') 14 | 15 | from framework import daemon 16 | from framework import wallet 17 | 18 | modules = [ 19 | { 20 | 'name': 'daemon', 21 | 'object': daemon.Daemon(), 22 | 'path': rootdir + '/src/rpc/core_rpc_server.h', 23 | 'ignore': [] 24 | }, 25 | { 26 | 'name': 'wallet', 27 | 'object': wallet.Wallet(), 28 | 'path': rootdir + '/src/wallet/wallet_rpc_server.h', 29 | 'ignore': [] 30 | } 31 | ] 32 | 33 | error = False 34 | for module in modules: 35 | for line in open(module['path']).readlines(): 36 | if 'MAP_URI_AUTO_JON2' in line or 'MAP_JON_RPC' in line: 37 | match = re.search('.*\"(.*)\".*', line) 38 | name = match.group(1) 39 | if name in module['ignore'] or name.endswith('.bin'): 40 | continue 41 | if 'MAP_URI_AUTO_JON2' in line: 42 | if not name.startswith('/'): 43 | print('Error: %s does not start with /' % name) 44 | error = True 45 | name = name[1:] 46 | if not hasattr(module['object'], name): 47 | print('Error: %s API method %s does not have a matching function' % (module['name'], name)) 48 | error = True 49 | 50 | sys.exit(1 if error else 0) 51 | -------------------------------------------------------------------------------- /tests/hash/tests-slow-1.txt: -------------------------------------------------------------------------------- 1 | b5a7f63abb94d07d1a6445c36c07c7e8327fe61b1647e391b4c7edae5de57a3d 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2 | 80563c40ed46575a9e44820d93ee095e2851aa22483fd67837118c6cd951ba61 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 3 | 5bb40c5880cef2f739bdb6aaaf16161eaae55530e7b10d7ea996b751a299e949 8519e039172b0d70e5ca7b3383d6b3167315a422747b73f019cf9528f0fde341fd0f2a63030ba6450525cf6de31837669af6f1df8131faf50aaab8d3a7405589 4 | 613e638505ba1fd05f428d5c9f8e08f8165614342dac419adc6a47dce257eb3e 37a636d7dafdf259b7287eddca2f58099e98619d2f99bdb8969d7b14498102cc065201c8be90bd777323f449848b215d2977c92c4c1c2da36ab46b2e389689ed97c18fec08cd3b03235c5e4c62a37ad88c7b67932495a71090e85dd4020a9300 5 | ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8ab49459b 38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb 6 | -------------------------------------------------------------------------------- /tests/hash/tests-slow-2.txt: -------------------------------------------------------------------------------- 1 | 353fdc068fd47b03c04b9431e005e00b68c2168a3cc7335c8b9b308156591a4f 5468697320697320612074657374205468697320697320612074657374205468697320697320612074657374 2 | 72f134fc50880c330fe65a2cb7896d59b2e708a0221c6a9da3f69b3a702d8682 4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e67 3 | 410919660ec540fc49d8695ff01f974226a2a28dbbac82949c12f541b9a62d2f 656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f7265 4 | 4472fecfeb371e8b7942ce0378c0ba5e6d0c6361b669c587807365c787ae652d 657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c 5 | 577568395203f1f1225f2982b637f7d5e61b47a0f546ba16d46020b471b74076 71756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e697369 6 | f6fd7efe95a5c6c4bb46d9b429e3faf65b1ce439e116742d42b928e61de52385 757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e20447569732061757465 7 | 422f8cfe8060cf6c3d9fd66f68e3c9977adb683aea2788029308bbe9bc50d728 697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c6974 8 | 512e62c8c8c833cfbd9d361442cb00d63c0a3fd8964cfd2fedc17c7c25ec2d4b 657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e 9 | 12a794c1aa13d561c9c6111cee631ca9d0a321718d67d3416add9de1693ba41e 4578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c 10 | 2659ff95fc74b6215c1dc741e85b7a9710101b30620212f80eb59c3c55993f9d 73756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e 11 | -------------------------------------------------------------------------------- /tests/hash/tests-slow-4.txt: -------------------------------------------------------------------------------- 1 | f759588ad57e758467295443a9bd71490abff8e9dad1b95b6bf2f5d0d78387bc 5468697320697320612074657374205468697320697320612074657374205468697320697320612074657374 1806260 2 | 5bb833deca2bdd7252a9ccd7b4ce0b6a4854515794b56c207262f7a5b9bdb566 4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e67 1806261 3 | 1ee6728da60fbd8d7d55b2b1ade487a3cf52a2c3ac6f520db12c27d8921f6cab 656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f7265 1806262 4 | 6969fe2ddfb758438d48049f302fc2108a4fcc93e37669170e6db4b0b9b4c4cb 657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c 1806263 5 | 7f3048b4e90d0cbe7a57c0394f37338a01fae3adfdc0e5126d863a895eb04e02 71756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e697369 1806264 6 | 1d290443a4b542af04a82f6b2494a6ee7f20f2754c58e0849032483a56e8e2ef 757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e20447569732061757465 1806265 7 | c43cc6567436a86afbd6aa9eaa7c276e9806830334b614b2bee23cc76634f6fd 697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c6974 1806266 8 | 87be2479c0c4e8edfdfaa5603e93f4265b3f8224c1c5946feb424819d18990a4 657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e 1806267 9 | dd9d6a6d8e47465cceac0877ef889b93e7eba979557e3935d7f86dce11b070f3 4578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c 1806268 10 | 75c6f2ae49a20521de97285b431e717125847fb8935ed84a61e7f8d36a2c3d8e 73756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e 1806269 11 | -------------------------------------------------------------------------------- /tests/hash/tests-slow.txt: -------------------------------------------------------------------------------- 1 | 2f8e3df40bd11f9ac90c743ca8e32bb391da4fb98612aa3b6cdc639ee00b31f5 6465206f6d6e69627573206475626974616e64756d 2 | 722fa8ccd594d40e4a41f3822734304c8d5eff7e1b528408e2229da38ba553c4 6162756e64616e732063617574656c61206e6f6e206e6f636574 3 | bbec2cacf69866a8e740380fe7b818fc78f8571221742d729d9d02d7f8989b87 63617665617420656d70746f72 4 | b1257de4efc5ce28c6b40ceb1c6c8f812a64634eb3e81c5220bee9b2b76a6f05 6578206e6968696c6f206e6968696c20666974 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/README.md: -------------------------------------------------------------------------------- 1 | # Running libwallet_api tests 2 | 3 | ## Environment for the tests 4 | * Running monero node, linked to private/public testnet. 5 | By default, tests expect daemon running at ```localhost:38081```, 6 | can be overridden with environment variable ```TESTNET_DAEMON_ADDRESS=``` 7 | [Manual](https://github.com/moneroexamples/private-testnet) explaining how to run private testnet. 8 | 9 | * Directory with pre-generated wallets 10 | (wallet_01.bin, wallet_02.bin,...,wallet_06.bin, some of these wallets might not be used in the tests currently). 11 | By default, tests expect these wallets to be in ```/var/monero/testnet_pvt```. 12 | Directory can be overridden with environment variable ```WALLETS_ROOT_DIR=```. 13 | Directory and files should be writable for the user running tests. 14 | 15 | 16 | ## Generating test wallets 17 | * ```create_wallets.sh``` - this script will create wallets (wallet_01.bin, wallet_02.bin,...,wallet_06.bin) in current directory. 18 | when running first time, please uncomment line ```#create_wallet wallet_m``` to create miner wallet as well. 19 | This wallet should be used for mining and all test wallets supposed to be seed from this miner wallet 20 | 21 | * ```mining_start.sh``` and ```mining_stop.sh``` - helper scripts to start and stop mining on miner wallet 22 | 23 | * ```send_funds.sh``` - script for seeding test wallets. Please run this script when you have enough money on miner wallet 24 | 25 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/create_wallets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function create_wallet { 4 | wallet_name=$1 5 | echo 0 | monero-wallet-cli --testnet --trusted-daemon --daemon-address localhost:38081 --generate-new-wallet $wallet_name --password "" --restore-height=1 6 | } 7 | 8 | 9 | create_wallet wallet_01.bin 10 | create_wallet wallet_02.bin 11 | create_wallet wallet_03.bin 12 | create_wallet wallet_04.bin 13 | create_wallet wallet_05.bin 14 | create_wallet wallet_06.bin 15 | 16 | # create_wallet wallet_m 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/mining_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rlwrap monero-wallet-cli --wallet-file wallet_m --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_m.log start_mining 4 | 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/mining_stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rlwrap monero-wallet-cli --wallet-file wallet_m --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_miner.log stop_mining 4 | 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/open_wallet_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | rlwrap monero-wallet-cli --wallet-file wallet_01.bin --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_01.log 5 | 6 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/open_wallet_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | rlwrap monero-wallet-cli --wallet-file wallet_02.bin --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_01.log 5 | 6 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/open_wallet_3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rlwrap monero-wallet-cli --wallet-file wallet_03.bin --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_03.log 4 | 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/open_wallet_4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rlwrap monero-wallet-cli --wallet-file wallet_04.bin --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_04.log 4 | 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/open_wallet_5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rlwrap monero-wallet-cli --wallet-file wallet_05.bin --password "" --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_05.log 4 | 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/open_wallet_miner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rlwrap monero-wallet-cli --wallet-file wallet_m --password "" --testnet --trusted-daemon --daemon-address 127.0.0.1:38081 --log-file wallet_m.log 4 | 5 | -------------------------------------------------------------------------------- /tests/libwallet_api_tests/scripts/send_funds.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function send_funds { 4 | local amount=$1 5 | local dest=$(cat "$2.address.txt") 6 | 7 | monero-wallet-cli --wallet-file wallet_m --password "" \ 8 | --testnet --trusted-daemon --daemon-address localhost:38081 --log-file wallet_m.log \ 9 | --command transfer $dest $amount 10 | } 11 | 12 | 13 | function seed_wallets { 14 | local amount=$1 15 | send_funds $amount wallet_01.bin 16 | send_funds $amount wallet_02.bin 17 | send_funds $amount wallet_03.bin 18 | send_funds $amount wallet_04.bin 19 | send_funds $amount wallet_05.bin 20 | send_funds $amount wallet_06.bin 21 | } 22 | 23 | seed_wallets 1 24 | seed_wallets 2 25 | seed_wallets 5 26 | seed_wallets 10 27 | seed_wallets 20 28 | seed_wallets 50 29 | seed_wallets 100 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /tests/unit_tests/is_hdd.cpp: -------------------------------------------------------------------------------- 1 | #include "common/util.h" 2 | #include 3 | #include 4 | #include 5 | #include /* required to output boost::optional in assertions */ 6 | 7 | #if defined(__GLIBC__) 8 | TEST(is_hdd, rotational_drive) { 9 | const char *hdd = std::getenv("MONERO_TEST_DEVICE_HDD"); 10 | if (hdd == nullptr) 11 | GTEST_SKIP() << "No rotational disk device configured"; 12 | EXPECT_EQ(tools::is_hdd(hdd), boost::optional(true)); 13 | } 14 | 15 | TEST(is_hdd, ssd) { 16 | const char *ssd = std::getenv("MONERO_TEST_DEVICE_SSD"); 17 | if (ssd == nullptr) 18 | GTEST_SKIP() << "No SSD device configured"; 19 | EXPECT_EQ(tools::is_hdd(ssd), boost::optional(false)); 20 | } 21 | 22 | TEST(is_hdd, unknown_attrs) { 23 | EXPECT_EQ(tools::is_hdd("/dev/null"), boost::none); 24 | } 25 | #endif 26 | TEST(is_hdd, stability) 27 | { 28 | EXPECT_NO_THROW(tools::is_hdd("")); 29 | } 30 | -------------------------------------------------------------------------------- /translations/ready: -------------------------------------------------------------------------------- 1 | fr 2 | it 3 | ja 4 | sv 5 | -------------------------------------------------------------------------------- /utils/conf/monerod.conf: -------------------------------------------------------------------------------- 1 | # Configuration for monerod 2 | # Syntax: any command line option may be specified as 'clioptionname=value'. 3 | # Boolean options such as 'no-igd' are specified as 'no-igd=1'. 4 | # See 'monerod --help' for all available options. 5 | 6 | data-dir=/var/lib/monero 7 | log-file=/var/log/monero/monero.log 8 | log-level=0 9 | -------------------------------------------------------------------------------- /utils/doxygen-publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # maintainer (ask me any questions): rfree 4 | 5 | if [[ ! -r "Doxyfile" ]] ; then 6 | echo "Error, can not read the Doxyfile - make sure to run this script from top of monero project, where the Doxyfile file is located" 7 | exit 1 8 | fi 9 | 10 | wwwdir="$HOME/monero-www/" 11 | if [[ ! -w "$wwwdir" ]] ; then 12 | echo "Error, can not write into wwwdir=$wwwdir. It should be a directory readable/connected to your webserver, or a symlink to such directory" 13 | exit 1 14 | fi 15 | 16 | if [[ ! -d "$wwwdir/doc" ]] ; then 17 | echo "Creating subdirs" 18 | mkdir "$wwwdir/doc" 19 | fi 20 | 21 | echo "Generating:" 22 | doxygen Doxyfile && echo "Backup previous version:" && rm -rf ~/monero-www-previous && mv "$wwwdir/doc" ~/monero-www-previous && cp -ar doc/ "$wwwdir/" && echo "Done, builded and copied to public - the doxygen docs" && echo "size:" && du -Dsh "$wwwdir/" && echo "files:" && find "$wwwdir/" | wc -l 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /utils/fish/README.md: -------------------------------------------------------------------------------- 1 | ## Fish shell completions for Monero 2 | This folder has basic Fish completions for `monerod`, `monero-wallet-cli`, and `monero-wallet-rpc`. To use them, put those files (or symlink them) inside `~/.config/fish/completions/` or wherever your Fish completion files are (see [https://fishshell.com/docs/current/completions.html#where-to-put-completions](https://fishshell.com/docs/current/completions.html#where-to-put-completions)) 3 | -------------------------------------------------------------------------------- /utils/gpg_keys/0xfffc0000.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mDMEZZx2rhYJKwYBBAHaRw8BAQdADWrpnGYQMJB7m7OYO5QhLPbNZckNDp5XXX5C 4 | NRqQSv60ITB4ZmZmYzAwMDAgPDB4ZmZmYzAwMDBAcHJvdG9uLm1lPoiTBBMWCgA7 5 | FiEESleXwQVNMqPAAcfxZQ98K3vaOBkFAmWcdq4CGwMFCwkIBwICIgIGFQoJCAsC 6 | BBYCAwECHgcCF4AACgkQZQ98K3vaOBmm6QEA1l5FuxR7MtER+pl4XiL+UEH4rGjQ 7 | BHTD/Tv6Ar6uq2oA/34XecxRCKmj4ximF1aMucJSvS8nIjRbRQ9E5llcLOYMuDgE 8 | ZZx2rhIKKwYBBAGXVQEFAQEHQIxFNA2STqB1WQNDtPHalCrKOBxheB6Lg1U+ceOF 9 | rTFcAwEIB4h4BBgWCgAgFiEESleXwQVNMqPAAcfxZQ98K3vaOBkFAmWcdq4CGwwA 10 | CgkQZQ98K3vaOBnZ2gEAsrARrt+Mm+zfqVFZ7iAQHD5xmdj9Q0Qf3zl5dVbkFlQB 11 | APOdwpn/iY0zA6McjZ1H+Uiv+bw8uTVZadgjtJGb474O 12 | =J9WU 13 | -----END PGP PUBLIC KEY BLOCK----- 14 | -------------------------------------------------------------------------------- /utils/gpg_keys/anon.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mDMEAAAAGBYJKwYBBAHaRw8BAQdAtk3N9Qcw9x3s5frY00j/jO10wfOCZ59mTLtN 4 | tsYJ1620GGFub24gPGFub24gW2F0XSBub3doZXJlPoiQBBMWCAA4FiEEn2DdNuXc 5 | KHIjsNT304V8F6p/losFAmAhnpUCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA 6 | CgkQ04V8F6p/loumGwEAxjmzDa6ZK7zsps0sYbOvlh0tmxByUqZy1GvIaiOpdboA 7 | /2guWA0tzK+fyQS2L2oXzFwh+oTk5bZ2KqnnfCr9a6kDuDgEYCG1oRIKKwYBBAGX 8 | VQEFAQEHQCnTdYrNM/yw++BSJPgPAoImGhrKaqBoe5VBi9TUk+8aAwEIB4h4BBgW 9 | CAAgFiEEn2DdNuXcKHIjsNT304V8F6p/losFAmAhtaECGwwACgkQ04V8F6p/lose 10 | 3AD9E3e4olBj7e6t5NtlMkkBzYKs16RNZRMJ5GMOw8lH8NUA/imPWARO2Y4ryswV 11 | LAtQE1x0SCd4wEP8QEta4p2OYscI 12 | =9Mvr 13 | -----END PGP PUBLIC KEY BLOCK----- 14 | -------------------------------------------------------------------------------- /utils/gpg_keys/erciccione.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mQENBFohQ30BCADktKHeTg48Dm4oU9JPrfHXzY3sZtTQsqsQGmYiFT8nQjRnSzic 4 | dZe4sh2W4UYQSLFw7pEb7a51ZYkz5+gFKcj3NmIaEpNra7+SEtszoS3IALHUyGGQ 5 | +nFDxUHwTV5OeIUXPHs2AnCVZa4yEWmavXFiPL35+dcFkwyUA5psd97dFIbtkPQ4 6 | nT2RCc2emy6NHVE5L7pzlBe9CeFkFyovs847d3WDa/96TT4JMRm34qvUrSvOkqti 7 | xrui8hGwNedAw64ObiJhQLa3rvQ8bCtTLNHhpdc+zhBi3L5nIdwquMd5Bd6zHfmW 8 | HHyXEoRTZYMRabNBSR9FrsjGBiHG9wuEK2B7ABEBAAG0NWVyY2ljY2lvbmVAcHJv 9 | dG9ubWFpbC5jb20gPGVyY2ljY2lvbmVAcHJvdG9ubWFpbC5jb20+iQE1BBABCAAp 10 | BQJaIUN9BgsJBwgDAgkQdir4xgjlbN8EFQgKAgMWAgECGQECGwMCHgEAAFc+CAC2 11 | 7BDCYPWfXCKtaqP/jzay46nai66hSyuIJ2sd4RSbQlVNCwFUQ2NtUwDxtzdzB3bk 12 | AfsqrkdSS7V82bfZPOoYapWikjA3LGd2GHvClKNmIgIg3CvrAByD9okhLYOmxChU 13 | 5/FzMgSgDdbez4Z+XXzUothirHcHR7J+PtzqMZWusuyNqfXlWgPNPbAHG/hm5RLw 14 | s6uGOLDqhJDiqi0HjC/p9ponPAJ3g0jfECnXFp7R32EgbBHExT/g8e3L4J3Q8y/E 15 | WrZiQsIc89srANw5YIcjlr/i3PY8tyrelpLDVBj05802WYamYx10Zd2epM4NglBs 16 | +YjiWpSM9fTi9QKFCHyAuQENBFohQ30BCADe4FJcus4e3FzsagKdAM/iFeZ4BE2l 17 | gVgSg8CVWIYlTAmeK+SBPfsxvwOWxmx/KkirWn3hOSA2U6mp9+g6hr9rLqWNwatM 18 | OsitrJlWG2aPcuAmlzLFvtH0Vbilh0m4B98g2XUa94HtrlGdPAoYPquS1HsfL284 19 | CHpQXXOypOS+/spTK/OlpdUaPaVyqVfE3kzXYqt24RbDcsOvUzSzVRCA8kBp6azm 20 | 1qoqDboP112Ax7OkV0FGc/kd5PNMPTOnVR+4wVXWhl6gAI1I2JFvo3EJlxtddyTB 21 | Rkx06jbYRyPj9KCEC4CBx9qsNlo7TUHgObAr+CLX4I5hkEWW0pS98vlpABEBAAGJ 22 | AR8EGAEIABMFAlohQ30JEHYq+MYI5WzfAhsMAAD1twgAxjbETzOUeq/bWwVoGzmh 23 | SMJajZs2c5Pv0SAwi5QZCoRefp2HYfpWcBsfZG84B0EmJb9Wwu3wrXWBf96xMTFM 24 | neU0+L2+RcH8uH7/C2MlVaZjFv5dPPJAtwbY2BQl1bX5DrEwZ8QH7IUXZmWfjmZ3 25 | ww5llfCAyVCxMn+tnIJnk/7HODY0t1LmusFvZsAVsWIgdndKImXM4CTzirfmDks8 26 | TxpXfaJzU3B3KTIzMgEvwtTLJfgf07Foy4ITIl+1zS7gLL0fXldtx6fJJMvANsLf 27 | JrRjafh21qfJb3I9TUH8G7C0Ln3LspBGsWZ4f+fjq4LEg7SCOAJSeBwfOtMJeCrU 28 | /Q== 29 | =a70Z 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /utils/gpg_keys/guzzi.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1 3 | 4 | mQENBFed+r8BCADScb2cSXAk7v0+tbEUDOf6VuhKc26C2Kfwk/Ei2iWC7Vaa/bru 5 | aNLpM1nVuWKdNnfX3MZo38yItvxS4HlkI29pXcrzyqd3sfPklPgLliaayKkqh1Xx 6 | jl6T5NM9VVJ5dMo0pMzns49xFknOsBXdSH/ziZVD0SuSNctNb5XraCrfuDPw0fn0 7 | lLZ4a6WwUXL9+4Y+xbvNmYHjlnAB7xjvOpprSuJ769zDGpQlV2UXeRqjjMPzVbH4 8 | PYgmNAItbhvog2UfKeQK8K0Fwj1uNsZ5fnqvoa9lsgsbyV4x4DbQu/W5NVP1ylDC 9 | MnHKABa8Rg8zzjp0G7YuBGPy/JPffwZBoEuhABEBAAG0I2d1enppam9uZXMgPGd1 10 | enppam9uZXMxMkBnbWFpbC5jb20+iQE5BBMBCAAjBQJXnfq/AhsDBwsJCAcDAgEG 11 | FQgCCQoLBBYCAwECHgECF4AACgkQXNw+OlijFbIhbggAt6pEz8g++3vHXFaEsOiK 12 | fSJYheSuY2NGOgmS2WBWdPp6z7nobSScYzCeF4pOnCFxM99O7i9/kfDzVp4W7lXL 13 | VIvLiLvKwWLkVhHhgOlerLRYNR+TjS+GtGhhL6Y2Yj1AkG2pJd59SBhbhdkqdNo0 14 | D614GjnyK8SGlz9xjV9ZE4csTPH2p9xOqJoRCoUuEGWHNoox0vJTuJuKhCHta1y8 15 | T84uFcGCagxHxqv5eqgype32iueSMfsbyyFJ2WaLaCyYKcPGbXG9iFFLqtvJU9xv 16 | 46oPYd1HYjtXVaRnbtiDljlokEiXiQ7WPsYEgZy76KMJ30fEyXICPYvTDR1aFLYI 17 | 1LkBDQRXnfq/AQgA2JHleHFNtQM1ECeEGAYoGzt+IyPKzuT43ZgwuxK4t0kfKNN4 18 | KvihBcmFqjJAwwmS+9oNPeU4BgZ4k8DX2JP3JoGzFF7MK+i8OFW0ckZ4kbNZhtq3 19 | e8a1fkWnkA6pQA1JppiZqqI+VNLTTPvsH8pG2UA4rL4XvxeJ7jrFnQMCfiOiuIsd 20 | C+MeUAHthNeLreq1LXx0s0GfPMwMM5ckKdtEKmMVCw1zZ/J2RyBzkyWdyMVPSRRV 21 | lCDtgSivCSG+Y+ub4tgV8ast2/wKxCV92oRaeMQVsWZ9PHdVq0tUn4I98UtCwOh7 22 | reMPi6a8eWJcQ/s07schqXt2iTssv/1V3PTjZQARAQABiQEfBBgBCAAJBQJXnfq/ 23 | AhsMAAoJEFzcPjpYoxWydDsH/2sLAtzKVgbeZFF/0e+6r/P0R3Fgkv6N9o+w4A5N 24 | pMDXCNjFjWVkYRgyON8Y8ijkkbIkBcXmp+01HxZjrQI0WavQaLj2tavz9Np/8wPb 25 | UXZYc0zjxki9mdFdNDW1vgoT9nSctB4bp0xf/NnYmkPMQfDzruVkf8bW6YQzkZRP 26 | apjY9IxUPKFx9hQcDAsov1xXww2uQPwEGHfeSMkeCU9zfPBNmaFCvBfFTFu5UHsl 27 | g2hw95UUsDlpYcMs7YdqYw40EXcTQJk1aoWT7kjO1KCQWF5EDc0YRhw/REXN9fJe 28 | S77oEy23Q/RtJQBXzHw3chyhe4/XMQQbmuY9+OfmhHVAbF4= 29 | =lOXz 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /utils/gpg_keys/jaquee.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2 3 | 4 | mQENBFg14koBCACxrLtcmKK1X9haFa90Vr04PfHK9hXDeUrwUS8xIhCojj2WccdR 5 | 6hJLUCR27G03gb36xadQhQVCYk2tAwOKLjZVlsUtJ5rLASjPv9mcmgZnL5nU66Qi 6 | 9lHFKBD/Mrf7X6Bg89nWT2dUshIUuvkmbAAh9o9i8CoA/P62/9TG4uWc+vbNGEzV 7 | jb6UtPQc6DHgZ8HeagC9WLE4bTx8tIxNmimwyLc5fow0G0LE0eb3V8jPMUZkdG1h 8 | byHOLeqbSkFJd8GVYz96o/XNzFPPv/60bihn5wDMZqL9J64odoCqzligP1OprhhF 9 | wEsbt0QQ60R9AlCjCgz7pgH8QIJSeX1a121HABEBAAG0IEphcXVlZSA8amFxdWVl 10 | Lm1vbmVyb0BnbWFpbC5jb20+iQE5BBMBCAAjBQJYNeJKAhsDBwsJCAcDAgEGFQgC 11 | CQoLBBYCAwECHgECF4AACgkQOE5SsJ9F3DmyqggArNrQzE4jopaDzxNy+VKTKf7z 12 | chMk9zzY6TSKQ9YfQe0zHKcL7GyfQ/plVmoPMZQglVvC54Vw0aLA8PGt1a/ZU0mD 13 | KWLTGbdIHasGatkY7J3B/vjDsPxfWMKai4Bpesk+gI4/nb2V8/CVsSuVlX5PrQD4 14 | buXhv7S7Mn6ezzzRZD/oYN5WaokgAxu8rnTlJN8yQP3uat71ply+JN3u3TwFxMeX 15 | WcrDTwq/XqJD7OUWrBm378v7M1Dd8kWQTwyWMPCDZhaYgiSlSwKfbDsq4e7d55jv 16 | 2ucKL1AOGnpn6hJ7ip0sn9rLr53qD7eqHl7yzsrrRZkYH6AYiXvk45Srx76DSbkB 17 | DQRYNeJKAQgAvMTf6cGiBTJzj9DfATqQlLEPWJHbqfoFTIbRlHmYdCBbLH2M/GCr 18 | HK4YdhF+9i+Wnq5E9fxnxJzhm22dfSWgw9GuyX8LxBanVhhQiE+9eH/H0ULHjokN 19 | PVQOg90XdAQWahvl5YCOmqt7H7z6+HxHIhCHzo688+lPC4zol0PYNEWcHYBrVsax 20 | cEQ2LObD9J7bBY1BqLXppzHATTwxuO/bp9Bd9LmCaFBinLyF34oDYttEVOq2RNko 21 | vNeWbHWpmdzoagHxLGMU1ae+yCMuGHSdfLnLWTUdVLepVLmzblXxgTd7SS4Bm3Y0 22 | 1jBgBni8msSTR1ICvyMcQuRZnK/yAgM+TQARAQABiQEfBBgBCAAJBQJYNeJKAhsM 23 | AAoJEDhOUrCfRdw5hmsH/0Moh1Z4kPXbvfincDarDDDe5wUImey/7WwOrSsiPwTI 24 | 8AkRts496o3XHcsSWLXZ5Ab+cGKnys5TRfX+RqMrG4p+TXMt2vWDnF5gjeRcwpcz 25 | UI/TCFkCg+x3QAEvlNFNLK4APd2fwR/KQJjmn4a4/0boqrrn09vLSx7/+bdsfYbZ 26 | eKSuF58aYVROY9FUNhFsvgjGI/sYNQFj0DoexLe28f4/cFFVpZvb/kJYqm4QauyK 27 | 5SMyvTTu8PD+pZpLM9MFoQ+Jk+EmDzSUlarwnt75O6kMLNLPFJ8hCOiN2RNK2PKk 28 | iTpY5CQtKsGQDRA7sT6ZaiWO7kkQGO0HSBfmWnZq2G0= 29 | =Ky09 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /utils/gpg_keys/luigi1111.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1 3 | 4 | mQENBFdodc4BCAC02POyrMUol+nTXeZ2nCKM9G1Q2oU5jQLaQLNLUU88PHLdOVGd 5 | nKh0QA4Uc4CA2wWU5zdIVFEzowUUNyKeSLJZhvOXbpN+pm6n9XiyNSZSDJhvMtAs 6 | FEcyWyAjPAQT7MFS2SJgG7HhcoMAgr3ypp8FpAK2YwbfjfPqs5VFVdrYrVPfiSVJ 7 | NTSoJMW+2oOUdTR/L6z8lzUZu0CH8aJK1Qqr0yyxbJelayPsos3aRQ9TQAu6u/zQ 8 | PxURHaLTe8RsB6oa6wXnpZtXcl1xaigvlkNVpeHPbroBvhJoCbAFHC/edaBNBLiP 9 | I3WCRGiCvvP2kIfuZlyv48gFX+E3NWSB10Q1ABEBAAG0IGx1aWdpMTExMSA8bHVp 10 | Z2kxMTExd0BnbWFpbC5jb20+iQE4BBMBAgAiBQJXaHXOAhsDBgsJCAcDAgYVCAIJ 11 | CgsEFgIDAQIeAQIXgAAKCRD0rKAYNkHgEAyoB/9agBv/xdNUgTVheW/O6kWG4DYG 12 | /1mMfuTF1xi8CSFbUID3dRhnjXtncuSCaY7030CSLtnC/Pl8MnKHmcBZcoCiARzI 13 | bNFK4dEdJjDU8yiqD+M0IAe58xCYQ7I/RX5TXJJ+WTS3lwi1zBqf9D4XVTQxSm+u 14 | 3tVH5mUu35pRWVCg1OSwWo1IGkSDkeGq8ySdYUJdM535caKf8L1ICNir1H7pWNCa 15 | Jya/b3PRtSefw4tNHcsFtndl4S52iMdXwNUdwRKTP/hDa9KYxQqTGDtJ6nKjTy6p 16 | dgZxAiF2mL9dVYg6c+GHlrtZMUZd5NQZcIwu9jXzAiQKZMmtL6/RauzXRuz9uQEN 17 | BFdodc4BCADACy78WJBKCR4MrUcy4L0G4P5n+cqao2Lf+oc53xJudhcgufowsvzs 18 | nixKG9HC+6SoZCZwKYfglu0JxjvqpZC5U9nCwIWuf52Qu4pDO4xYTeuhVr+Lcjvg 19 | tqtJf5M9QaVJwAz8jTKaEAWUSXuKnljVC76zU8LTprYrTEdOyHO9E6Z94MrBUwS3 20 | 6IVNlJ+q5wZyoj9noWbm7X0SIRER9/shr/UlfkSx0Kpnyj3ludkdg7TQR7jp9rGy 21 | GqRmOKH3eGv2aFO1fo+RDacn+R9Fh1vHIdUX6FZil+yft9lXg5jtxcNXvhIJtsoC 22 | NuVIWEYaQuzSFqtblTrM6IwJ8HrimEBPABEBAAGJAR8EGAECAAkFAldodc4CGwwA 23 | CgkQ9KygGDZB4BBnEAf+OSvWLNJs0VtKRIO5oHP7Ia6oS8v0IyXFLx2/p/JW7jMR 24 | 3LVor2wvao52omW+JzoIj4J8cnaEEt2ptHpmzZApSQydZhHO+108hPDYbeWPrXa8 25 | aSXCtI++s2occAemsMvgrnzI7yuMFaAwOWOYL5bmR5pJnnuQQUj1vfXkqBEYYFyF 26 | u7dvJ3hLHLbxBFvIbDBMfzev+g6wOGkhT2/7osUACoLwTwzkbXZNSoQHiZ72YA/P 27 | 9f3SA5Zc5hGopft96sAAnzk6sm/xCfFO1uj6Yk/H/fd/ZjVzQW+XBUvwM/jIqpuX 28 | Ftwy4Ulp0YZT5BpXkHDhosL6o4GelJULMbxreh7nNQ== 29 | =j0V6 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /utils/gpg_keys/mikezackles.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2 3 | 4 | mQENBFOZuBcBCAC58b89hQieAu57Krj7jqBQkBUdm2tDbwOoCVJK9jBBvzrxlBsc 5 | yCMTnl7Vs3oAyQ79fnNi88lH9mwUHbAzt6QlkVPQOwDu2DMTUPDAd9b1Op2nf1g3 6 | a5MtPc2R2NDyAWbZTVk/tvode9/SgKU0vmurTuKtWOxkkNLiad2milVay3o1AfM6 7 | HbaZsnP//lx3lubkfM93sgoqsBRSXtT8BGifFKWJ6jIkm5yqVmqETDfxY+gfIs3P 8 | XMJnpXxg/WGUwRO9lfAT8YLfqzIh1BhqqNoxFI2RHTiIYHXVYJ9u4xjYUTM8F+lc 9 | /PhIouuXgPS9HCiWTzog0JsAHM4mfHZ4GyRxABEBAAG0KFphY2hhcnkgTWljaGFl 10 | bHMgPG1pa2V6YWNrbGVzQGdtYWlsLmNvbT6JATkEEwECACMFAlOZuBcCGwMHCwkI 11 | BwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBAHd9kV5Gk0WgVB/4qLz4IhZqzR720 12 | /JIyj3Fpxkn5TCzAupaWMRz8oCL6ASBN+56FofVxh7Mua7Cxm9oHmnC5AjU788j6 13 | ATE8wV+DzPrl+YfcCnY1FLvkZ31US9XIpmA8V3/fUlrYOGS5HSoWvsy5mt9OX5sR 14 | P4gn35bY5cJbNSc9yz86YjLkzaXVGZ6o/qIKatdgMWRqAdYKA0ALu1dptjF026xG 15 | yTkjqK3RhwBMPVTTpreTuc0OpHWBjT0POmFnQkK7rRcIU4B7+9oPiRgfuCRzEzPP 16 | 4nfuj+rczyZ3Hl07P1055Pk1q4LZ3knJzSRxw6FLw39Zby+eC252Eq7yWllWvSSD 17 | sNb611WBuQENBFOZuBcBCADcpyVCOX72KkMdJckMpYw5TSofbqXL0N0UAIrMk+pP 18 | rfvNQsJWiQATJLeMEoucUPaWYZ9Ysw97I9wGQovSUAMe/7/FJDllahvEDHfQp+oq 19 | PEjK+UA0xoA5fCn9rdpha8va9kSsHTISdhjwwpojxHP4b6zCYJlmuq3teidtNbTv 20 | c/M3aCWwJfKsK8Hk9H9fPZEoAcFrfzqspKyQi0a0RFm5/VSa6njxwZcjrRRSoJ9I 21 | uDAtuXl9avkD7LgmcSfnBdj+iCdUQ/YL/ZFHdaxdAouMfiotUOVoBCBaO4gYvIHk 22 | nMw5ArB21Vw1gAks1vHz480SYta5KrxUavQcYUmstvG/ABEBAAGJAR8EGAECAAkF 23 | AlOZuBcCGwwACgkQQB3fZFeRpNHlfAf/UryZMEhuOfcGjBca42dYZaTMjmOknZqq 24 | A2W5lG3PDaciEeWb94gFa3clhuS+AFL07+O69q3YHM2qRI4G6CBIKA20ezv2xLeP 25 | 11bnKEORIoYauJ63UN7wAJ1U1UHP7R6X0EUuV+uZTxt+RLiSgar/SvfYhUrXKZ8b 26 | lCCsY3KQYm644QEesfTHsj3r/nQfM2sha4ZG9P7n5NAAlDwF3PfsB6fzc24uAGfm 27 | H2DUvymFODHSVkobityf87k4nk/yNYR/D7CkvjcPYfGawzHzpO2l+zKnGxJaim2u 28 | oqi0vJkk1ySytkX5DxanbnqLO/jLONrEZGpdFbO0710+tM4/7ScaXg== 29 | =WtIs 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /utils/gpg_keys/selsta.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mQENBFm9eloBCADTleexxIK3ZuFYh/Izk0NecT5emXjsX0pW3iHqQhPTjh3672NH 4 | KdZfixPW1BEPDOif5mEqK/macdD0E8F4OQp69poYsRVq34hnJAw45EZzpiEbRpPB 5 | wX92j/ms9UVHlJaywzkmHJSlYyHPKs3dE8U+Z1x/iFIVbOFcLNHMTmqJJp2POu7l 6 | FnOokbI5/j1IJ3vpOjJwJXOR+jDvr4WuTtfH2ur+7tc1AIZYn13LBe+RP08cd46y 7 | NnsNCQzJUPP6BW6kJbF4KOcL2rXwYR6ahmp9YGBJk88eucoHUFrsnXdMkNHM+FHf 8 | R2DfFXbzDDX+ij1D0K45Ht8e4esa/m/FxwndABEBAAG0F3NlbHN0YSA8c2Vsc3Rh 9 | QHNlbnQuYXQ+iQE5BBMBCAAjBQJZvXpaAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwEC 10 | HgECF4AACgkQLqCpmosHrl5mkwgAkrRh1OtCscIYvg6K40FUO1k650orlwWiMA7Y 11 | PDsB3j2J8VNaGjZouoi9u2fFoHvktMJXXdfBqrL3t3dKuPaLLzzTIi0JHNVwgWTN 12 | TQL0r9RJjAH3d3YkN/muMOmOyeeuAaCHcjXRm9yf2AzJeB3vvJBUw1NMgaXAA6Xy 13 | RsLfroIqYeiR/T7K4y0LT/lnwxBPY7IYcoh3kW01d8s+XF31iEJserr0DgzaV7L5 14 | ZOoo1bnLlVByD+BBjoUD7YE8noqnoBvnvJsmFCyw/gYVWzITE8/X9J8bUUoHkKAf 15 | zwpm9+bdtPSKyegOvrP1/99k0ZP7JKc5sVnfKlnyQhCmv6+vPbkBDQRZvXpaAQgA 16 | yr7q8ncKaO31Mvso8+W3NZKZ28oEcNVwDDQRc5xLa5MHRInfcL1qYtvuqQmOS6/n 17 | VnatwgiJ2pt02BW4UvvOYXPSLp0s9X4mEAzsoFA5fl9cfm1c6ZG8VT3KNxlFJ/dm 18 | adfPMt6k8UFoaTbb9NE0da7aRhTA2AYuGBV9GGY3Cx3fIOwiL2q5NP18bjADs4kP 19 | WUVyvCqL2nN6lAmZQ1URSA5Glt2TJ9NYq35vuvG0cKQCZNE1KUzdlE6ziFooXbsP 20 | PYiShbmWvJULv3z7cMshixlwaw1L8SpMOgZX8v0aOiOQ710Zsh4Sifi+TKfTZCZP 21 | wSqpZip90uug+23b7f0DhQARAQABiQEfBBgBCAAJBQJZvXpaAhsMAAoJEC6gqZqL 22 | B65esUoH/RRjemDXAhvBcbhJ3lW6yrbqIRdx30HNvJJVSKTO/fXI4gIhDvVXSyST 23 | FKdi2A+ou3zAMK1aoKhTRgfiN2mnewhUCNSf+h1LnqftuNTFailTkCBt39zuWGgm 24 | w7iOQHtChoDTiJg+xOVORPM4dBux4vSkn5cR2iM6lqO1/DDsmtyJO/qp/96w718G 25 | zimyv9guozIQL5zKx0nPYZX0KkjL+YASzs7B/TDBoOM1TmZebFjq2Qo9p0j6KEcW 26 | BIHG5nWvSrL3wh/R7Gqz4xmSj813j490VFD9lbnpd3mtSFcSEDMU/gKUJTfQUTa6 27 | eBKV2HdP0+B7yK2BNXlyn1qzkMCYtXc= 28 | =fe0h 29 | -----END PGP PUBLIC KEY BLOCK----- 30 | -------------------------------------------------------------------------------- /utils/gpg_keys/tewinget.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1 3 | 4 | mQENBFQZzOoBCACidWQPdZTfNsJqQs7mTJQSH6IHlaZuDuFFXvnnD5c+FEdHInib 5 | a3BgISAsZ9k54F+duJbel8GLJSu+/DfdFVkdLoIRIpiVTicvrQkh/a4cm+5Zmg/Z 6 | R4Syo4VQFJK52CVu0nGFWISYVSoXalEbSna9AjoLPJ/ZSCyhTw1+LvjH6te5hoQP 7 | VGuDj7ZxbQX5I1qT4QtuGxKRqSGf/ISSyWmbVjzarPv3Mzqqvza26cxksnvxVmib 8 | o6ITmbp51ZncLyw/QRwQIdl28C4He6/CQgWZccuOVbO2T9aCT5toSkoyG8wYbBTH 9 | AnV/IxogjFkLZIaq4HXjEvhJsMfSsNDftwl7ABEBAAG0O1Rob21hcyBXaW5nZXQg 10 | KFNpZ25pbmcga2V5IGZvciBNb25lcm8pIDx0ZXdpbmdldEBnbWFpbC5jb20+iQE4 11 | BBMBAgAiBQJUGczqAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBYExoW 12 | B4nmMOTaB/952ZSgf0FdOeUNma2gI9Ipz5tFk73fvvVQ5YXZASIroAVWDJ7e6jTk 13 | ESrrubrQnuiVSj5GHjPfqyWEcA0EJ2OKtKi3f1sM0j+aBsR1yfyC9tuWJvIC1E60 14 | 4BTXXlK1q3tMXhnxBvrqOnNiuLouxWdx6q+R17xu3kguPkXrsrl8ZDEjUl9JaoXi 15 | OKlmCmujB2IVCf5If44ZoRANoF6MdvlBq5TZv1p2etzz+sJ8cWrcalRlUdA8DcdJ 16 | ENfsqndAsm8ID8fYokiCr49jE1QSypWElE65JDsVgX6Yjzz98BYy/9s15YbE5McG 17 | Wvg1RzElvwv588XbqxJhEhDZTQW8Dx0z 18 | =3FSH 19 | -----END PGP PUBLIC KEY BLOCK----- 20 | -------------------------------------------------------------------------------- /utils/gpg_keys/tomerkon.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1 3 | 4 | mQENBFQi1rkBCAC/hoa6yhCpPG3tZINuGBbY/dJWIlKECJ/3dgDN/LMumHqEH91X 5 | goS6Ulw0R+fwDWna/bYMWHNbw9mBujHfaZDBCmMzfbcMgAt1jC/+rnd39rNPcvh+ 6 | 4gpRx6Wt20hxqtkNAnND+5ce9t4RA9wXjZA2/M5R9EYXX/Xna0Z6tWkB51aKkxm4 7 | N5Wz6PmUjScmhCd1IP7P/yDv6Aen6M8Lu8ogCfui1C3a6Cel8MevfkC9fGCkMvoq 8 | 3v5NhEVop8Q8Am4Ts+DOcDNXSp8GPUlhyBy1cK7NelxLADM+TFtkPapEJZedW1KR 9 | +V/nn3L1pKoT2XJAWWi0VXwpLIwrYQJuqrK1ABEBAAG0IXRvbWVyIGtvbmZvcnR5 10 | IDx0b21lcmtAa29uNDAuY29tPokBOAQTAQIAIgUCVCLWuQIbAwYLCQgHAwIGFQgC 11 | CQoLBBYCAwECHgECF4AACgkQlqdxPzlO6quNRQgAratbsWbgSphSaBgLHrRYpO2D 12 | 8TWsK5Qy9ZxGVud2ynmXKcUZukqWRyw9+X22wpNTCeZNHI7srGohF7SeyfIemSx9 13 | 7OfN6Tu2hxz1zi1lq7hMnCNoI9UQSdZaGDm+loI07OnMHugit7ojn9lcW3CKUYzP 14 | AfTc1IAV5ZQpwPmPN0yf6SKnFIkD3X9SZRWhGeoUOZKr2KEMvBpNWoFfee91cCR2 15 | eTiTkaIE8P6Cfdv6rdlQFNqsj7TuBq6Zfru1DtUOdHYs089KR0av81W+U2RpGXc2 16 | AfOmn4kzVffZXdh6D/i4oTg8D6YcVvOZzVtAJVshayYSjD09kjNw+uKAO0nyebkB 17 | DQRUIta5AQgA23KCSdFdnvTJK+kOcMD/99zZz1XMcqpjBc2aP8+zdilC6XjZDjcg 18 | 8+NSdOCYCCHeO80Zd16yynrjvUW4D+PnaM3thdoigYJjEelx7wJls7C4U8hKfcFs 19 | U3YhZEKm2vXqomgrpCT5NExHcOjzi5yMUQ7ocUct79jui0XRhzkmj0vu67rSRWpT 20 | fSpvBwrhCUnC71aNy2QgbadxziLw2Gm983cpdO/wd3wnoz3JTXAYntJOg+7Q8VDg 21 | fiYesuPpCiAJLKZ3z/b5kQXMnK82Oi8H5FTFb10OEDhbgyIqABWOXmds2Uj211ux 22 | Ui5IIH4AScKvo+iKRbgWCs1kCkXQaD9OvQARAQABiQEfBBgBAgAJBQJUIta5AhsM 23 | AAoJEJancT85TuqrSCwH/Rpnp+35opS9b1MvfhUBuJAjIPy9tVwMuz4+NyUfh+g6 24 | M3ksbtGbzZ8EWZi3KJ3iQVdcwvzzMYZxFPXeLmH/FLu37uFtLTlBg7SDEzoHV6dE 25 | /dvGtYRFM7/QdCu9rrWt7zaEDjH7UnasGoZ6mY/v78UK7Q506w7fG8rtMFFupq7D 26 | rWfuA8Dbq31FJ0hdbkezGEF55+jsRwIqmVGHaNvdTm+GyiFibwkc7p6+ynBco8xv 27 | zr98VSNx5fM50XBc+pzhAHxzxhIgrmwx5zsQxMmd8pAh4deZUKIyk40XKrwikjoy 28 | KLjUdEc73bEjhr1rlVGj6tBVNspHVx5XbUvmDtD1s7E= 29 | =EaRm 30 | -----END PGP PUBLIC KEY BLOCK----- 31 | -------------------------------------------------------------------------------- /utils/python-rpc/console: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | env python -i $(dirname $0)/console.py "$@" 4 | -------------------------------------------------------------------------------- /utils/python-rpc/framework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monero-project/monero/125622d5bdc42cf552be5c25009bd9ab52c0a7ca/utils/python-rpc/framework/__init__.py -------------------------------------------------------------------------------- /utils/systemd/monerod.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Monero Full Node 3 | After=network-online.target 4 | 5 | [Service] 6 | User=monero 7 | Group=monero 8 | WorkingDirectory=~ 9 | StateDirectory=monero 10 | LogsDirectory=monero 11 | 12 | Type=simple 13 | ExecStart=/usr/bin/monerod --config-file /etc/monerod.conf --non-interactive 14 | StandardOutput=null 15 | StandardError=null 16 | 17 | Restart=always 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /utils/translations/build-translations.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | lrelease=`which lrelease 2> /dev/null` 4 | if test -z "$lrelease" 5 | then 6 | lrelease=`which lrelease-qt4 2> /dev/null` 7 | fi 8 | if test -z "$lrelease" 9 | then 10 | lrelease=`which lrelease-qt5 2> /dev/null` 11 | fi 12 | if test -z "$lrelease" 13 | then 14 | echo "lrelease not found" 15 | exit 1 16 | fi 17 | 18 | echo "using $lrelease" 19 | if test -f translations/ready 20 | then 21 | languages="" 22 | for language in $(cat translations/ready) 23 | do 24 | languages="$languages translations/monero_$language.ts" 25 | done 26 | else 27 | languages="translations/*.ts" 28 | fi 29 | "$lrelease" $languages 30 | 31 | -------------------------------------------------------------------------------- /utils/translations/update-translations.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | lupdate=`which lupdate 2> /dev/null` 4 | if test -z "$lupdate" 5 | then 6 | lupdate=`which lupdate-qt4 2> /dev/null` 7 | fi 8 | if test -z "$lupdate" 9 | then 10 | echo "lupdate not found" 11 | exit 1 12 | fi 13 | 14 | echo "using $lupdate" 15 | "$lupdate" `find src -name \*.cpp` -ts translations/*.ts -no-obsolete 16 | 17 | --------------------------------------------------------------------------------