From 1ea98d457f1dc7abdd71a46640d520435184aafd Mon Sep 17 00:00:00 2001 From: ProjectInterzone Date: Sun, 10 Sep 2017 08:26:51 -0600 Subject: [PATCH] Interzone 1.4 w/Masternode Adjustments --- COPYING | 0 INSTALL | 0 Makefile.am | 0 configure.ac | 45 +- contrib/README.md | 0 contrib/bitcoind.bash-completion | 0 contrib/bitrpc/README.md | 0 contrib/bitrpc/bitrpc.py | 0 contrib/chc_seeder/README.md | 1 - contrib/chc_seeder/dns_server.py | 178 - contrib/chc_seeder/mn_rand_ips.py | 31 - contrib/chc_seeder/setup.sh | 4 - contrib/contrib.pro | 29 - contrib/dash-qt.pro | 82 +- contrib/debian/README.md | 0 contrib/debian/changelog | 0 contrib/debian/compat | 0 contrib/debian/control | 0 contrib/debian/copyright | 0 contrib/debian/dash-qt.desktop | 0 contrib/debian/dash-qt.install | 0 contrib/debian/dash-qt.lintian-overrides | 0 contrib/debian/dash-qt.protocol | 0 contrib/debian/dashd.bash-completion | 0 contrib/debian/dashd.examples | 0 contrib/debian/dashd.install | 0 contrib/debian/dashd.lintian-overrides | 0 contrib/debian/dashd.manpages | 0 contrib/debian/examples/dash.conf | 0 contrib/debian/gbp.conf | 0 contrib/debian/manpages/dash-qt.1 | 0 contrib/debian/manpages/dash.conf.5 | 0 contrib/debian/manpages/dashd.1 | 0 contrib/debian/patches/README | 0 contrib/debian/patches/series | 0 contrib/debian/source/format | 0 contrib/debian/watch | 0 contrib/devtools/README.md | 0 contrib/gitian-descriptors/README.md | 0 contrib/gitian-descriptors/boost-linux.yml | 0 contrib/gitian-descriptors/boost-win.yml | 0 contrib/gitian-descriptors/deps-linux.yml | 0 contrib/gitian-descriptors/deps-win.yml | 0 .../gitian-descriptors/gitian-osx-depends.yml | 0 .../gitian-descriptors/gitian-osx-native.yml | 0 contrib/gitian-descriptors/gitian-osx-qt.yml | 0 contrib/gitian-descriptors/protobuf-win.yml | 0 contrib/gitian-descriptors/qt-linux.yml | 0 contrib/gitian-descriptors/qt-win.yml | 0 contrib/gitian-downloader/aschildbach-key.pgp | Bin contrib/gitian-downloader/bluematt-key.pgp | Bin contrib/gitian-downloader/devrandom-key.pgp | Bin .../gitian-downloader/gavinandresen-key.pgp | Bin contrib/gitian-downloader/laanwj-key.pgp | 0 .../gitian-downloader/linux-download-config | 0 contrib/gitian-downloader/luke-jr-key.pgp | Bin contrib/gitian-downloader/michagogo-key.pgp | 0 contrib/gitian-downloader/sipa-key.pgp | Bin contrib/gitian-downloader/tcatm-key.pgp | Bin .../gitian-downloader/win32-download-config | 0 contrib/gitian-downloader/wtogami-key.pgp | 0 contrib/linearize/README.md | 0 contrib/linearize/example-linearize.cfg | 0 contrib/linearize/linearize.py | 0 contrib/macdeploy/DS_Store | Bin contrib/macdeploy/LICENSE | 0 contrib/macdeploy/README.md | 0 contrib/macdeploy/background.psd | Bin contrib/macdeploy/fancy.plist | 0 contrib/pyminer/README.md | 0 contrib/pyminer/example-config.cfg | 0 contrib/qos/README.md | 0 contrib/qos/tc.sh | 0 contrib/seeds/README.md | 0 contrib/spendfrom/README.md | 0 contrib/spendfrom/setup.py | 0 contrib/test-patches/README.md | 0 contrib/testgen/README.md | 0 contrib/testgen/base58.py | 0 contrib/ui_aboutdialog.h | 151 - contrib/ui_addressbookpage.h | 157 - contrib/ui_askpassphrasedialog.h | 155 - contrib/ui_coincontroldialog.h | 356 -- contrib/ui_darksendconfig.h | 119 - contrib/ui_editaddressdialog.h | 111 - contrib/ui_helpmessagedialog.h | 117 - contrib/ui_intro.h | 201 -- contrib/ui_loggerpage.h | 58 - contrib/ui_masternodelist.h | 304 -- contrib/ui_openuridialog.h | 110 - contrib/ui_optionsdialog.h | 681 ---- contrib/ui_overviewpage.h | 554 --- contrib/ui_receivecoinsdialog.h | 308 -- contrib/ui_receiverequestdialog.h | 134 - contrib/ui_rpcconsole.h | 922 ----- contrib/ui_sendcoinsdialog.h | 552 --- contrib/ui_sendcoinsentry.h | 484 --- contrib/ui_signverifymessagedialog.h | 346 -- contrib/ui_transactiondescdialog.h | 75 - contrib/verifysfbinaries/README.md | 0 depends/.gitignore | 0 depends/README | 0 depends/README.packages | 0 depends/README.usage | 0 depends/builders/darwin.mk | 0 depends/builders/default.mk | 0 depends/builders/linux.mk | 0 depends/config.site.in | 0 depends/funcs.mk | 0 depends/hosts/darwin.mk | 0 depends/hosts/default.mk | 0 depends/hosts/linux.mk | 0 depends/hosts/mingw32.mk | 0 depends/packages/bdb.mk | 0 depends/packages/boost.mk | 0 depends/packages/dbus.mk | 0 depends/packages/expat.mk | 0 depends/packages/fontconfig.mk | 0 depends/packages/freetype.mk | 0 depends/packages/libICE.mk | 0 depends/packages/libSM.mk | 0 depends/packages/libX11.mk | 0 depends/packages/libXau.mk | 0 depends/packages/libXext.mk | 0 depends/packages/libxcb.mk | 0 depends/packages/miniupnpc.mk | 0 depends/packages/native_ccache.mk | 0 depends/packages/native_cctools.mk | 0 depends/packages/native_cdrkit.mk | 0 depends/packages/native_comparisontool.mk | 0 depends/packages/native_libdmg-hfsplus.mk | 0 depends/packages/native_libuuid.mk | 0 depends/packages/native_openssl.mk | 0 depends/packages/native_protobuf.mk | 0 depends/packages/openssl.mk | 0 depends/packages/packages.mk | 0 depends/packages/protobuf.mk | 0 depends/packages/qrencode.mk | 0 depends/packages/qt.mk | 0 depends/packages/qt46.mk | 0 depends/packages/xcb_proto.mk | 0 depends/packages/xextproto.mk | 0 depends/packages/xproto.mk | 0 depends/packages/xtrans.mk | 0 depends/patches/qt/mac-qmake.conf | 0 pkg.m4 | 0 qa/rpc-tests/.gitignore | 0 qa/rpc-tests/README.md | 0 .../python-bitcoinrpc/bitcoinrpc/.gitignore | 0 .../python-bitcoinrpc/bitcoinrpc/__init__.py | 0 .../python-bitcoinrpc/bitcoinrpc/authproxy.py | 0 qa/rpc-tests/python-bitcoinrpc/setup.py | 0 qa/rpc-tests/util.py | 0 qa/rpc-tests/util.sh | 0 share/certs/BitcoinFoundation_Apple_Cert.pem | 0 share/certs/BitcoinFoundation_Comodo_Cert.pem | 0 share/certs/PrivateKeyNotes.md | 0 share/pixmaps/addressbook16.bmp | Bin share/pixmaps/addressbook16mask.bmp | Bin share/pixmaps/addressbook20.bmp | Bin share/pixmaps/addressbook20mask.bmp | Bin share/pixmaps/bitcoin-bc.ico | Bin share/pixmaps/bitcoin.ico | Bin share/pixmaps/bitcoin128.png | Bin share/pixmaps/bitcoin16.png | Bin share/pixmaps/bitcoin256.png | Bin share/pixmaps/bitcoin32.png | Bin share/pixmaps/bitcoin64.png | Bin share/pixmaps/check.ico | Bin share/pixmaps/dash128.png | Bin share/pixmaps/favicon.ico | Bin share/pixmaps/nsis-header.bmp | Bin share/pixmaps/nsis-wizard.bmp | Bin share/pixmaps/send16.bmp | Bin share/pixmaps/send16mask.bmp | Bin share/pixmaps/send16masknoshadow.bmp | Bin share/pixmaps/send20.bmp | Bin share/pixmaps/send20mask.bmp | Bin share/qt/Info.plist.in | 0 share/qt/img/reload.png | Bin share/qt/img/reload.xcf | Bin share/qt/protobuf.pri | 0 share/setup.nsi.in | 0 share/ui.rc | 0 src/COPYING | 0 src/INSTALL | 0 src/Makefile.am | 12 +- src/Makefile.include | 0 src/README.md | 4 +- src/activemasternode.cpp | 23 +- src/activemasternode.h | 0 src/addrman.cpp | 0 src/addrman.h | 0 src/aes_helper.c | 0 src/alert.cpp | 0 src/alert.h | 0 src/allocators.cpp | 0 src/allocators.h | 0 src/base58.cpp | 10 +- src/base58.h | 0 src/bignum.h | 0 src/blake.c | 0 src/bloom.cpp | 0 src/bloom.h | 0 src/bmw.c | 0 src/build-aux/compile | 347 -- src/build-aux/config.guess | 1421 -------- src/build-aux/config.sub | 1807 ---------- src/build-aux/depcomp | 791 ----- src/build-aux/install-sh | 501 --- src/build-aux/missing | 215 -- src/build-aux/test-driver | 148 - src/chainparams.cpp | 48 +- src/chainparams.h | 8 +- src/checkpoints.cpp | 11 +- src/checkpoints.h | 0 src/checkqueue.h | 0 src/clientversion.h | 8 +- src/coincontrol.h | 0 src/coins.cpp | 0 src/coins.h | 0 src/common.h | 103 - src/compat.h | 0 src/compat/byteswap.h | 66 - src/compat/endian.h | 196 -- src/compat/glibc_compat.cpp | 0 src/compat/glibcxx_compat.cpp | 0 src/configure.ac | 8 +- src/contrib/README.md | 0 src/contrib/bitcoind.bash-completion | 0 src/contrib/bitrpc/README.md | 0 src/contrib/bitrpc/bitrpc.py | 0 src/contrib/dash-qt.pro | 0 src/contrib/debian/README.md | 0 src/contrib/debian/changelog | 0 src/contrib/debian/compat | 0 src/contrib/debian/control | 0 src/contrib/debian/copyright | 0 src/contrib/debian/dash-qt.desktop | 0 src/contrib/debian/dash-qt.install | 0 src/contrib/debian/dash-qt.lintian-overrides | 0 src/contrib/debian/dash-qt.protocol | 0 src/contrib/debian/dashd.bash-completion | 0 src/contrib/debian/dashd.examples | 0 src/contrib/debian/dashd.install | 0 src/contrib/debian/dashd.lintian-overrides | 0 src/contrib/debian/dashd.manpages | 0 src/contrib/debian/examples/dash.conf | 0 src/contrib/debian/gbp.conf | 0 src/contrib/debian/manpages/dash-qt.1 | 0 src/contrib/debian/manpages/dash.conf.5 | 0 src/contrib/debian/manpages/dashd.1 | 0 src/contrib/debian/patches/README | 0 src/contrib/debian/patches/series | 0 src/contrib/debian/source/format | 0 src/contrib/debian/watch | 0 src/contrib/devtools/README.md | 0 src/contrib/gitian-descriptors/README.md | 0 .../gitian-descriptors/boost-linux.yml | 0 src/contrib/gitian-descriptors/boost-win.yml | 0 src/contrib/gitian-descriptors/deps-linux.yml | 0 src/contrib/gitian-descriptors/deps-win.yml | 0 .../gitian-descriptors/gitian-osx-depends.yml | 0 .../gitian-descriptors/gitian-osx-native.yml | 0 .../gitian-descriptors/gitian-osx-qt.yml | 0 .../gitian-descriptors/protobuf-win.yml | 0 src/contrib/gitian-descriptors/qt-linux.yml | 0 src/contrib/gitian-descriptors/qt-win.yml | 0 .../gitian-downloader/aschildbach-key.pgp | Bin .../gitian-downloader/bluematt-key.pgp | Bin .../gitian-downloader/devrandom-key.pgp | Bin .../gitian-downloader/gavinandresen-key.pgp | Bin src/contrib/gitian-downloader/laanwj-key.pgp | 0 .../gitian-downloader/linux-download-config | 0 src/contrib/gitian-downloader/luke-jr-key.pgp | Bin .../gitian-downloader/michagogo-key.pgp | 0 src/contrib/gitian-downloader/sipa-key.pgp | Bin src/contrib/gitian-downloader/tcatm-key.pgp | Bin .../gitian-downloader/win32-download-config | 0 src/contrib/gitian-downloader/wtogami-key.pgp | 0 src/contrib/linearize/README.md | 0 src/contrib/linearize/example-linearize.cfg | 0 src/contrib/linearize/linearize.py | 0 src/contrib/macdeploy/DS_Store | Bin src/contrib/macdeploy/LICENSE | 0 src/contrib/macdeploy/README.md | 0 src/contrib/macdeploy/background.png | Bin src/contrib/macdeploy/background.psd | Bin src/contrib/macdeploy/fancy.plist | 0 src/contrib/pyminer/README.md | 0 src/contrib/pyminer/example-config.cfg | 0 src/contrib/qos/README.md | 0 src/contrib/qos/tc.sh | 0 src/contrib/seeds/README.md | 0 src/contrib/spendfrom/README.md | 0 src/contrib/spendfrom/setup.py | 0 src/contrib/test-patches/README.md | 0 src/contrib/testgen/README.md | 0 src/contrib/testgen/base58.py | 0 src/contrib/verifysfbinaries/README.md | 0 src/core.cpp | 0 src/core.h | 2 +- src/crypter.cpp | 0 src/crypter.h | 0 src/crypto/aes_helper.c | 392 --- src/crypto/blake.c | 1120 ------ src/crypto/bmw.c | 965 ----- src/crypto/common.h | 103 - src/crypto/cubehash.c | 723 ---- src/crypto/echo.c | 1031 ------ src/crypto/groestl.c | 3123 ----------------- src/crypto/hmac_sha256.cpp | 34 - src/crypto/hmac_sha256.h | 32 - src/crypto/jh.c | 1116 ------ src/crypto/keccak.c | 1824 ---------- src/crypto/luffa.c | 1426 -------- src/crypto/sha256.cpp | 249 -- src/crypto/sha256.h | 34 - src/crypto/shavite.c | 1764 ---------- src/crypto/simd.c | 1799 ---------- src/crypto/skein.c | 1254 ------- src/crypto/sph_blake.h | 327 -- src/crypto/sph_bmw.h | 328 -- src/crypto/sph_cubehash.h | 292 -- src/crypto/sph_echo.h | 320 -- src/crypto/sph_groestl.h | 329 -- src/crypto/sph_jh.h | 298 -- src/crypto/sph_keccak.h | 293 -- src/crypto/sph_luffa.h | 296 -- src/crypto/sph_shavite.h | 314 -- src/crypto/sph_simd.h | 309 -- src/crypto/sph_skein.h | 298 -- src/crypto/sph_types.h | 1976 ----------- src/cubehash.c | 0 src/darksend-relay.cpp | 2 +- src/darksend-relay.h | 0 src/darksend.cpp | 113 +- src/darksend.h | 32 +- src/db.cpp | 0 src/db.h | 0 src/depends/.gitignore | 0 src/depends/README | 0 src/depends/README.packages | 0 src/depends/README.usage | 0 src/depends/builders/darwin.mk | 0 src/depends/builders/default.mk | 0 src/depends/builders/linux.mk | 0 src/depends/config.site.in | 0 src/depends/funcs.mk | 0 src/depends/hosts/darwin.mk | 0 src/depends/hosts/default.mk | 0 src/depends/hosts/linux.mk | 0 src/depends/hosts/mingw32.mk | 0 src/depends/packages/bdb.mk | 0 src/depends/packages/boost.mk | 0 src/depends/packages/dbus.mk | 0 src/depends/packages/expat.mk | 0 src/depends/packages/fontconfig.mk | 0 src/depends/packages/freetype.mk | 0 src/depends/packages/libICE.mk | 0 src/depends/packages/libSM.mk | 0 src/depends/packages/libX11.mk | 0 src/depends/packages/libXau.mk | 0 src/depends/packages/libXext.mk | 0 src/depends/packages/libxcb.mk | 0 src/depends/packages/miniupnpc.mk | 0 src/depends/packages/native_ccache.mk | 0 src/depends/packages/native_cctools.mk | 0 src/depends/packages/native_cdrkit.mk | 0 src/depends/packages/native_comparisontool.mk | 0 src/depends/packages/native_libdmg-hfsplus.mk | 0 src/depends/packages/native_libuuid.mk | 0 src/depends/packages/native_openssl.mk | 0 src/depends/packages/native_protobuf.mk | 0 src/depends/packages/openssl.mk | 0 src/depends/packages/packages.mk | 0 src/depends/packages/protobuf.mk | 0 src/depends/packages/qrencode.mk | 0 src/depends/packages/qt.mk | 0 src/depends/packages/qt46.mk | 0 src/depends/packages/xcb_proto.mk | 0 src/depends/packages/xextproto.mk | 0 src/depends/packages/xproto.mk | 0 src/depends/packages/xtrans.mk | 0 src/depends/patches/qt/mac-qmake.conf | 0 src/doc/Doxyfile | 0 src/doc/README.md | 0 src/doc/README_osx.txt | 0 src/doc/README_windows.txt | 0 src/doc/assets-attribution.md | 0 src/doc/bitcoin_logo_doxygen.png | Bin src/doc/bootstrap.md | 0 src/doc/build-msw.md | 0 src/doc/build-osx.md | 0 src/doc/build-unix.md | 0 src/doc/coding.md | 0 src/doc/files.md | 0 src/doc/gitian-building.md | 0 .../create_vm_file_location_size.png | Bin .../gitian-building/create_vm_hard_drive.png | Bin .../create_vm_hard_drive_file_type.png | Bin src/doc/gitian-building/create_vm_memsize.png | Bin src/doc/gitian-building/create_vm_page1.png | Bin .../create_vm_storage_physical_hard_drive.png | Bin .../debian_install_10_configure_clock.png | Bin .../debian_install_11_partition_disks.png | Bin .../debian_install_12_choose_disk.png | Bin .../debian_install_13_partition_scheme.png | Bin .../debian_install_14_finish.png | Bin .../debian_install_15_write_changes.png | Bin .../debian_install_16_choose_a_mirror.png | Bin .../debian_install_17_choose_a_mirror2.png | Bin .../debian_install_18_proxy_settings.png | Bin .../debian_install_19_software_selection.png | Bin .../debian_install_1_boot_menu.png | Bin .../debian_install_20_install_grub.png | Bin .../debian_install_21_finish_installation.png | Bin .../debian_install_2_select_a_language.png | Bin .../debian_install_3_select_location.png | Bin .../debian_install_4_configure_keyboard.png | Bin ...debian_install_5_configure_the_network.png | Bin .../debian_install_6_domain_name.png | Bin ...debian_install_6a_set_up_root_password.png | Bin .../debian_install_7_set_up_user_fullname.png | Bin .../debian_install_8_set_up_username.png | Bin .../debian_install_9_user_password.png | Bin src/doc/gitian-building/network_settings.png | Bin .../gitian-building/port_forwarding_rules.png | Bin .../gitian-building/select_startup_disk.png | Bin src/doc/guide-startmany.md | 0 src/doc/img/bootstrap1.png | Bin src/doc/img/bootstrap2.png | Bin src/doc/img/bootstrap3.png | Bin src/doc/img/bootstrap4.png | Bin src/doc/img/bootstrap5.png | Bin src/doc/keepass.md | 0 src/doc/masternode_conf.md | 0 src/doc/multiwallet-qt.md | 0 src/doc/release-notes.md | 0 .../bitcoin/release-notes-0.3.12.md | 0 .../bitcoin/release-notes-0.3.13.md | 0 .../bitcoin/release-notes-0.3.14.md | 0 .../bitcoin/release-notes-0.3.15.md | 0 .../bitcoin/release-notes-0.3.16.md | 0 .../bitcoin/release-notes-0.3.17.md | 0 .../bitcoin/release-notes-0.3.18.md | 0 .../bitcoin/release-notes-0.3.19.md | 0 .../bitcoin/release-notes-0.3.20.1.md | 0 .../bitcoin/release-notes-0.3.20.2.md | 0 .../bitcoin/release-notes-0.3.20.md | 0 .../bitcoin/release-notes-0.3.21.md | 0 .../bitcoin/release-notes-0.3.22.md | 0 .../bitcoin/release-notes-0.3.23.md | 0 .../bitcoin/release-notes-0.3.24.md | 0 .../bitcoin/release-notes-0.4.0.md | 0 .../bitcoin/release-notes-0.4.1.md | 0 .../bitcoin/release-notes-0.4.2.md | 0 .../bitcoin/release-notes-0.4.3.md | 0 .../bitcoin/release-notes-0.4.4.md | 0 .../bitcoin/release-notes-0.4.5.md | 0 .../bitcoin/release-notes-0.4.6.md | 0 .../bitcoin/release-notes-0.5.0.md | 0 .../bitcoin/release-notes-0.5.1.md | 0 .../bitcoin/release-notes-0.5.2.md | 0 .../bitcoin/release-notes-0.5.3.md | 0 .../bitcoin/release-notes-0.5.4.md | 0 .../bitcoin/release-notes-0.5.5.md | 0 .../bitcoin/release-notes-0.6.0.md | 0 .../bitcoin/release-notes-0.6.1.md | 0 .../bitcoin/release-notes-0.6.2.md | 0 .../bitcoin/release-notes-0.6.3.md | 0 .../bitcoin/release-notes-0.7.0.md | 0 .../bitcoin/release-notes-0.7.1.md | 0 .../bitcoin/release-notes-0.7.2.md | 0 .../bitcoin/release-notes-0.8.0.md | 0 .../bitcoin/release-notes-0.8.1.md | 0 .../bitcoin/release-notes-0.8.2.md | 0 .../bitcoin/release-notes-0.8.3.md | 0 .../bitcoin/release-notes-0.8.4.md | 0 .../bitcoin/release-notes-0.8.5.md | 0 .../bitcoin/release-notes-0.8.6.md | 0 .../dash/release-notes-0.10.0.md | 0 .../dash/release-notes-0.11.0.md | 0 .../dash/release-notes-0.11.1.md | 0 .../dash/release-notes-0.11.2.md | 0 .../release-notes/dash/release-notes-0.9.0.md | 0 src/doc/release-process.md | 0 src/doc/tor.md | 0 src/doc/translation_process.md | 0 src/doc/unit-tests.md | 0 src/echo.c | 0 src/groestl.c | 0 src/hash.cpp | 0 src/hash.h | 0 src/hmac_sha256.cpp | 34 - src/hmac_sha256.h | 32 - src/init.cpp | 8 - src/instantx.cpp | 0 src/instantx.h | 0 src/interzone-cli-res.rc | 0 src/interzone-cli.cpp | 7 +- src/interzone-config.h | 352 -- src/interzone-config.h.in | 351 -- src/interzoned-res.rc | 0 src/interzoned.cpp | 8 +- src/jh.c | 0 src/json/LICENSE.txt | 0 src/json/json_spirit.h | 0 src/json/json_spirit_error_position.h | 0 src/json/json_spirit_reader.cpp | 0 src/json/json_spirit_reader.h | 0 src/json/json_spirit_reader_template.h | 0 src/json/json_spirit_stream_reader.h | 0 src/json/json_spirit_utils.h | 0 src/json/json_spirit_value.cpp | 0 src/json/json_spirit_value.h | 0 src/json/json_spirit_writer.cpp | 0 src/json/json_spirit_writer.h | 0 src/json/json_spirit_writer_template.h | 0 src/keccak.c | 0 src/keepass.cpp | 0 src/keepass.h | 0 src/key.cpp | 0 src/key.h | 4 +- src/keystore.cpp | 0 src/keystore.h | 0 src/leveldb/.gitignore | 0 src/leveldb/AUTHORS | 0 src/leveldb/LICENSE | 0 src/leveldb/Makefile | 0 src/leveldb/NEWS | 0 src/leveldb/README | 0 src/leveldb/TODO | 0 src/leveldb/WINDOWS.md | 0 src/leveldb/db/autocompact_test.cc | 0 src/leveldb/db/builder.cc | 0 src/leveldb/db/builder.h | 0 src/leveldb/db/c.cc | 0 src/leveldb/db/c_test.c | 0 src/leveldb/db/corruption_test.cc | 0 src/leveldb/db/db_bench.cc | 0 src/leveldb/db/db_impl.cc | 0 src/leveldb/db/db_impl.h | 0 src/leveldb/db/db_iter.cc | 0 src/leveldb/db/db_iter.h | 0 src/leveldb/db/db_test.cc | 0 src/leveldb/db/dbformat.cc | 0 src/leveldb/db/dbformat.h | 0 src/leveldb/db/dbformat_test.cc | 0 src/leveldb/db/filename.cc | 0 src/leveldb/db/filename.h | 0 src/leveldb/db/filename_test.cc | 0 src/leveldb/db/leveldb_main.cc | 0 src/leveldb/db/log_format.h | 0 src/leveldb/db/log_reader.cc | 0 src/leveldb/db/log_reader.h | 0 src/leveldb/db/log_test.cc | 0 src/leveldb/db/log_writer.cc | 0 src/leveldb/db/log_writer.h | 0 src/leveldb/db/memtable.cc | 0 src/leveldb/db/memtable.h | 0 src/leveldb/db/repair.cc | 0 src/leveldb/db/skiplist.h | 0 src/leveldb/db/skiplist_test.cc | 0 src/leveldb/db/snapshot.h | 0 src/leveldb/db/table_cache.cc | 0 src/leveldb/db/table_cache.h | 0 src/leveldb/db/version_edit.cc | 0 src/leveldb/db/version_edit.h | 0 src/leveldb/db/version_edit_test.cc | 0 src/leveldb/db/version_set.cc | 0 src/leveldb/db/version_set.h | 0 src/leveldb/db/version_set_test.cc | 0 src/leveldb/db/write_batch.cc | 0 src/leveldb/db/write_batch_internal.h | 0 src/leveldb/db/write_batch_test.cc | 0 src/leveldb/doc/bench/db_bench_sqlite3.cc | 0 src/leveldb/doc/bench/db_bench_tree_db.cc | 0 src/leveldb/doc/benchmark.html | 0 src/leveldb/doc/doc.css | 0 src/leveldb/doc/impl.html | 0 src/leveldb/doc/index.html | 0 src/leveldb/doc/log_format.txt | 0 src/leveldb/doc/table_format.txt | 0 src/leveldb/helpers/memenv/memenv.cc | 0 src/leveldb/helpers/memenv/memenv.h | 0 src/leveldb/helpers/memenv/memenv_test.cc | 0 src/leveldb/include/leveldb/c.h | 0 src/leveldb/include/leveldb/cache.h | 0 src/leveldb/include/leveldb/comparator.h | 0 src/leveldb/include/leveldb/db.h | 0 src/leveldb/include/leveldb/env.h | 0 src/leveldb/include/leveldb/filter_policy.h | 0 src/leveldb/include/leveldb/iterator.h | 0 src/leveldb/include/leveldb/options.h | 0 src/leveldb/include/leveldb/slice.h | 0 src/leveldb/include/leveldb/status.h | 0 src/leveldb/include/leveldb/table.h | 0 src/leveldb/include/leveldb/table_builder.h | 0 src/leveldb/include/leveldb/write_batch.h | 0 src/leveldb/issues/issue178_test.cc | 0 src/leveldb/issues/issue200_test.cc | 0 src/leveldb/port/README | 0 src/leveldb/port/atomic_pointer.h | 0 src/leveldb/port/port.h | 0 src/leveldb/port/port_example.h | 0 src/leveldb/port/port_posix.cc | 0 src/leveldb/port/port_posix.h | 0 src/leveldb/port/port_win.cc | 0 src/leveldb/port/port_win.h | 0 src/leveldb/port/thread_annotations.h | 0 src/leveldb/port/win/stdint.h | 0 src/leveldb/table/block.cc | 0 src/leveldb/table/block.h | 0 src/leveldb/table/block_builder.cc | 0 src/leveldb/table/block_builder.h | 0 src/leveldb/table/filter_block.cc | 0 src/leveldb/table/filter_block.h | 0 src/leveldb/table/filter_block_test.cc | 0 src/leveldb/table/format.cc | 0 src/leveldb/table/format.h | 0 src/leveldb/table/iterator.cc | 0 src/leveldb/table/iterator_wrapper.h | 0 src/leveldb/table/merger.cc | 0 src/leveldb/table/merger.h | 0 src/leveldb/table/table.cc | 0 src/leveldb/table/table_builder.cc | 0 src/leveldb/table/table_test.cc | 0 src/leveldb/table/two_level_iterator.cc | 0 src/leveldb/table/two_level_iterator.h | 0 src/leveldb/util/arena.cc | 0 src/leveldb/util/arena.h | 0 src/leveldb/util/arena_test.cc | 0 src/leveldb/util/bloom.cc | 0 src/leveldb/util/bloom_test.cc | 0 src/leveldb/util/cache.cc | 0 src/leveldb/util/cache_test.cc | 0 src/leveldb/util/coding.cc | 0 src/leveldb/util/coding.h | 0 src/leveldb/util/coding_test.cc | 0 src/leveldb/util/comparator.cc | 0 src/leveldb/util/crc32c.cc | 0 src/leveldb/util/crc32c.h | 0 src/leveldb/util/crc32c_test.cc | 0 src/leveldb/util/env.cc | 0 src/leveldb/util/env_posix.cc | 0 src/leveldb/util/env_test.cc | 0 src/leveldb/util/env_win.cc | 0 src/leveldb/util/filter_policy.cc | 0 src/leveldb/util/hash.cc | 0 src/leveldb/util/hash.h | 0 src/leveldb/util/histogram.cc | 0 src/leveldb/util/histogram.h | 0 src/leveldb/util/logging.cc | 0 src/leveldb/util/logging.h | 0 src/leveldb/util/mutexlock.h | 0 src/leveldb/util/options.cc | 0 src/leveldb/util/posix_logger.h | 0 src/leveldb/util/random.h | 0 src/leveldb/util/status.cc | 0 src/leveldb/util/testharness.cc | 0 src/leveldb/util/testharness.h | 0 src/leveldb/util/testutil.cc | 0 src/leveldb/util/testutil.h | 0 src/leveldbwrapper.cpp | 0 src/leveldbwrapper.h | 0 src/limitedmap.h | 0 src/luffa.c | 0 src/m4/ax_boost_base.m4 | 0 src/m4/ax_boost_chrono.m4 | 0 src/m4/ax_boost_filesystem.m4 | 0 src/m4/ax_boost_program_options.m4 | 0 src/m4/ax_boost_system.m4 | 0 src/m4/ax_boost_thread.m4 | 0 src/m4/ax_boost_unit_test_framework.m4 | 0 src/m4/ax_check_compile_flag.m4 | 0 src/m4/ax_check_link_flag.m4 | 0 src/m4/ax_check_preproc_flag.m4 | 0 src/m4/ax_pthread.m4 | 0 src/m4/bitcoin_find_bdb48.m4 | 0 src/m4/bitcoin_qt.m4 | 0 src/m4/bitcoin_subdir_to_include.m4 | 0 src/main.cpp | 38 +- src/main.h | 0 src/masternode-pos.cpp | 0 src/masternode-pos.h | 0 src/masternode.cpp | 2 +- src/masternode.h | 2 +- src/masternodeconfig.cpp | 14 +- src/masternodeconfig.h | 0 src/masternodeman.cpp | 53 +- src/masternodeman.h | 2 +- src/miner.cpp | 4 +- src/miner.h | 0 src/mruset.h | 0 src/net.cpp | 72 +- src/net.h | 13 +- src/netbase.cpp | 8 - src/netbase.h | 2 - src/noui.cpp | 0 src/noui.h | 0 src/obj-test/.gitignore | 0 src/obj/.gitignore | 0 src/pkg.m4 | 0 src/prevector.h | 477 --- src/protocol.cpp | 6 +- src/protocol.h | 0 src/qa/rpc-tests/.gitignore | 0 src/qa/rpc-tests/README.md | 0 .../python-bitcoinrpc/bitcoinrpc/.gitignore | 0 .../python-bitcoinrpc/bitcoinrpc/__init__.py | 0 .../python-bitcoinrpc/bitcoinrpc/authproxy.py | 0 src/qa/rpc-tests/python-bitcoinrpc/setup.py | 0 src/qa/rpc-tests/util.py | 0 src/qa/rpc-tests/util.sh | 0 src/qt/Makefile.am | 20 +- src/qt/bantablemodel.cpp | 181 - src/qt/bantablemodel.h | 72 - src/qt/bitcoingui.cpp | 18 - src/qt/bitcoingui.h | 3 - src/qt/bitcoinunits.cpp | 20 +- src/qt/bitcoinunits.h | 2 +- src/qt/clientmodel.cpp | 17 +- src/qt/clientmodel.h | 9 +- src/qt/forms/aboutdialog.ui | 6 +- src/qt/forms/addressbookpage.ui | 10 +- src/qt/forms/coincontroldialog.ui | 2 +- src/qt/forms/darksendconfig.ui | 2 +- src/qt/forms/masternodelist.ui | 324 -- src/qt/forms/optionsdialog.ui | 48 +- src/qt/forms/overviewpage.ui | 8 +- src/qt/forms/rpcconsole.ui | 580 +-- src/qt/forms/sendcoinsdialog.ui | 14 +- src/qt/forms/sendcoinsentry.ui | 12 +- src/qt/forms/signverifymessagedialog.ui | 18 +- src/qt/guiutil.cpp | 56 +- src/qt/guiutil.h | 10 +- src/qt/interzonestrings.cpp | 28 +- src/qt/masternodelist.cpp | 456 --- src/qt/masternodelist.h | 79 - src/qt/optionsdialog.cpp | 12 - src/qt/optionsmodel.cpp | 28 +- src/qt/optionsmodel.h | 3 - src/qt/peertablemodel.cpp | 235 -- src/qt/peertablemodel.h | 81 - src/qt/receivecoinsdialog.cpp | 2 +- src/qt/res/interzone-qt-res.rc | 0 src/qt/res/movies/spinner-000.png | Bin src/qt/res/movies/spinner-001.png | Bin src/qt/res/movies/spinner-002.png | Bin src/qt/res/movies/spinner-003.png | Bin src/qt/res/movies/spinner-004.png | Bin src/qt/res/movies/spinner-005.png | Bin src/qt/res/movies/spinner-006.png | Bin src/qt/res/movies/spinner-007.png | Bin src/qt/res/movies/spinner-008.png | Bin src/qt/res/movies/spinner-009.png | Bin src/qt/res/movies/spinner-010.png | Bin src/qt/res/movies/spinner-011.png | Bin src/qt/res/movies/spinner-012.png | Bin src/qt/res/movies/spinner-013.png | Bin src/qt/res/movies/spinner-014.png | Bin src/qt/res/movies/spinner-015.png | Bin src/qt/res/movies/spinner-016.png | Bin src/qt/res/movies/spinner-017.png | Bin src/qt/res/movies/spinner-018.png | Bin src/qt/res/movies/spinner-019.png | Bin src/qt/res/movies/spinner-020.png | Bin src/qt/res/movies/spinner-021.png | Bin src/qt/res/movies/spinner-022.png | Bin src/qt/res/movies/spinner-023.png | Bin src/qt/res/movies/spinner-024.png | Bin src/qt/res/movies/spinner-025.png | Bin src/qt/res/movies/spinner-026.png | Bin src/qt/res/movies/spinner-027.png | Bin src/qt/res/movies/spinner-028.png | Bin src/qt/res/movies/spinner-029.png | Bin src/qt/res/movies/spinner-030.png | Bin src/qt/res/movies/spinner-031.png | Bin src/qt/res/movies/spinner-032.png | Bin src/qt/res/movies/spinner-033.png | Bin src/qt/res/movies/spinner-034.png | Bin src/qt/res/src/bitcoin.svg | 0 src/qt/res/src/clock1.svg | 0 src/qt/res/src/clock2.svg | 0 src/qt/res/src/clock3.svg | 0 src/qt/res/src/clock4.svg | 0 src/qt/res/src/clock5.svg | 0 src/qt/res/src/clock_green.svg | 0 src/qt/res/src/inout.svg | 0 src/qt/res/src/questionmark.svg | 0 src/qt/rpcconsole.cpp | 370 +- src/qt/rpcconsole.h | 32 +- src/qt/splashscreen.cpp | 4 +- src/qt/test/Makefile.am | 2 +- src/qt/transactionview.cpp | 2 +- src/qt/walletframe.cpp | 7 +- src/qt/walletframe.h | 2 - src/qt/walletview.cpp | 8 - src/qt/walletview.h | 4 - src/random.cpp | 69 - src/random.h | 68 - src/rpcblockchain.cpp | 0 src/rpcclient.cpp | 0 src/rpcclient.h | 0 src/rpcdarksend.cpp | 2 +- src/rpcdump.cpp | 0 src/rpcmining.cpp | 0 src/rpcmisc.cpp | 4 +- src/rpcnet.cpp | 0 src/rpcprotocol.cpp | 0 src/rpcprotocol.h | 0 src/rpcrawtransaction.cpp | 0 src/rpcserver.cpp | 0 src/rpcserver.h | 0 src/rpcwallet.cpp | 0 src/script.cpp | 0 src/script.h | 0 src/script/script.cpp | 2173 ------------ src/script/script.h | 824 ----- src/serialize.h | 29 - src/sha256.cpp | 249 -- src/sha256.h | 34 - .../certs/BitcoinFoundation_Apple_Cert.pem | 0 .../certs/BitcoinFoundation_Comodo_Cert.pem | 0 src/share/certs/PrivateKeyNotes.md | 0 src/share/pixmaps/addressbook16.bmp | Bin src/share/pixmaps/addressbook16mask.bmp | Bin src/share/pixmaps/addressbook20.bmp | Bin src/share/pixmaps/addressbook20mask.bmp | Bin src/share/pixmaps/check.ico | Bin src/share/pixmaps/send16.bmp | Bin src/share/pixmaps/send16mask.bmp | Bin src/share/pixmaps/send16masknoshadow.bmp | Bin src/share/pixmaps/send20.bmp | Bin src/share/pixmaps/send20mask.bmp | Bin src/share/qt/Info.plist | 0 src/share/qt/Info.plist.in | 0 src/share/qt/img/reload.png | Bin src/share/qt/img/reload.xcf | Bin src/share/qt/protobuf.pri | 0 src/share/setup.nsi.in | 0 src/share/ui.rc | 0 src/shavite.c | 0 src/simd.c | 0 src/skein.c | 0 src/sph_blake.h | 0 src/sph_bmw.h | 0 src/sph_cubehash.h | 0 src/sph_echo.h | 0 src/sph_groestl.h | 0 src/sph_jh.h | 0 src/sph_keccak.h | 0 src/sph_luffa.h | 0 src/sph_shavite.h | 0 src/sph_simd.h | 0 src/sph_skein.h | 0 src/sph_types.h | 0 src/spork.cpp | 0 src/spork.h | 0 src/stamp-h1 | 1 - src/support/cleanse.cpp | 13 - src/support/cleanse.h | 13 - src/sync.cpp | 62 +- src/sync.h | 0 src/test/Checkpoints_tests.cpp | 0 src/test/DoS_tests.cpp | 0 src/test/Makefile | 1769 ---------- src/test/Makefile.am | 2 +- src/test/README.md | 0 src/test/accounting_tests.cpp | 0 src/test/alert_tests.cpp | 0 src/test/allocator_tests.cpp | 0 src/test/base32_tests.cpp | 0 src/test/base58_tests.cpp | 0 src/test/base64_tests.cpp | 0 src/test/bignum_tests.cpp | 0 src/test/bip32_tests.cpp | 0 src/test/bloom_tests.cpp | 0 src/test/canonical_tests.cpp | 0 src/test/checkblock_tests.cpp | 0 src/test/compress_tests.cpp | 0 src/test/data/README.md | 0 src/test/data/alertTests.raw | Bin src/test/data/base58_encode_decode.json | 0 src/test/data/base58_keys_invalid.json | 0 src/test/data/base58_keys_valid.json | 0 src/test/data/script_invalid.json | 0 src/test/data/script_valid.json | 0 src/test/data/sig_canonical.json | 0 src/test/data/sig_noncanonical.json | 0 src/test/data/sighash.json | 0 src/test/data/tx_invalid.json | 0 src/test/data/tx_valid.json | 0 src/test/getarg_tests.cpp | 0 src/test/hash_tests.cpp | 0 src/test/hmac_tests.cpp | 0 src/test/key_tests.cpp | 0 src/test/main_tests.cpp | 0 src/test/miner_tests.cpp | 0 src/test/mruset_tests.cpp | 0 src/test/multisig_tests.cpp | 0 src/test/netbase_tests.cpp | 0 src/test/pmt_tests.cpp | 0 src/test/rpc_tests.cpp | 0 src/test/rpc_wallet_tests.cpp | 0 src/test/script_P2SH_tests.cpp | 0 src/test/script_tests.cpp | 0 src/test/scriptnum_tests.cpp | 0 src/test/serialize_tests.cpp | 0 src/test/sighash_tests.cpp | 0 src/test/sigopcount_tests.cpp | 0 src/test/test_darkcoin.cpp | 0 ...{test_chaincoin.cpp => test_interzone.cpp} | 0 src/test/transaction_tests.cpp | 0 src/test/uint256_tests.cpp | 0 src/test/util_tests.cpp | 41 +- src/test/wallet_tests.cpp | 0 src/threadsafety.h | 0 src/tinyformat.h | 0 src/torcontrol.cpp | 707 ---- src/torcontrol.h | 20 - src/txdb.cpp | 0 src/txdb.h | 0 src/txmempool.cpp | 0 src/txmempool.h | 0 src/ui_interface.h | 0 src/uint256.h | 0 src/util.cpp | 102 +- src/util.h | 26 +- src/utilstrencodings.cpp | 663 ---- src/utilstrencodings.h | 89 - src/version.cpp | 7 +- src/version.h | 4 +- src/wallet.cpp | 2 +- src/wallet.h | 6 +- src/walletdb.cpp | 0 src/walletdb.h | 0 938 files changed, 415 insertions(+), 45350 deletions(-) mode change 100644 => 100755 COPYING mode change 100644 => 100755 INSTALL mode change 100644 => 100755 Makefile.am mode change 100644 => 100755 configure.ac mode change 100644 => 100755 contrib/README.md mode change 100644 => 100755 contrib/bitcoind.bash-completion mode change 100644 => 100755 contrib/bitrpc/README.md mode change 100644 => 100755 contrib/bitrpc/bitrpc.py delete mode 100644 contrib/chc_seeder/README.md delete mode 100644 contrib/chc_seeder/dns_server.py delete mode 100644 contrib/chc_seeder/mn_rand_ips.py delete mode 100644 contrib/chc_seeder/setup.sh delete mode 100644 contrib/contrib.pro mode change 100644 => 100755 contrib/dash-qt.pro mode change 100644 => 100755 contrib/debian/README.md mode change 100644 => 100755 contrib/debian/changelog mode change 100644 => 100755 contrib/debian/compat mode change 100644 => 100755 contrib/debian/control mode change 100644 => 100755 contrib/debian/copyright mode change 100644 => 100755 contrib/debian/dash-qt.desktop mode change 100644 => 100755 contrib/debian/dash-qt.install mode change 100644 => 100755 contrib/debian/dash-qt.lintian-overrides mode change 100644 => 100755 contrib/debian/dash-qt.protocol mode change 100644 => 100755 contrib/debian/dashd.bash-completion mode change 100644 => 100755 contrib/debian/dashd.examples mode change 100644 => 100755 contrib/debian/dashd.install mode change 100644 => 100755 contrib/debian/dashd.lintian-overrides mode change 100644 => 100755 contrib/debian/dashd.manpages mode change 100644 => 100755 contrib/debian/examples/dash.conf mode change 100644 => 100755 contrib/debian/gbp.conf mode change 100644 => 100755 contrib/debian/manpages/dash-qt.1 mode change 100644 => 100755 contrib/debian/manpages/dash.conf.5 mode change 100644 => 100755 contrib/debian/manpages/dashd.1 mode change 100644 => 100755 contrib/debian/patches/README mode change 100644 => 100755 contrib/debian/patches/series mode change 100644 => 100755 contrib/debian/source/format mode change 100644 => 100755 contrib/debian/watch mode change 100644 => 100755 contrib/devtools/README.md mode change 100644 => 100755 contrib/gitian-descriptors/README.md mode change 100644 => 100755 contrib/gitian-descriptors/boost-linux.yml mode change 100644 => 100755 contrib/gitian-descriptors/boost-win.yml mode change 100644 => 100755 contrib/gitian-descriptors/deps-linux.yml mode change 100644 => 100755 contrib/gitian-descriptors/deps-win.yml mode change 100644 => 100755 contrib/gitian-descriptors/gitian-osx-depends.yml mode change 100644 => 100755 contrib/gitian-descriptors/gitian-osx-native.yml mode change 100644 => 100755 contrib/gitian-descriptors/gitian-osx-qt.yml mode change 100644 => 100755 contrib/gitian-descriptors/protobuf-win.yml mode change 100644 => 100755 contrib/gitian-descriptors/qt-linux.yml mode change 100644 => 100755 contrib/gitian-descriptors/qt-win.yml mode change 100644 => 100755 contrib/gitian-downloader/aschildbach-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/bluematt-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/devrandom-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/gavinandresen-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/laanwj-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/linux-download-config mode change 100644 => 100755 contrib/gitian-downloader/luke-jr-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/michagogo-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/sipa-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/tcatm-key.pgp mode change 100644 => 100755 contrib/gitian-downloader/win32-download-config mode change 100644 => 100755 contrib/gitian-downloader/wtogami-key.pgp mode change 100644 => 100755 contrib/linearize/README.md mode change 100644 => 100755 contrib/linearize/example-linearize.cfg mode change 100644 => 100755 contrib/linearize/linearize.py mode change 100644 => 100755 contrib/macdeploy/DS_Store mode change 100644 => 100755 contrib/macdeploy/LICENSE mode change 100644 => 100755 contrib/macdeploy/README.md mode change 100644 => 100755 contrib/macdeploy/background.psd mode change 100644 => 100755 contrib/macdeploy/fancy.plist mode change 100644 => 100755 contrib/pyminer/README.md mode change 100644 => 100755 contrib/pyminer/example-config.cfg mode change 100644 => 100755 contrib/qos/README.md mode change 100644 => 100755 contrib/qos/tc.sh mode change 100644 => 100755 contrib/seeds/README.md mode change 100644 => 100755 contrib/spendfrom/README.md mode change 100644 => 100755 contrib/spendfrom/setup.py mode change 100644 => 100755 contrib/test-patches/README.md mode change 100644 => 100755 contrib/testgen/README.md mode change 100644 => 100755 contrib/testgen/base58.py delete mode 100644 contrib/ui_aboutdialog.h delete mode 100644 contrib/ui_addressbookpage.h delete mode 100644 contrib/ui_askpassphrasedialog.h delete mode 100644 contrib/ui_coincontroldialog.h delete mode 100644 contrib/ui_darksendconfig.h delete mode 100644 contrib/ui_editaddressdialog.h delete mode 100644 contrib/ui_helpmessagedialog.h delete mode 100644 contrib/ui_intro.h delete mode 100644 contrib/ui_loggerpage.h delete mode 100644 contrib/ui_masternodelist.h delete mode 100644 contrib/ui_openuridialog.h delete mode 100644 contrib/ui_optionsdialog.h delete mode 100644 contrib/ui_overviewpage.h delete mode 100644 contrib/ui_receivecoinsdialog.h delete mode 100644 contrib/ui_receiverequestdialog.h delete mode 100644 contrib/ui_rpcconsole.h delete mode 100644 contrib/ui_sendcoinsdialog.h delete mode 100644 contrib/ui_sendcoinsentry.h delete mode 100644 contrib/ui_signverifymessagedialog.h delete mode 100644 contrib/ui_transactiondescdialog.h mode change 100644 => 100755 contrib/verifysfbinaries/README.md mode change 100644 => 100755 depends/.gitignore mode change 100644 => 100755 depends/README mode change 100644 => 100755 depends/README.packages mode change 100644 => 100755 depends/README.usage mode change 100644 => 100755 depends/builders/darwin.mk mode change 100644 => 100755 depends/builders/default.mk mode change 100644 => 100755 depends/builders/linux.mk mode change 100644 => 100755 depends/config.site.in mode change 100644 => 100755 depends/funcs.mk mode change 100644 => 100755 depends/hosts/darwin.mk mode change 100644 => 100755 depends/hosts/default.mk mode change 100644 => 100755 depends/hosts/linux.mk mode change 100644 => 100755 depends/hosts/mingw32.mk mode change 100644 => 100755 depends/packages/bdb.mk mode change 100644 => 100755 depends/packages/boost.mk mode change 100644 => 100755 depends/packages/dbus.mk mode change 100644 => 100755 depends/packages/expat.mk mode change 100644 => 100755 depends/packages/fontconfig.mk mode change 100644 => 100755 depends/packages/freetype.mk mode change 100644 => 100755 depends/packages/libICE.mk mode change 100644 => 100755 depends/packages/libSM.mk mode change 100644 => 100755 depends/packages/libX11.mk mode change 100644 => 100755 depends/packages/libXau.mk mode change 100644 => 100755 depends/packages/libXext.mk mode change 100644 => 100755 depends/packages/libxcb.mk mode change 100644 => 100755 depends/packages/miniupnpc.mk mode change 100644 => 100755 depends/packages/native_ccache.mk mode change 100644 => 100755 depends/packages/native_cctools.mk mode change 100644 => 100755 depends/packages/native_cdrkit.mk mode change 100644 => 100755 depends/packages/native_comparisontool.mk mode change 100644 => 100755 depends/packages/native_libdmg-hfsplus.mk mode change 100644 => 100755 depends/packages/native_libuuid.mk mode change 100644 => 100755 depends/packages/native_openssl.mk mode change 100644 => 100755 depends/packages/native_protobuf.mk mode change 100644 => 100755 depends/packages/openssl.mk mode change 100644 => 100755 depends/packages/packages.mk mode change 100644 => 100755 depends/packages/protobuf.mk mode change 100644 => 100755 depends/packages/qrencode.mk mode change 100644 => 100755 depends/packages/qt.mk mode change 100644 => 100755 depends/packages/qt46.mk mode change 100644 => 100755 depends/packages/xcb_proto.mk mode change 100644 => 100755 depends/packages/xextproto.mk mode change 100644 => 100755 depends/packages/xproto.mk mode change 100644 => 100755 depends/packages/xtrans.mk mode change 100644 => 100755 depends/patches/qt/mac-qmake.conf mode change 100644 => 100755 pkg.m4 mode change 100644 => 100755 qa/rpc-tests/.gitignore mode change 100644 => 100755 qa/rpc-tests/README.md mode change 100644 => 100755 qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore mode change 100644 => 100755 qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py mode change 100644 => 100755 qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py mode change 100644 => 100755 qa/rpc-tests/python-bitcoinrpc/setup.py mode change 100644 => 100755 qa/rpc-tests/util.py mode change 100644 => 100755 qa/rpc-tests/util.sh mode change 100644 => 100755 share/certs/BitcoinFoundation_Apple_Cert.pem mode change 100644 => 100755 share/certs/BitcoinFoundation_Comodo_Cert.pem mode change 100644 => 100755 share/certs/PrivateKeyNotes.md mode change 100644 => 100755 share/pixmaps/addressbook16.bmp mode change 100644 => 100755 share/pixmaps/addressbook16mask.bmp mode change 100644 => 100755 share/pixmaps/addressbook20.bmp mode change 100644 => 100755 share/pixmaps/addressbook20mask.bmp mode change 100644 => 100755 share/pixmaps/bitcoin-bc.ico mode change 100644 => 100755 share/pixmaps/bitcoin.ico mode change 100644 => 100755 share/pixmaps/bitcoin128.png mode change 100644 => 100755 share/pixmaps/bitcoin16.png mode change 100644 => 100755 share/pixmaps/bitcoin256.png mode change 100644 => 100755 share/pixmaps/bitcoin32.png mode change 100644 => 100755 share/pixmaps/bitcoin64.png mode change 100644 => 100755 share/pixmaps/check.ico mode change 100644 => 100755 share/pixmaps/dash128.png mode change 100644 => 100755 share/pixmaps/favicon.ico mode change 100644 => 100755 share/pixmaps/nsis-header.bmp mode change 100644 => 100755 share/pixmaps/nsis-wizard.bmp mode change 100644 => 100755 share/pixmaps/send16.bmp mode change 100644 => 100755 share/pixmaps/send16mask.bmp mode change 100644 => 100755 share/pixmaps/send16masknoshadow.bmp mode change 100644 => 100755 share/pixmaps/send20.bmp mode change 100644 => 100755 share/pixmaps/send20mask.bmp mode change 100644 => 100755 share/qt/Info.plist.in mode change 100644 => 100755 share/qt/img/reload.png mode change 100644 => 100755 share/qt/img/reload.xcf mode change 100644 => 100755 share/qt/protobuf.pri mode change 100644 => 100755 share/setup.nsi.in mode change 100644 => 100755 share/ui.rc mode change 100644 => 100755 src/COPYING mode change 100644 => 100755 src/INSTALL mode change 100644 => 100755 src/Makefile.am mode change 100644 => 100755 src/Makefile.include mode change 100644 => 100755 src/README.md mode change 100644 => 100755 src/activemasternode.cpp mode change 100644 => 100755 src/activemasternode.h mode change 100644 => 100755 src/addrman.cpp mode change 100644 => 100755 src/addrman.h mode change 100644 => 100755 src/aes_helper.c mode change 100644 => 100755 src/alert.cpp mode change 100644 => 100755 src/alert.h mode change 100644 => 100755 src/allocators.cpp mode change 100644 => 100755 src/allocators.h mode change 100644 => 100755 src/base58.cpp mode change 100644 => 100755 src/base58.h mode change 100644 => 100755 src/bignum.h mode change 100644 => 100755 src/blake.c mode change 100644 => 100755 src/bloom.cpp mode change 100644 => 100755 src/bloom.h mode change 100644 => 100755 src/bmw.c delete mode 100755 src/build-aux/compile delete mode 100755 src/build-aux/config.guess delete mode 100755 src/build-aux/config.sub delete mode 100755 src/build-aux/depcomp delete mode 100755 src/build-aux/install-sh delete mode 100755 src/build-aux/missing delete mode 100755 src/build-aux/test-driver mode change 100644 => 100755 src/chainparams.cpp mode change 100644 => 100755 src/chainparams.h mode change 100644 => 100755 src/checkpoints.cpp mode change 100644 => 100755 src/checkpoints.h mode change 100644 => 100755 src/checkqueue.h mode change 100644 => 100755 src/clientversion.h mode change 100644 => 100755 src/coincontrol.h mode change 100644 => 100755 src/coins.cpp mode change 100644 => 100755 src/coins.h delete mode 100644 src/common.h mode change 100644 => 100755 src/compat.h delete mode 100644 src/compat/byteswap.h delete mode 100644 src/compat/endian.h mode change 100644 => 100755 src/compat/glibc_compat.cpp mode change 100644 => 100755 src/compat/glibcxx_compat.cpp mode change 100644 => 100755 src/configure.ac mode change 100644 => 100755 src/contrib/README.md mode change 100644 => 100755 src/contrib/bitcoind.bash-completion mode change 100644 => 100755 src/contrib/bitrpc/README.md mode change 100644 => 100755 src/contrib/bitrpc/bitrpc.py mode change 100644 => 100755 src/contrib/dash-qt.pro mode change 100644 => 100755 src/contrib/debian/README.md mode change 100644 => 100755 src/contrib/debian/changelog mode change 100644 => 100755 src/contrib/debian/compat mode change 100644 => 100755 src/contrib/debian/control mode change 100644 => 100755 src/contrib/debian/copyright mode change 100644 => 100755 src/contrib/debian/dash-qt.desktop mode change 100644 => 100755 src/contrib/debian/dash-qt.install mode change 100644 => 100755 src/contrib/debian/dash-qt.lintian-overrides mode change 100644 => 100755 src/contrib/debian/dash-qt.protocol mode change 100644 => 100755 src/contrib/debian/dashd.bash-completion mode change 100644 => 100755 src/contrib/debian/dashd.examples mode change 100644 => 100755 src/contrib/debian/dashd.install mode change 100644 => 100755 src/contrib/debian/dashd.lintian-overrides mode change 100644 => 100755 src/contrib/debian/dashd.manpages mode change 100644 => 100755 src/contrib/debian/examples/dash.conf mode change 100644 => 100755 src/contrib/debian/gbp.conf mode change 100644 => 100755 src/contrib/debian/manpages/dash-qt.1 mode change 100644 => 100755 src/contrib/debian/manpages/dash.conf.5 mode change 100644 => 100755 src/contrib/debian/manpages/dashd.1 mode change 100644 => 100755 src/contrib/debian/patches/README mode change 100644 => 100755 src/contrib/debian/patches/series mode change 100644 => 100755 src/contrib/debian/source/format mode change 100644 => 100755 src/contrib/debian/watch mode change 100644 => 100755 src/contrib/devtools/README.md mode change 100644 => 100755 src/contrib/gitian-descriptors/README.md mode change 100644 => 100755 src/contrib/gitian-descriptors/boost-linux.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/boost-win.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/deps-linux.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/deps-win.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/gitian-osx-depends.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/gitian-osx-native.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/gitian-osx-qt.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/protobuf-win.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/qt-linux.yml mode change 100644 => 100755 src/contrib/gitian-descriptors/qt-win.yml mode change 100644 => 100755 src/contrib/gitian-downloader/aschildbach-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/bluematt-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/devrandom-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/gavinandresen-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/laanwj-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/linux-download-config mode change 100644 => 100755 src/contrib/gitian-downloader/luke-jr-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/michagogo-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/sipa-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/tcatm-key.pgp mode change 100644 => 100755 src/contrib/gitian-downloader/win32-download-config mode change 100644 => 100755 src/contrib/gitian-downloader/wtogami-key.pgp mode change 100644 => 100755 src/contrib/linearize/README.md mode change 100644 => 100755 src/contrib/linearize/example-linearize.cfg mode change 100644 => 100755 src/contrib/linearize/linearize.py mode change 100644 => 100755 src/contrib/macdeploy/DS_Store mode change 100644 => 100755 src/contrib/macdeploy/LICENSE mode change 100644 => 100755 src/contrib/macdeploy/README.md mode change 100644 => 100755 src/contrib/macdeploy/background.png mode change 100644 => 100755 src/contrib/macdeploy/background.psd mode change 100644 => 100755 src/contrib/macdeploy/fancy.plist mode change 100644 => 100755 src/contrib/pyminer/README.md mode change 100644 => 100755 src/contrib/pyminer/example-config.cfg mode change 100644 => 100755 src/contrib/qos/README.md mode change 100644 => 100755 src/contrib/qos/tc.sh mode change 100644 => 100755 src/contrib/seeds/README.md mode change 100644 => 100755 src/contrib/spendfrom/README.md mode change 100644 => 100755 src/contrib/spendfrom/setup.py mode change 100644 => 100755 src/contrib/test-patches/README.md mode change 100644 => 100755 src/contrib/testgen/README.md mode change 100644 => 100755 src/contrib/testgen/base58.py mode change 100644 => 100755 src/contrib/verifysfbinaries/README.md mode change 100644 => 100755 src/core.cpp mode change 100644 => 100755 src/core.h mode change 100644 => 100755 src/crypter.cpp mode change 100644 => 100755 src/crypter.h delete mode 100644 src/crypto/aes_helper.c delete mode 100644 src/crypto/blake.c delete mode 100644 src/crypto/bmw.c delete mode 100644 src/crypto/common.h delete mode 100644 src/crypto/cubehash.c delete mode 100644 src/crypto/echo.c delete mode 100644 src/crypto/groestl.c delete mode 100644 src/crypto/hmac_sha256.cpp delete mode 100644 src/crypto/hmac_sha256.h delete mode 100644 src/crypto/jh.c delete mode 100644 src/crypto/keccak.c delete mode 100644 src/crypto/luffa.c delete mode 100644 src/crypto/sha256.cpp delete mode 100644 src/crypto/sha256.h delete mode 100644 src/crypto/shavite.c delete mode 100644 src/crypto/simd.c delete mode 100644 src/crypto/skein.c delete mode 100644 src/crypto/sph_blake.h delete mode 100644 src/crypto/sph_bmw.h delete mode 100644 src/crypto/sph_cubehash.h delete mode 100644 src/crypto/sph_echo.h delete mode 100644 src/crypto/sph_groestl.h delete mode 100644 src/crypto/sph_jh.h delete mode 100644 src/crypto/sph_keccak.h delete mode 100644 src/crypto/sph_luffa.h delete mode 100644 src/crypto/sph_shavite.h delete mode 100644 src/crypto/sph_simd.h delete mode 100644 src/crypto/sph_skein.h delete mode 100644 src/crypto/sph_types.h mode change 100644 => 100755 src/cubehash.c mode change 100644 => 100755 src/darksend-relay.cpp mode change 100644 => 100755 src/darksend-relay.h mode change 100644 => 100755 src/darksend.cpp mode change 100644 => 100755 src/darksend.h mode change 100644 => 100755 src/db.cpp mode change 100644 => 100755 src/db.h mode change 100644 => 100755 src/depends/.gitignore mode change 100644 => 100755 src/depends/README mode change 100644 => 100755 src/depends/README.packages mode change 100644 => 100755 src/depends/README.usage mode change 100644 => 100755 src/depends/builders/darwin.mk mode change 100644 => 100755 src/depends/builders/default.mk mode change 100644 => 100755 src/depends/builders/linux.mk mode change 100644 => 100755 src/depends/config.site.in mode change 100644 => 100755 src/depends/funcs.mk mode change 100644 => 100755 src/depends/hosts/darwin.mk mode change 100644 => 100755 src/depends/hosts/default.mk mode change 100644 => 100755 src/depends/hosts/linux.mk mode change 100644 => 100755 src/depends/hosts/mingw32.mk mode change 100644 => 100755 src/depends/packages/bdb.mk mode change 100644 => 100755 src/depends/packages/boost.mk mode change 100644 => 100755 src/depends/packages/dbus.mk mode change 100644 => 100755 src/depends/packages/expat.mk mode change 100644 => 100755 src/depends/packages/fontconfig.mk mode change 100644 => 100755 src/depends/packages/freetype.mk mode change 100644 => 100755 src/depends/packages/libICE.mk mode change 100644 => 100755 src/depends/packages/libSM.mk mode change 100644 => 100755 src/depends/packages/libX11.mk mode change 100644 => 100755 src/depends/packages/libXau.mk mode change 100644 => 100755 src/depends/packages/libXext.mk mode change 100644 => 100755 src/depends/packages/libxcb.mk mode change 100644 => 100755 src/depends/packages/miniupnpc.mk mode change 100644 => 100755 src/depends/packages/native_ccache.mk mode change 100644 => 100755 src/depends/packages/native_cctools.mk mode change 100644 => 100755 src/depends/packages/native_cdrkit.mk mode change 100644 => 100755 src/depends/packages/native_comparisontool.mk mode change 100644 => 100755 src/depends/packages/native_libdmg-hfsplus.mk mode change 100644 => 100755 src/depends/packages/native_libuuid.mk mode change 100644 => 100755 src/depends/packages/native_openssl.mk mode change 100644 => 100755 src/depends/packages/native_protobuf.mk mode change 100644 => 100755 src/depends/packages/openssl.mk mode change 100644 => 100755 src/depends/packages/packages.mk mode change 100644 => 100755 src/depends/packages/protobuf.mk mode change 100644 => 100755 src/depends/packages/qrencode.mk mode change 100644 => 100755 src/depends/packages/qt.mk mode change 100644 => 100755 src/depends/packages/qt46.mk mode change 100644 => 100755 src/depends/packages/xcb_proto.mk mode change 100644 => 100755 src/depends/packages/xextproto.mk mode change 100644 => 100755 src/depends/packages/xproto.mk mode change 100644 => 100755 src/depends/packages/xtrans.mk mode change 100644 => 100755 src/depends/patches/qt/mac-qmake.conf mode change 100644 => 100755 src/doc/Doxyfile mode change 100644 => 100755 src/doc/README.md mode change 100644 => 100755 src/doc/README_osx.txt mode change 100644 => 100755 src/doc/README_windows.txt mode change 100644 => 100755 src/doc/assets-attribution.md mode change 100644 => 100755 src/doc/bitcoin_logo_doxygen.png mode change 100644 => 100755 src/doc/bootstrap.md mode change 100644 => 100755 src/doc/build-msw.md mode change 100644 => 100755 src/doc/build-osx.md mode change 100644 => 100755 src/doc/build-unix.md mode change 100644 => 100755 src/doc/coding.md mode change 100644 => 100755 src/doc/files.md mode change 100644 => 100755 src/doc/gitian-building.md mode change 100644 => 100755 src/doc/gitian-building/create_vm_file_location_size.png mode change 100644 => 100755 src/doc/gitian-building/create_vm_hard_drive.png mode change 100644 => 100755 src/doc/gitian-building/create_vm_hard_drive_file_type.png mode change 100644 => 100755 src/doc/gitian-building/create_vm_memsize.png mode change 100644 => 100755 src/doc/gitian-building/create_vm_page1.png mode change 100644 => 100755 src/doc/gitian-building/create_vm_storage_physical_hard_drive.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_10_configure_clock.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_11_partition_disks.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_12_choose_disk.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_13_partition_scheme.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_14_finish.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_15_write_changes.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_16_choose_a_mirror.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_17_choose_a_mirror2.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_18_proxy_settings.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_19_software_selection.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_1_boot_menu.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_20_install_grub.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_21_finish_installation.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_2_select_a_language.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_3_select_location.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_4_configure_keyboard.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_5_configure_the_network.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_6_domain_name.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_6a_set_up_root_password.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_7_set_up_user_fullname.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_8_set_up_username.png mode change 100644 => 100755 src/doc/gitian-building/debian_install_9_user_password.png mode change 100644 => 100755 src/doc/gitian-building/network_settings.png mode change 100644 => 100755 src/doc/gitian-building/port_forwarding_rules.png mode change 100644 => 100755 src/doc/gitian-building/select_startup_disk.png mode change 100644 => 100755 src/doc/guide-startmany.md mode change 100644 => 100755 src/doc/img/bootstrap1.png mode change 100644 => 100755 src/doc/img/bootstrap2.png mode change 100644 => 100755 src/doc/img/bootstrap3.png mode change 100644 => 100755 src/doc/img/bootstrap4.png mode change 100644 => 100755 src/doc/img/bootstrap5.png mode change 100644 => 100755 src/doc/keepass.md mode change 100644 => 100755 src/doc/masternode_conf.md mode change 100644 => 100755 src/doc/multiwallet-qt.md mode change 100644 => 100755 src/doc/release-notes.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.12.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.13.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.14.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.15.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.16.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.17.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.18.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.19.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.20.1.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.20.2.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.20.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.21.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.22.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.23.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.3.24.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.0.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.1.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.2.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.3.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.4.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.5.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.4.6.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.5.0.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.5.1.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.5.2.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.5.3.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.5.4.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.5.5.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.6.0.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.6.1.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.6.2.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.6.3.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.7.0.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.7.1.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.7.2.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.0.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.1.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.2.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.3.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.4.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.5.md mode change 100644 => 100755 src/doc/release-notes/bitcoin/release-notes-0.8.6.md mode change 100644 => 100755 src/doc/release-notes/dash/release-notes-0.10.0.md mode change 100644 => 100755 src/doc/release-notes/dash/release-notes-0.11.0.md mode change 100644 => 100755 src/doc/release-notes/dash/release-notes-0.11.1.md mode change 100644 => 100755 src/doc/release-notes/dash/release-notes-0.11.2.md mode change 100644 => 100755 src/doc/release-notes/dash/release-notes-0.9.0.md mode change 100644 => 100755 src/doc/release-process.md mode change 100644 => 100755 src/doc/tor.md mode change 100644 => 100755 src/doc/translation_process.md mode change 100644 => 100755 src/doc/unit-tests.md mode change 100644 => 100755 src/echo.c mode change 100644 => 100755 src/groestl.c mode change 100644 => 100755 src/hash.cpp mode change 100644 => 100755 src/hash.h delete mode 100644 src/hmac_sha256.cpp delete mode 100644 src/hmac_sha256.h mode change 100644 => 100755 src/instantx.cpp mode change 100644 => 100755 src/instantx.h mode change 100644 => 100755 src/interzone-cli-res.rc mode change 100644 => 100755 src/interzone-cli.cpp delete mode 100644 src/interzone-config.h delete mode 100644 src/interzone-config.h.in mode change 100644 => 100755 src/interzoned-res.rc mode change 100644 => 100755 src/interzoned.cpp mode change 100644 => 100755 src/jh.c mode change 100644 => 100755 src/json/LICENSE.txt mode change 100644 => 100755 src/json/json_spirit.h mode change 100644 => 100755 src/json/json_spirit_error_position.h mode change 100644 => 100755 src/json/json_spirit_reader.cpp mode change 100644 => 100755 src/json/json_spirit_reader.h mode change 100644 => 100755 src/json/json_spirit_reader_template.h mode change 100644 => 100755 src/json/json_spirit_stream_reader.h mode change 100644 => 100755 src/json/json_spirit_utils.h mode change 100644 => 100755 src/json/json_spirit_value.cpp mode change 100644 => 100755 src/json/json_spirit_value.h mode change 100644 => 100755 src/json/json_spirit_writer.cpp mode change 100644 => 100755 src/json/json_spirit_writer.h mode change 100644 => 100755 src/json/json_spirit_writer_template.h mode change 100644 => 100755 src/keccak.c mode change 100644 => 100755 src/keepass.cpp mode change 100644 => 100755 src/keepass.h mode change 100644 => 100755 src/key.cpp mode change 100644 => 100755 src/key.h mode change 100644 => 100755 src/keystore.cpp mode change 100644 => 100755 src/keystore.h mode change 100644 => 100755 src/leveldb/.gitignore mode change 100644 => 100755 src/leveldb/AUTHORS mode change 100644 => 100755 src/leveldb/LICENSE mode change 100644 => 100755 src/leveldb/Makefile mode change 100644 => 100755 src/leveldb/NEWS mode change 100644 => 100755 src/leveldb/README mode change 100644 => 100755 src/leveldb/TODO mode change 100644 => 100755 src/leveldb/WINDOWS.md mode change 100644 => 100755 src/leveldb/db/autocompact_test.cc mode change 100644 => 100755 src/leveldb/db/builder.cc mode change 100644 => 100755 src/leveldb/db/builder.h mode change 100644 => 100755 src/leveldb/db/c.cc mode change 100644 => 100755 src/leveldb/db/c_test.c mode change 100644 => 100755 src/leveldb/db/corruption_test.cc mode change 100644 => 100755 src/leveldb/db/db_bench.cc mode change 100644 => 100755 src/leveldb/db/db_impl.cc mode change 100644 => 100755 src/leveldb/db/db_impl.h mode change 100644 => 100755 src/leveldb/db/db_iter.cc mode change 100644 => 100755 src/leveldb/db/db_iter.h mode change 100644 => 100755 src/leveldb/db/db_test.cc mode change 100644 => 100755 src/leveldb/db/dbformat.cc mode change 100644 => 100755 src/leveldb/db/dbformat.h mode change 100644 => 100755 src/leveldb/db/dbformat_test.cc mode change 100644 => 100755 src/leveldb/db/filename.cc mode change 100644 => 100755 src/leveldb/db/filename.h mode change 100644 => 100755 src/leveldb/db/filename_test.cc mode change 100644 => 100755 src/leveldb/db/leveldb_main.cc mode change 100644 => 100755 src/leveldb/db/log_format.h mode change 100644 => 100755 src/leveldb/db/log_reader.cc mode change 100644 => 100755 src/leveldb/db/log_reader.h mode change 100644 => 100755 src/leveldb/db/log_test.cc mode change 100644 => 100755 src/leveldb/db/log_writer.cc mode change 100644 => 100755 src/leveldb/db/log_writer.h mode change 100644 => 100755 src/leveldb/db/memtable.cc mode change 100644 => 100755 src/leveldb/db/memtable.h mode change 100644 => 100755 src/leveldb/db/repair.cc mode change 100644 => 100755 src/leveldb/db/skiplist.h mode change 100644 => 100755 src/leveldb/db/skiplist_test.cc mode change 100644 => 100755 src/leveldb/db/snapshot.h mode change 100644 => 100755 src/leveldb/db/table_cache.cc mode change 100644 => 100755 src/leveldb/db/table_cache.h mode change 100644 => 100755 src/leveldb/db/version_edit.cc mode change 100644 => 100755 src/leveldb/db/version_edit.h mode change 100644 => 100755 src/leveldb/db/version_edit_test.cc mode change 100644 => 100755 src/leveldb/db/version_set.cc mode change 100644 => 100755 src/leveldb/db/version_set.h mode change 100644 => 100755 src/leveldb/db/version_set_test.cc mode change 100644 => 100755 src/leveldb/db/write_batch.cc mode change 100644 => 100755 src/leveldb/db/write_batch_internal.h mode change 100644 => 100755 src/leveldb/db/write_batch_test.cc mode change 100644 => 100755 src/leveldb/doc/bench/db_bench_sqlite3.cc mode change 100644 => 100755 src/leveldb/doc/bench/db_bench_tree_db.cc mode change 100644 => 100755 src/leveldb/doc/benchmark.html mode change 100644 => 100755 src/leveldb/doc/doc.css mode change 100644 => 100755 src/leveldb/doc/impl.html mode change 100644 => 100755 src/leveldb/doc/index.html mode change 100644 => 100755 src/leveldb/doc/log_format.txt mode change 100644 => 100755 src/leveldb/doc/table_format.txt mode change 100644 => 100755 src/leveldb/helpers/memenv/memenv.cc mode change 100644 => 100755 src/leveldb/helpers/memenv/memenv.h mode change 100644 => 100755 src/leveldb/helpers/memenv/memenv_test.cc mode change 100644 => 100755 src/leveldb/include/leveldb/c.h mode change 100644 => 100755 src/leveldb/include/leveldb/cache.h mode change 100644 => 100755 src/leveldb/include/leveldb/comparator.h mode change 100644 => 100755 src/leveldb/include/leveldb/db.h mode change 100644 => 100755 src/leveldb/include/leveldb/env.h mode change 100644 => 100755 src/leveldb/include/leveldb/filter_policy.h mode change 100644 => 100755 src/leveldb/include/leveldb/iterator.h mode change 100644 => 100755 src/leveldb/include/leveldb/options.h mode change 100644 => 100755 src/leveldb/include/leveldb/slice.h mode change 100644 => 100755 src/leveldb/include/leveldb/status.h mode change 100644 => 100755 src/leveldb/include/leveldb/table.h mode change 100644 => 100755 src/leveldb/include/leveldb/table_builder.h mode change 100644 => 100755 src/leveldb/include/leveldb/write_batch.h mode change 100644 => 100755 src/leveldb/issues/issue178_test.cc mode change 100644 => 100755 src/leveldb/issues/issue200_test.cc mode change 100644 => 100755 src/leveldb/port/README mode change 100644 => 100755 src/leveldb/port/atomic_pointer.h mode change 100644 => 100755 src/leveldb/port/port.h mode change 100644 => 100755 src/leveldb/port/port_example.h mode change 100644 => 100755 src/leveldb/port/port_posix.cc mode change 100644 => 100755 src/leveldb/port/port_posix.h mode change 100644 => 100755 src/leveldb/port/port_win.cc mode change 100644 => 100755 src/leveldb/port/port_win.h mode change 100644 => 100755 src/leveldb/port/thread_annotations.h mode change 100644 => 100755 src/leveldb/port/win/stdint.h mode change 100644 => 100755 src/leveldb/table/block.cc mode change 100644 => 100755 src/leveldb/table/block.h mode change 100644 => 100755 src/leveldb/table/block_builder.cc mode change 100644 => 100755 src/leveldb/table/block_builder.h mode change 100644 => 100755 src/leveldb/table/filter_block.cc mode change 100644 => 100755 src/leveldb/table/filter_block.h mode change 100644 => 100755 src/leveldb/table/filter_block_test.cc mode change 100644 => 100755 src/leveldb/table/format.cc mode change 100644 => 100755 src/leveldb/table/format.h mode change 100644 => 100755 src/leveldb/table/iterator.cc mode change 100644 => 100755 src/leveldb/table/iterator_wrapper.h mode change 100644 => 100755 src/leveldb/table/merger.cc mode change 100644 => 100755 src/leveldb/table/merger.h mode change 100644 => 100755 src/leveldb/table/table.cc mode change 100644 => 100755 src/leveldb/table/table_builder.cc mode change 100644 => 100755 src/leveldb/table/table_test.cc mode change 100644 => 100755 src/leveldb/table/two_level_iterator.cc mode change 100644 => 100755 src/leveldb/table/two_level_iterator.h mode change 100644 => 100755 src/leveldb/util/arena.cc mode change 100644 => 100755 src/leveldb/util/arena.h mode change 100644 => 100755 src/leveldb/util/arena_test.cc mode change 100644 => 100755 src/leveldb/util/bloom.cc mode change 100644 => 100755 src/leveldb/util/bloom_test.cc mode change 100644 => 100755 src/leveldb/util/cache.cc mode change 100644 => 100755 src/leveldb/util/cache_test.cc mode change 100644 => 100755 src/leveldb/util/coding.cc mode change 100644 => 100755 src/leveldb/util/coding.h mode change 100644 => 100755 src/leveldb/util/coding_test.cc mode change 100644 => 100755 src/leveldb/util/comparator.cc mode change 100644 => 100755 src/leveldb/util/crc32c.cc mode change 100644 => 100755 src/leveldb/util/crc32c.h mode change 100644 => 100755 src/leveldb/util/crc32c_test.cc mode change 100644 => 100755 src/leveldb/util/env.cc mode change 100644 => 100755 src/leveldb/util/env_posix.cc mode change 100644 => 100755 src/leveldb/util/env_test.cc mode change 100644 => 100755 src/leveldb/util/env_win.cc mode change 100644 => 100755 src/leveldb/util/filter_policy.cc mode change 100644 => 100755 src/leveldb/util/hash.cc mode change 100644 => 100755 src/leveldb/util/hash.h mode change 100644 => 100755 src/leveldb/util/histogram.cc mode change 100644 => 100755 src/leveldb/util/histogram.h mode change 100644 => 100755 src/leveldb/util/logging.cc mode change 100644 => 100755 src/leveldb/util/logging.h mode change 100644 => 100755 src/leveldb/util/mutexlock.h mode change 100644 => 100755 src/leveldb/util/options.cc mode change 100644 => 100755 src/leveldb/util/posix_logger.h mode change 100644 => 100755 src/leveldb/util/random.h mode change 100644 => 100755 src/leveldb/util/status.cc mode change 100644 => 100755 src/leveldb/util/testharness.cc mode change 100644 => 100755 src/leveldb/util/testharness.h mode change 100644 => 100755 src/leveldb/util/testutil.cc mode change 100644 => 100755 src/leveldb/util/testutil.h mode change 100644 => 100755 src/leveldbwrapper.cpp mode change 100644 => 100755 src/leveldbwrapper.h mode change 100644 => 100755 src/limitedmap.h mode change 100644 => 100755 src/luffa.c mode change 100644 => 100755 src/m4/ax_boost_base.m4 mode change 100644 => 100755 src/m4/ax_boost_chrono.m4 mode change 100644 => 100755 src/m4/ax_boost_filesystem.m4 mode change 100644 => 100755 src/m4/ax_boost_program_options.m4 mode change 100644 => 100755 src/m4/ax_boost_system.m4 mode change 100644 => 100755 src/m4/ax_boost_thread.m4 mode change 100644 => 100755 src/m4/ax_boost_unit_test_framework.m4 mode change 100644 => 100755 src/m4/ax_check_compile_flag.m4 mode change 100644 => 100755 src/m4/ax_check_link_flag.m4 mode change 100644 => 100755 src/m4/ax_check_preproc_flag.m4 mode change 100644 => 100755 src/m4/ax_pthread.m4 mode change 100644 => 100755 src/m4/bitcoin_find_bdb48.m4 mode change 100644 => 100755 src/m4/bitcoin_qt.m4 mode change 100644 => 100755 src/m4/bitcoin_subdir_to_include.m4 mode change 100644 => 100755 src/main.cpp mode change 100644 => 100755 src/main.h mode change 100644 => 100755 src/masternode-pos.cpp mode change 100644 => 100755 src/masternode-pos.h mode change 100644 => 100755 src/masternode.cpp mode change 100644 => 100755 src/masternode.h mode change 100644 => 100755 src/masternodeconfig.cpp mode change 100644 => 100755 src/masternodeconfig.h mode change 100644 => 100755 src/masternodeman.cpp mode change 100644 => 100755 src/masternodeman.h mode change 100644 => 100755 src/miner.cpp mode change 100644 => 100755 src/miner.h mode change 100644 => 100755 src/mruset.h mode change 100644 => 100755 src/net.cpp mode change 100644 => 100755 src/net.h mode change 100644 => 100755 src/netbase.cpp mode change 100644 => 100755 src/netbase.h mode change 100644 => 100755 src/noui.cpp mode change 100644 => 100755 src/noui.h mode change 100644 => 100755 src/obj-test/.gitignore mode change 100644 => 100755 src/obj/.gitignore mode change 100644 => 100755 src/pkg.m4 delete mode 100644 src/prevector.h mode change 100644 => 100755 src/protocol.cpp mode change 100644 => 100755 src/protocol.h mode change 100644 => 100755 src/qa/rpc-tests/.gitignore mode change 100644 => 100755 src/qa/rpc-tests/README.md mode change 100644 => 100755 src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore mode change 100644 => 100755 src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py mode change 100644 => 100755 src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py mode change 100644 => 100755 src/qa/rpc-tests/python-bitcoinrpc/setup.py mode change 100644 => 100755 src/qa/rpc-tests/util.py mode change 100644 => 100755 src/qa/rpc-tests/util.sh delete mode 100755 src/qt/bantablemodel.cpp delete mode 100755 src/qt/bantablemodel.h delete mode 100755 src/qt/forms/masternodelist.ui delete mode 100755 src/qt/masternodelist.cpp delete mode 100755 src/qt/masternodelist.h delete mode 100755 src/qt/peertablemodel.cpp delete mode 100755 src/qt/peertablemodel.h mode change 100644 => 100755 src/qt/res/interzone-qt-res.rc mode change 100644 => 100755 src/qt/res/movies/spinner-000.png mode change 100644 => 100755 src/qt/res/movies/spinner-001.png mode change 100644 => 100755 src/qt/res/movies/spinner-002.png mode change 100644 => 100755 src/qt/res/movies/spinner-003.png mode change 100644 => 100755 src/qt/res/movies/spinner-004.png mode change 100644 => 100755 src/qt/res/movies/spinner-005.png mode change 100644 => 100755 src/qt/res/movies/spinner-006.png mode change 100644 => 100755 src/qt/res/movies/spinner-007.png mode change 100644 => 100755 src/qt/res/movies/spinner-008.png mode change 100644 => 100755 src/qt/res/movies/spinner-009.png mode change 100644 => 100755 src/qt/res/movies/spinner-010.png mode change 100644 => 100755 src/qt/res/movies/spinner-011.png mode change 100644 => 100755 src/qt/res/movies/spinner-012.png mode change 100644 => 100755 src/qt/res/movies/spinner-013.png mode change 100644 => 100755 src/qt/res/movies/spinner-014.png mode change 100644 => 100755 src/qt/res/movies/spinner-015.png mode change 100644 => 100755 src/qt/res/movies/spinner-016.png mode change 100644 => 100755 src/qt/res/movies/spinner-017.png mode change 100644 => 100755 src/qt/res/movies/spinner-018.png mode change 100644 => 100755 src/qt/res/movies/spinner-019.png mode change 100644 => 100755 src/qt/res/movies/spinner-020.png mode change 100644 => 100755 src/qt/res/movies/spinner-021.png mode change 100644 => 100755 src/qt/res/movies/spinner-022.png mode change 100644 => 100755 src/qt/res/movies/spinner-023.png mode change 100644 => 100755 src/qt/res/movies/spinner-024.png mode change 100644 => 100755 src/qt/res/movies/spinner-025.png mode change 100644 => 100755 src/qt/res/movies/spinner-026.png mode change 100644 => 100755 src/qt/res/movies/spinner-027.png mode change 100644 => 100755 src/qt/res/movies/spinner-028.png mode change 100644 => 100755 src/qt/res/movies/spinner-029.png mode change 100644 => 100755 src/qt/res/movies/spinner-030.png mode change 100644 => 100755 src/qt/res/movies/spinner-031.png mode change 100644 => 100755 src/qt/res/movies/spinner-032.png mode change 100644 => 100755 src/qt/res/movies/spinner-033.png mode change 100644 => 100755 src/qt/res/movies/spinner-034.png mode change 100644 => 100755 src/qt/res/src/bitcoin.svg mode change 100644 => 100755 src/qt/res/src/clock1.svg mode change 100644 => 100755 src/qt/res/src/clock2.svg mode change 100644 => 100755 src/qt/res/src/clock3.svg mode change 100644 => 100755 src/qt/res/src/clock4.svg mode change 100644 => 100755 src/qt/res/src/clock5.svg mode change 100644 => 100755 src/qt/res/src/clock_green.svg mode change 100644 => 100755 src/qt/res/src/inout.svg mode change 100644 => 100755 src/qt/res/src/questionmark.svg delete mode 100644 src/random.cpp delete mode 100644 src/random.h mode change 100644 => 100755 src/rpcblockchain.cpp mode change 100644 => 100755 src/rpcclient.cpp mode change 100644 => 100755 src/rpcclient.h mode change 100644 => 100755 src/rpcdarksend.cpp mode change 100644 => 100755 src/rpcdump.cpp mode change 100644 => 100755 src/rpcmining.cpp mode change 100644 => 100755 src/rpcmisc.cpp mode change 100644 => 100755 src/rpcnet.cpp mode change 100644 => 100755 src/rpcprotocol.cpp mode change 100644 => 100755 src/rpcprotocol.h mode change 100644 => 100755 src/rpcrawtransaction.cpp mode change 100644 => 100755 src/rpcserver.cpp mode change 100644 => 100755 src/rpcserver.h mode change 100644 => 100755 src/rpcwallet.cpp mode change 100644 => 100755 src/script.cpp mode change 100644 => 100755 src/script.h delete mode 100644 src/script/script.cpp delete mode 100644 src/script/script.h mode change 100644 => 100755 src/serialize.h delete mode 100644 src/sha256.cpp delete mode 100644 src/sha256.h mode change 100644 => 100755 src/share/certs/BitcoinFoundation_Apple_Cert.pem mode change 100644 => 100755 src/share/certs/BitcoinFoundation_Comodo_Cert.pem mode change 100644 => 100755 src/share/certs/PrivateKeyNotes.md mode change 100644 => 100755 src/share/pixmaps/addressbook16.bmp mode change 100644 => 100755 src/share/pixmaps/addressbook16mask.bmp mode change 100644 => 100755 src/share/pixmaps/addressbook20.bmp mode change 100644 => 100755 src/share/pixmaps/addressbook20mask.bmp mode change 100644 => 100755 src/share/pixmaps/check.ico mode change 100644 => 100755 src/share/pixmaps/send16.bmp mode change 100644 => 100755 src/share/pixmaps/send16mask.bmp mode change 100644 => 100755 src/share/pixmaps/send16masknoshadow.bmp mode change 100644 => 100755 src/share/pixmaps/send20.bmp mode change 100644 => 100755 src/share/pixmaps/send20mask.bmp mode change 100644 => 100755 src/share/qt/Info.plist mode change 100644 => 100755 src/share/qt/Info.plist.in mode change 100644 => 100755 src/share/qt/img/reload.png mode change 100644 => 100755 src/share/qt/img/reload.xcf mode change 100644 => 100755 src/share/qt/protobuf.pri mode change 100644 => 100755 src/share/setup.nsi.in mode change 100644 => 100755 src/share/ui.rc mode change 100644 => 100755 src/shavite.c mode change 100644 => 100755 src/simd.c mode change 100644 => 100755 src/skein.c mode change 100644 => 100755 src/sph_blake.h mode change 100644 => 100755 src/sph_bmw.h mode change 100644 => 100755 src/sph_cubehash.h mode change 100644 => 100755 src/sph_echo.h mode change 100644 => 100755 src/sph_groestl.h mode change 100644 => 100755 src/sph_jh.h mode change 100644 => 100755 src/sph_keccak.h mode change 100644 => 100755 src/sph_luffa.h mode change 100644 => 100755 src/sph_shavite.h mode change 100644 => 100755 src/sph_simd.h mode change 100644 => 100755 src/sph_skein.h mode change 100644 => 100755 src/sph_types.h mode change 100644 => 100755 src/spork.cpp mode change 100644 => 100755 src/spork.h delete mode 100644 src/stamp-h1 delete mode 100644 src/support/cleanse.cpp delete mode 100644 src/support/cleanse.h mode change 100644 => 100755 src/sync.cpp mode change 100644 => 100755 src/sync.h mode change 100644 => 100755 src/test/Checkpoints_tests.cpp mode change 100644 => 100755 src/test/DoS_tests.cpp delete mode 100644 src/test/Makefile mode change 100644 => 100755 src/test/Makefile.am mode change 100644 => 100755 src/test/README.md mode change 100644 => 100755 src/test/accounting_tests.cpp mode change 100644 => 100755 src/test/alert_tests.cpp mode change 100644 => 100755 src/test/allocator_tests.cpp mode change 100644 => 100755 src/test/base32_tests.cpp mode change 100644 => 100755 src/test/base58_tests.cpp mode change 100644 => 100755 src/test/base64_tests.cpp mode change 100644 => 100755 src/test/bignum_tests.cpp mode change 100644 => 100755 src/test/bip32_tests.cpp mode change 100644 => 100755 src/test/bloom_tests.cpp mode change 100644 => 100755 src/test/canonical_tests.cpp mode change 100644 => 100755 src/test/checkblock_tests.cpp mode change 100644 => 100755 src/test/compress_tests.cpp mode change 100644 => 100755 src/test/data/README.md mode change 100644 => 100755 src/test/data/alertTests.raw mode change 100644 => 100755 src/test/data/base58_encode_decode.json mode change 100644 => 100755 src/test/data/base58_keys_invalid.json mode change 100644 => 100755 src/test/data/base58_keys_valid.json mode change 100644 => 100755 src/test/data/script_invalid.json mode change 100644 => 100755 src/test/data/script_valid.json mode change 100644 => 100755 src/test/data/sig_canonical.json mode change 100644 => 100755 src/test/data/sig_noncanonical.json mode change 100644 => 100755 src/test/data/sighash.json mode change 100644 => 100755 src/test/data/tx_invalid.json mode change 100644 => 100755 src/test/data/tx_valid.json mode change 100644 => 100755 src/test/getarg_tests.cpp mode change 100644 => 100755 src/test/hash_tests.cpp mode change 100644 => 100755 src/test/hmac_tests.cpp mode change 100644 => 100755 src/test/key_tests.cpp mode change 100644 => 100755 src/test/main_tests.cpp mode change 100644 => 100755 src/test/miner_tests.cpp mode change 100644 => 100755 src/test/mruset_tests.cpp mode change 100644 => 100755 src/test/multisig_tests.cpp mode change 100644 => 100755 src/test/netbase_tests.cpp mode change 100644 => 100755 src/test/pmt_tests.cpp mode change 100644 => 100755 src/test/rpc_tests.cpp mode change 100644 => 100755 src/test/rpc_wallet_tests.cpp mode change 100644 => 100755 src/test/script_P2SH_tests.cpp mode change 100644 => 100755 src/test/script_tests.cpp mode change 100644 => 100755 src/test/scriptnum_tests.cpp mode change 100644 => 100755 src/test/serialize_tests.cpp mode change 100644 => 100755 src/test/sighash_tests.cpp mode change 100644 => 100755 src/test/sigopcount_tests.cpp mode change 100644 => 100755 src/test/test_darkcoin.cpp rename src/test/{test_chaincoin.cpp => test_interzone.cpp} (100%) mode change 100644 => 100755 mode change 100644 => 100755 src/test/transaction_tests.cpp mode change 100644 => 100755 src/test/uint256_tests.cpp mode change 100644 => 100755 src/test/util_tests.cpp mode change 100644 => 100755 src/test/wallet_tests.cpp mode change 100644 => 100755 src/threadsafety.h mode change 100644 => 100755 src/tinyformat.h delete mode 100644 src/torcontrol.cpp delete mode 100644 src/torcontrol.h mode change 100644 => 100755 src/txdb.cpp mode change 100644 => 100755 src/txdb.h mode change 100644 => 100755 src/txmempool.cpp mode change 100644 => 100755 src/txmempool.h mode change 100644 => 100755 src/ui_interface.h mode change 100644 => 100755 src/uint256.h mode change 100644 => 100755 src/util.h delete mode 100644 src/utilstrencodings.cpp delete mode 100644 src/utilstrencodings.h mode change 100644 => 100755 src/version.cpp mode change 100644 => 100755 src/version.h mode change 100644 => 100755 src/wallet.cpp mode change 100644 => 100755 src/wallet.h mode change 100644 => 100755 src/walletdb.cpp mode change 100644 => 100755 src/walletdb.h diff --git a/COPYING b/COPYING old mode 100644 new mode 100755 diff --git a/INSTALL b/INSTALL old mode 100644 new mode 100755 diff --git a/Makefile.am b/Makefile.am old mode 100644 new mode 100755 diff --git a/configure.ac b/configure.ac old mode 100644 new mode 100755 index eaa0487a5..de8f00027 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) -define(_CLIENT_VERSION_MAJOR, 0) -define(_CLIENT_VERSION_MINOR, 13) +define(_CLIENT_VERSION_MAJOR, 1) +define(_CLIENT_VERSION_MINOR, 4) define(_CLIENT_VERSION_REVISION, 0) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) @@ -10,9 +10,9 @@ AC_INIT([Interzone Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VE AC_CONFIG_AUX_DIR([src/build-aux]) AC_CONFIG_MACRO_DIR([src/m4]) AC_CANONICAL_HOST -AH_TOP([#ifndef CHAINCOIN_CONFIG_H]) -AH_TOP([#define CHAINCOIN_CONFIG_H]) -AH_BOTTOM([#endif //CHAINCOIN_CONFIG_H]) +AH_TOP([#ifndef Interzone_CONFIG_H]) +AH_TOP([#define Interzone_CONFIG_H]) +AH_BOTTOM([#endif //Interzone_CONFIG_H]) # This m4 will only be used if a system copy cannot be found. This is helpful # on systems where autotools are installed but the pkg-config macros are not in @@ -158,9 +158,9 @@ fi ## compatibility with the legacy buildsystem. ## if test "x$CXXFLAGS_overridden" = "xno"; then - CXXFLAGS="$CXXFLAGS -std=c++11 -DBOOST_NO_CXX11_SCOPED_ENUMS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" + CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" fi -CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -fPIE" +CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" AC_LANG_PUSH([C++]) @@ -519,23 +519,6 @@ AC_ARG_WITH([daemon], [build_bitcoind=$withval], [build_bitcoind=yes]) -AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) - -AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,, - [#if HAVE_ENDIAN_H - #include - #elif HAVE_SYS_ENDIAN_H - #include - #endif]) - -AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,, - [#if HAVE_BYTESWAP_H - #include - #endif]) - -AC_CHECK_DECLS([__builtin_clz, __builtin_clzl, __builtin_clzll]) - - BITCOIN_QT_INIT if test x$use_pkgconfig = xyes; then @@ -554,12 +537,6 @@ if test x$use_pkgconfig = xyes; then if test x$use_qr != xno; then BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) fi - if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then - PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)]) - if test x$TARGET_OS != xwindows; then - PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)]) - fi - fi ] ) else @@ -569,14 +546,6 @@ else AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),) AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing)) - if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then - AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),) - AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing)) - if test x$TARGET_OS != xwindows; then - AC_CHECK_LIB([event_pthreads],[main],EVENT_PTHREADS_LIBS=-levent_pthreads,AC_MSG_ERROR(libevent_pthreads missing)) - fi - fi - BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found))) if test x$use_qr != xno; then BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no])]) diff --git a/contrib/README.md b/contrib/README.md old mode 100644 new mode 100755 diff --git a/contrib/bitcoind.bash-completion b/contrib/bitcoind.bash-completion old mode 100644 new mode 100755 diff --git a/contrib/bitrpc/README.md b/contrib/bitrpc/README.md old mode 100644 new mode 100755 diff --git a/contrib/bitrpc/bitrpc.py b/contrib/bitrpc/bitrpc.py old mode 100644 new mode 100755 diff --git a/contrib/chc_seeder/README.md b/contrib/chc_seeder/README.md deleted file mode 100644 index b6e491ae9..000000000 --- a/contrib/chc_seeder/README.md +++ /dev/null @@ -1 +0,0 @@ -sudo python dns_server.py --port 53 --tcp diff --git a/contrib/chc_seeder/dns_server.py b/contrib/chc_seeder/dns_server.py deleted file mode 100644 index 985929c00..000000000 --- a/contrib/chc_seeder/dns_server.py +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/env python -# coding=utf-8 -from mn_rand_ips import MNRandIPs - -import argparse -import datetime -import sys -import time -import threading -import traceback -import SocketServer -import struct -import logging - -try: - from dnslib import * -except ImportError: - logging.error("Missing dependency dnslib: . Please install it with `pip`.") - sys.exit(2) - - -logging.basicConfig(filename='/home/ubuntu/seeder.log', level=logging.DEBUG) - -class DomainName(str): - def __getattr__(self, item): - return DomainName(item + '.' + self) - -DOMAN_NAME = 'dnsseed1.interzone.org' -IP = '52.89.51.214' -NS = "ns1.interzone.org" -D = DomainName(DOMAN_NAME) - -TTL = 60 * 5 - -soa_record = SOA( - mname=D.ns1, # primary name server - rname=D.chcdev, - times=( - 201307231, # serial number - 60 * 60 * 1, # refresh - 60 * 60 * 3, # retry - 60 * 60 * 24, # expire - 60 * 60 * 1, # minimum - ) -) -ns_records = [NS(D.ns1), NS(D.ns2)] -records = { - D: [A(IP), AAAA((0,) * 16), MX(D.mail), soa_record] + ns_records, - D.ns1: [A(IP)], # MX and NS records must never point to a CNAME alias (RFC 2181 section 10.3) - D.ns2: [A(IP)], - D.mail: [A(IP)], - D.andrei: [CNAME(D)], -} - -mn_rand_ips = MNRandIPs() -mn_rand_ips.refresh_mn_ips() -ips_per_req = 8 - -_NS_RECORD = "NS" -def dns_response(data): - request = DNSRecord.parse(data) - - logging.info(request) - - reply = DNSRecord(DNSHeader(id=request.header.id, qr=1, aa=1, ra=1), q=request.q) - - qname = request.q.qname - qn = str(qname) - qtype = request.q.qtype - qt = QTYPE[qtype] - - if qt == "NS": - reply.add_answer(*RR.fromZone(DOMAN_NAME + " 3600 NS " + NS)) - reply.add_ar(*RR.fromZone(NS + " A " + IP)) - else: - domain_name_a = DOMAN_NAME + " A " - for ip in mn_rand_ips.get_random_x_ips( ips_per_req ): - reply.add_answer(*RR.fromZone(domain_name_a + ip)) - - logging.info("---- Reply: %s\n", str(reply) ) - - return reply.pack() - - -class BaseRequestHandler(SocketServer.BaseRequestHandler): - - def get_data(self): - raise NotImplementedError - - def send_data(self, data): - raise NotImplementedError - - def handle(self): - now = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f') - logging.info("\n\n%s request %s (%s %s):" % (self.__class__.__name__[:3], now, self.client_address[0], - self.client_address[1])) - try: - data = self.get_data() - logging.info(str(len(data)) + " : " + str(data) ) # repr(data).replace('\\x', '')[1:-1] - self.send_data(dns_response(data)) - except Exception as e: - logging.error("Error handling reques" + str(e) ) - logging.error(str(traceback.print_exc())) - - -class TCPRequestHandler(BaseRequestHandler): - - def get_data(self): - data = self.request.recv(8192).strip() - sz = struct.unpack('>H', data[:2])[0] - if sz < len(data) - 2: - raise Exception("Wrong size of TCP packet") - elif sz > len(data) - 2: - raise Exception("Too big TCP packet") - return data[2:] - - def send_data(self, data): - sz = struct.pack('>H', len(data)) - return self.request.sendall(sz + data) - - -class UDPRequestHandler(BaseRequestHandler): - - def get_data(self): - return self.request[0].strip() - - def send_data(self, data): - return self.request[1].sendto(data, self.client_address) - - -def main(): - parser = argparse.ArgumentParser(description='Start a DNS implemented in Python.') - parser = argparse.ArgumentParser(description='Start a DNS implemented in Python. Usually DNSs use UDP on port 53.') - parser.add_argument('--port', default=53, type=int, help='The port to listen on.') - parser.add_argument('--tcp', action='store_true', help='Listen to TCP connections.') - parser.add_argument('--udp', action='store_true', help='Listen to UDP datagrams.') - - parser.add_argument('--DNS', type=str, help='DNS address for the server.') - if not args.DNS: parser.error("Please add a DNS") - DOMAN_NAME = args.DNS - - parser.add_argument('--IP', type=str, help='IP address for the server.') - if not args.IP: parser.error("Please add an IP") - IP = args.IP - - parser.add_argument('--NS', type=str, help='NS address for the server.') - if not args.NS: parser.error("Please add a NS") - NS = args.NS - - args = parser.parse_args() - if not (args.udp or args.tcp): parser.error("Please select at least one of --udp or --tcp.") - - logging.info("Starting nameserver...") - - servers = [] - if args.udp: servers.append(SocketServer.ThreadingUDPServer(('', args.port), UDPRequestHandler)) - if args.tcp: servers.append(SocketServer.ThreadingTCPServer(('', args.port), TCPRequestHandler)) - - for s in servers: - thread = threading.Thread(target=s.serve_forever) # that thread will start one more thread for each request - thread.daemon = True # exit the server thread when the main thread terminates - thread.start() - logging.info("%s server loop running in thread: %s" % (s.RequestHandlerClass.__name__[:3], thread.name)) - - try: - while 1: - time.sleep(1) - sys.stderr.flush() - sys.stdout.flush() - - except KeyboardInterrupt: - pass - finally: - for s in servers: - s.shutdown() - -if __name__ == '__main__': - main() diff --git a/contrib/chc_seeder/mn_rand_ips.py b/contrib/chc_seeder/mn_rand_ips.py deleted file mode 100644 index 2303b7132..000000000 --- a/contrib/chc_seeder/mn_rand_ips.py +++ /dev/null @@ -1,31 +0,0 @@ -import subprocess -from random import shuffle - -class MNRandIPs: - def __init__(self): - self._mn_ips = [] - self._get_count = 0 - self._RESET_AT_COUNT = 20 - self._len = 0 - pass - - def refresh_mn_ips(self): - ips = [] - result = subprocess.check_output(['sudo', 'interzoned', 'masternode', 'list']) - result = result.replace('\n ', '') - result = result.replace('\n', '') - result = result.replace(' : "ENABLED"', '') - result = result.replace('"', '') - result = result.replace('{', '').replace('}', '') - self._mn_ips = [ ip.split(':')[0] for ip in result.split(',') ] - shuffle( self._mn_ips ) - self._len = len( self._mn_ips ) - - def get_random_x_ips(self, x): - self._get_count += 1 - if self._get_count == self._RESET_AT_COUNT: - self._get_count = 0 - self.refresh_mn_ips() - - for i in range(x): - yield self._mn_ips[ (i*self._get_count) % self._len ] \ No newline at end of file diff --git a/contrib/chc_seeder/setup.sh b/contrib/chc_seeder/setup.sh deleted file mode 100644 index c5a589630..000000000 --- a/contrib/chc_seeder/setup.sh +++ /dev/null @@ -1,4 +0,0 @@ -sudo apt-get install python-setuptools python-dev build-essential -y -sudo easy_install pip -sudo apt-get update -sudo pip install dnslib diff --git a/contrib/contrib.pro b/contrib/contrib.pro deleted file mode 100644 index 350b0ed7e..000000000 --- a/contrib/contrib.pro +++ /dev/null @@ -1,29 +0,0 @@ -###################################################################### -# Automatically generated by qmake (3.0) Do. Aug. 17 18:03:45 2017 -###################################################################### - -TEMPLATE = app -TARGET = contrib -INCLUDEPATH += . - -# Input -HEADERS += ui_aboutdialog.h \ - ui_addressbookpage.h \ - ui_askpassphrasedialog.h \ - ui_coincontroldialog.h \ - ui_darksendconfig.h \ - ui_editaddressdialog.h \ - ui_helpmessagedialog.h \ - ui_intro.h \ - ui_loggerpage.h \ - ui_masternodelist.h \ - ui_openuridialog.h \ - ui_optionsdialog.h \ - ui_overviewpage.h \ - ui_receivecoinsdialog.h \ - ui_receiverequestdialog.h \ - ui_rpcconsole.h \ - ui_sendcoinsdialog.h \ - ui_sendcoinsentry.h \ - ui_signverifymessagedialog.h \ - ui_transactiondescdialog.h diff --git a/contrib/dash-qt.pro b/contrib/dash-qt.pro old mode 100644 new mode 100755 index 52bd5b1dd..3f8f2f5c0 --- a/contrib/dash-qt.pro +++ b/contrib/dash-qt.pro @@ -1,7 +1,5 @@ # lupdate-qt4 ./dash-qt.pro -ts ../src/qt/locale/dash_en.ts -QT += core gui widgets - HEADERS += \ ../src/activemasternode.h \ ../src/addrman.h \ @@ -9,7 +7,7 @@ HEADERS += \ ../src/allocators.h \ ../src/base58.h \ ../src/bignum.h \ - ../src/interzone-config.h \ + ../src/dash-config.h \ ../src/bloom.h \ ../src/chainparams.h \ ../src/checkpoints.h \ @@ -42,20 +40,20 @@ HEADERS += \ ../src/rpcclient.h \ ../src/rpcprotocol.h \ ../src/rpcserver.h \ - ../src/script/script.h \ + ../src/script.h \ ../src/serialize.h \ - ../src/crypto/sph_blake.h \ - ../src/crypto/sph_bmw.h \ - ../src/crypto/sph_cubehash.h \ - ../src/crypto/sph_echo.h \ - ../src/crypto/sph_groestl.h \ - ../src/crypto/sph_jh.h \ - ../src/crypto/sph_keccak.h \ - ../src/crypto/sph_luffa.h \ + ../src/sph_blake.h \ + ../src/sph_bmw.h \ + ../src/sph_cubehash.h \ + ../src/sph_echo.h \ + ../src/sph_groestl.h \ + ../src/sph_jh.h \ + ../src/sph_keccak.h \ + ../src/sph_luffa.h \ ../src/sph_shavite.h \ - ../src/crypto/sph_simd.h \ - ../src/crypto/sph_skein.h \ - ../src/crypto/sph_types.h \ + ../src/sph_simd.h \ + ../src/sph_skein.h \ + ../src/sph_types.h \ ../src/sync.h \ ../src/threadsafety.h \ ../src/tinyformat.h \ @@ -119,42 +117,40 @@ HEADERS += \ ../src/qt/winshutdownmonitor.h \ ../src/qt/test/paymentrequestdata.h \ ../src/qt/test/paymentservertests.h \ - ../src/qt/test/uritests.h \ - ../src/qt/masternodelist.h \ - ../src/qt/loggerpage.h + ../src/qt/test/uritests.h SOURCES += \ ../src/activemasternode.cpp \ ../src/addrman.cpp \ - ../src/crypto/aes_helper.c \ + ../src/aes_helper.c \ ../src/alert.cpp \ ../src/allocators.cpp \ ../src/base58.cpp \ - ../src/crypto/blake.c \ + ../src/blake.c \ ../src/bloom.cpp \ - ../src/crypto/bmw.c \ + ../src/bmw.c \ ../src/chainparams.cpp \ ../src/checkpoints.cpp \ ../src/coins.cpp \ ../src/core.cpp \ ../src/crypter.cpp \ - ../src/crypto/cubehash.c \ - ../src/interzone-cli.cpp \ - ../src/interzoned.cpp \ + ../src/cubehash.c \ + ../src/dash-cli.cpp \ + ../src/dashd.cpp \ ../src/darksend.cpp \ ../src/db.cpp \ - ../src/crypto/echo.c \ - ../src/crypto/groestl.c \ + ../src/echo.c \ + ../src/groestl.c \ ../src/hash.cpp \ ../src/init.cpp \ ../src/instantx.cpp \ - ../src/crypto/jh.c \ - ../src/crypto/keccak.c \ + ../src/jh.c \ + ../src/keccak.c \ ../src/keepass.cpp \ ../src/key.cpp \ ../src/keystore.cpp \ ../src/leveldbwrapper.cpp \ - ../src/crypto/luffa.c \ + ../src/luffa.c \ ../src/main.cpp \ ../src/masternode.cpp \ ../src/masternodeconfig.cpp \ @@ -174,10 +170,10 @@ SOURCES += \ ../src/rpcrawtransaction.cpp \ ../src/rpcserver.cpp \ ../src/rpcwallet.cpp \ - ../src/script/script.cpp \ - ../src/crypto/shavite.c \ - ../src/crypto/simd.c \ - ../src/crypto/skein.c \ + ../src/script.cpp \ + ../src/shavite.c \ + ../src/simd.c \ + ../src/skein.c \ ../src/sync.cpp \ ../src/txdb.cpp \ ../src/txmempool.cpp \ @@ -217,7 +213,7 @@ SOURCES += \ ../src/test/serialize_tests.cpp \ ../src/test/sighash_tests.cpp \ ../src/test/sigopcount_tests.cpp \ - ../src/test/test_interzone.cpp \ + ../src/test/test_dash.cpp \ ../src/test/transaction_tests.cpp \ ../src/test/uint256_tests.cpp \ ../src/test/util_tests.cpp \ @@ -228,13 +224,13 @@ SOURCES += \ ../src/qt/bitcoinaddressvalidator.cpp \ ../src/qt/bitcoinamountfield.cpp \ ../src/qt/bitcoingui.cpp \ - ../src/qt/interzonestrings.cpp \ + ../src/qt/dashstrings.cpp \ ../src/qt/bitcoinunits.cpp \ ../src/qt/clientmodel.cpp \ ../src/qt/coincontroldialog.cpp \ ../src/qt/coincontroltreewidget.cpp \ ../src/qt/csvmodelwriter.cpp \ - ../src/qt/interzone.cpp \ + ../src/qt/dash.cpp \ ../src/qt/darksendconfig.cpp \ ../src/qt/editaddressdialog.cpp \ ../src/qt/guiutil.cpp \ @@ -257,8 +253,6 @@ SOURCES += \ ../src/qt/moc_macdockiconhandler.cpp \ ../src/qt/moc_macnotificationhandler.cpp \ ../src/qt/moc_monitoreddatamapper.cpp \ - ../src/qt/moc_masternodelist.cpp \ - ../src/qt/moc_loggerpage.cpp \ ../src/qt/moc_notificator.cpp \ ../src/qt/moc_openuridialog.cpp \ ../src/qt/moc_optionsdialog.cpp \ @@ -294,7 +288,7 @@ SOURCES += \ ../src/qt/paymentrequest.pb.cc \ ../src/qt/paymentrequestplus.cpp \ ../src/qt/paymentserver.cpp \ - ../src/qt/qrc_interzone.cpp \ + ../src/qt/qrc_dash.cpp \ ../src/qt/qvalidatedlineedit.cpp \ ../src/qt/qvaluecombobox.cpp \ ../src/qt/receivecoinsdialog.cpp \ @@ -322,9 +316,7 @@ SOURCES += \ ../src/qt/test/moc_uritests.cpp \ ../src/qt/test/paymentservertests.cpp \ ../src/qt/test/test_main.cpp \ - ../src/qt/test/uritests.cpp \ - ../src/qt/masternodelist.cpp \ - ../src/qt/loggerpage.cpp + ../src/qt/test/uritests.cpp FORMS += \ ../src/qt/forms/aboutdialog.ui \ @@ -344,9 +336,7 @@ FORMS += \ ../src/qt/forms/sendcoinsdialog.ui \ ../src/qt/forms/sendcoinsentry.ui \ ../src/qt/forms/signverifymessagedialog.ui \ - ../src/qt/forms/transactiondescdialog.ui \ - ../src/qt/forms/masternodelist.ui \ - ../src/qt/forms/loggerpage.ui + ../src/qt/forms/transactiondescdialog.ui RESOURCES += \ - ../src/qt/interzone.qrc + ../src/qt/dash.qrc diff --git a/contrib/debian/README.md b/contrib/debian/README.md old mode 100644 new mode 100755 diff --git a/contrib/debian/changelog b/contrib/debian/changelog old mode 100644 new mode 100755 diff --git a/contrib/debian/compat b/contrib/debian/compat old mode 100644 new mode 100755 diff --git a/contrib/debian/control b/contrib/debian/control old mode 100644 new mode 100755 diff --git a/contrib/debian/copyright b/contrib/debian/copyright old mode 100644 new mode 100755 diff --git a/contrib/debian/dash-qt.desktop b/contrib/debian/dash-qt.desktop old mode 100644 new mode 100755 diff --git a/contrib/debian/dash-qt.install b/contrib/debian/dash-qt.install old mode 100644 new mode 100755 diff --git a/contrib/debian/dash-qt.lintian-overrides b/contrib/debian/dash-qt.lintian-overrides old mode 100644 new mode 100755 diff --git a/contrib/debian/dash-qt.protocol b/contrib/debian/dash-qt.protocol old mode 100644 new mode 100755 diff --git a/contrib/debian/dashd.bash-completion b/contrib/debian/dashd.bash-completion old mode 100644 new mode 100755 diff --git a/contrib/debian/dashd.examples b/contrib/debian/dashd.examples old mode 100644 new mode 100755 diff --git a/contrib/debian/dashd.install b/contrib/debian/dashd.install old mode 100644 new mode 100755 diff --git a/contrib/debian/dashd.lintian-overrides b/contrib/debian/dashd.lintian-overrides old mode 100644 new mode 100755 diff --git a/contrib/debian/dashd.manpages b/contrib/debian/dashd.manpages old mode 100644 new mode 100755 diff --git a/contrib/debian/examples/dash.conf b/contrib/debian/examples/dash.conf old mode 100644 new mode 100755 diff --git a/contrib/debian/gbp.conf b/contrib/debian/gbp.conf old mode 100644 new mode 100755 diff --git a/contrib/debian/manpages/dash-qt.1 b/contrib/debian/manpages/dash-qt.1 old mode 100644 new mode 100755 diff --git a/contrib/debian/manpages/dash.conf.5 b/contrib/debian/manpages/dash.conf.5 old mode 100644 new mode 100755 diff --git a/contrib/debian/manpages/dashd.1 b/contrib/debian/manpages/dashd.1 old mode 100644 new mode 100755 diff --git a/contrib/debian/patches/README b/contrib/debian/patches/README old mode 100644 new mode 100755 diff --git a/contrib/debian/patches/series b/contrib/debian/patches/series old mode 100644 new mode 100755 diff --git a/contrib/debian/source/format b/contrib/debian/source/format old mode 100644 new mode 100755 diff --git a/contrib/debian/watch b/contrib/debian/watch old mode 100644 new mode 100755 diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/boost-linux.yml b/contrib/gitian-descriptors/boost-linux.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/boost-win.yml b/contrib/gitian-descriptors/boost-win.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/deps-win.yml b/contrib/gitian-descriptors/deps-win.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/gitian-osx-depends.yml b/contrib/gitian-descriptors/gitian-osx-depends.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/gitian-osx-native.yml b/contrib/gitian-descriptors/gitian-osx-native.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/gitian-osx-qt.yml b/contrib/gitian-descriptors/gitian-osx-qt.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/protobuf-win.yml b/contrib/gitian-descriptors/protobuf-win.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/qt-linux.yml b/contrib/gitian-descriptors/qt-linux.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-descriptors/qt-win.yml b/contrib/gitian-descriptors/qt-win.yml old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/aschildbach-key.pgp b/contrib/gitian-downloader/aschildbach-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/bluematt-key.pgp b/contrib/gitian-downloader/bluematt-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/devrandom-key.pgp b/contrib/gitian-downloader/devrandom-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/gavinandresen-key.pgp b/contrib/gitian-downloader/gavinandresen-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/laanwj-key.pgp b/contrib/gitian-downloader/laanwj-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/luke-jr-key.pgp b/contrib/gitian-downloader/luke-jr-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/michagogo-key.pgp b/contrib/gitian-downloader/michagogo-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/sipa-key.pgp b/contrib/gitian-downloader/sipa-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/tcatm-key.pgp b/contrib/gitian-downloader/tcatm-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/win32-download-config b/contrib/gitian-downloader/win32-download-config old mode 100644 new mode 100755 diff --git a/contrib/gitian-downloader/wtogami-key.pgp b/contrib/gitian-downloader/wtogami-key.pgp old mode 100644 new mode 100755 diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md old mode 100644 new mode 100755 diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg old mode 100644 new mode 100755 diff --git a/contrib/linearize/linearize.py b/contrib/linearize/linearize.py old mode 100644 new mode 100755 diff --git a/contrib/macdeploy/DS_Store b/contrib/macdeploy/DS_Store old mode 100644 new mode 100755 diff --git a/contrib/macdeploy/LICENSE b/contrib/macdeploy/LICENSE old mode 100644 new mode 100755 diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md old mode 100644 new mode 100755 diff --git a/contrib/macdeploy/background.psd b/contrib/macdeploy/background.psd old mode 100644 new mode 100755 diff --git a/contrib/macdeploy/fancy.plist b/contrib/macdeploy/fancy.plist old mode 100644 new mode 100755 diff --git a/contrib/pyminer/README.md b/contrib/pyminer/README.md old mode 100644 new mode 100755 diff --git a/contrib/pyminer/example-config.cfg b/contrib/pyminer/example-config.cfg old mode 100644 new mode 100755 diff --git a/contrib/qos/README.md b/contrib/qos/README.md old mode 100644 new mode 100755 diff --git a/contrib/qos/tc.sh b/contrib/qos/tc.sh old mode 100644 new mode 100755 diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md old mode 100644 new mode 100755 diff --git a/contrib/spendfrom/README.md b/contrib/spendfrom/README.md old mode 100644 new mode 100755 diff --git a/contrib/spendfrom/setup.py b/contrib/spendfrom/setup.py old mode 100644 new mode 100755 diff --git a/contrib/test-patches/README.md b/contrib/test-patches/README.md old mode 100644 new mode 100755 diff --git a/contrib/testgen/README.md b/contrib/testgen/README.md old mode 100644 new mode 100755 diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py old mode 100644 new mode 100755 diff --git a/contrib/ui_aboutdialog.h b/contrib/ui_aboutdialog.h deleted file mode 100644 index 5a5b2436c..000000000 --- a/contrib/ui_aboutdialog.h +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'aboutdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_ABOUTDIALOG_H -#define UI_ABOUTDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_AboutDialog -{ -public: - QHBoxLayout *horizontalLayout_2; - QLabel *label_4; - QVBoxLayout *verticalLayout_2; - QSpacerItem *verticalSpacer_2; - QHBoxLayout *horizontalLayout; - QLabel *label; - QLabel *versionLabel; - QSpacerItem *horizontalSpacer; - QLabel *copyrightLabel; - QLabel *label_2; - QSpacerItem *verticalSpacer; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *AboutDialog) - { - if (AboutDialog->objectName().isEmpty()) - AboutDialog->setObjectName(QStringLiteral("AboutDialog")); - AboutDialog->resize(992, 319); - horizontalLayout_2 = new QHBoxLayout(AboutDialog); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - label_4 = new QLabel(AboutDialog); - label_4->setObjectName(QStringLiteral("label_4")); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(label_4->sizePolicy().hasHeightForWidth()); - label_4->setSizePolicy(sizePolicy); - label_4->setPixmap(QPixmap(QString::fromUtf8(":/images/about"))); - - horizontalLayout_2->addWidget(label_4); - - verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_2->addItem(verticalSpacer_2); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - label = new QLabel(AboutDialog); - label->setObjectName(QStringLiteral("label")); - label->setCursor(QCursor(Qt::IBeamCursor)); - label->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - horizontalLayout->addWidget(label); - - versionLabel = new QLabel(AboutDialog); - versionLabel->setObjectName(QStringLiteral("versionLabel")); - versionLabel->setCursor(QCursor(Qt::IBeamCursor)); - versionLabel->setText(QStringLiteral("0.3.666-beta")); - versionLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - horizontalLayout->addWidget(versionLabel); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout->addItem(horizontalSpacer); - - - verticalLayout_2->addLayout(horizontalLayout); - - copyrightLabel = new QLabel(AboutDialog); - copyrightLabel->setObjectName(QStringLiteral("copyrightLabel")); - copyrightLabel->setCursor(QCursor(Qt::IBeamCursor)); - copyrightLabel->setTextFormat(Qt::RichText); - copyrightLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - verticalLayout_2->addWidget(copyrightLabel); - - label_2 = new QLabel(AboutDialog); - label_2->setObjectName(QStringLiteral("label_2")); - label_2->setCursor(QCursor(Qt::IBeamCursor)); - label_2->setWordWrap(true); - label_2->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - verticalLayout_2->addWidget(label_2); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_2->addItem(verticalSpacer); - - buttonBox = new QDialogButtonBox(AboutDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Ok); - - verticalLayout_2->addWidget(buttonBox); - - - horizontalLayout_2->addLayout(verticalLayout_2); - - - retranslateUi(AboutDialog); - QObject::connect(buttonBox, SIGNAL(accepted()), AboutDialog, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), AboutDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(AboutDialog); - } // setupUi - - void retranslateUi(QDialog *AboutDialog) - { - AboutDialog->setWindowTitle(QApplication::translate("AboutDialog", "About Interzone Core", 0)); - label->setText(QApplication::translate("AboutDialog", "Interzone Core version", 0)); - copyrightLabel->setText(QApplication::translate("AboutDialog", "Copyright © 2009-2014 The Bitcoin Core developers.\n" -"Copyright © 2014-YYYY The Dash Core developers.\n" -"Copyright © 2014-YYYY The Interzone Core developers.", 0)); - label_2->setText(QApplication::translate("AboutDialog", "\n" -"This is experimental software.\n" -"\n" -"Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\n" -"\n" -"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.", 0)); - } // retranslateUi - -}; - -namespace Ui { - class AboutDialog: public Ui_AboutDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_ABOUTDIALOG_H diff --git a/contrib/ui_addressbookpage.h b/contrib/ui_addressbookpage.h deleted file mode 100644 index bef0b4ac0..000000000 --- a/contrib/ui_addressbookpage.h +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'addressbookpage.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_ADDRESSBOOKPAGE_H -#define UI_ADDRESSBOOKPAGE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_AddressBookPage -{ -public: - QVBoxLayout *verticalLayout; - QLabel *labelExplanation; - QTableView *tableView; - QHBoxLayout *horizontalLayout; - QPushButton *newAddress; - QPushButton *copyAddress; - QPushButton *deleteAddress; - QSpacerItem *horizontalSpacer; - QPushButton *exportButton; - QPushButton *closeButton; - - void setupUi(QWidget *AddressBookPage) - { - if (AddressBookPage->objectName().isEmpty()) - AddressBookPage->setObjectName(QStringLiteral("AddressBookPage")); - AddressBookPage->resize(760, 380); - verticalLayout = new QVBoxLayout(AddressBookPage); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - labelExplanation = new QLabel(AddressBookPage); - labelExplanation->setObjectName(QStringLiteral("labelExplanation")); - labelExplanation->setTextFormat(Qt::PlainText); - labelExplanation->setWordWrap(true); - - verticalLayout->addWidget(labelExplanation); - - tableView = new QTableView(AddressBookPage); - tableView->setObjectName(QStringLiteral("tableView")); - tableView->setContextMenuPolicy(Qt::CustomContextMenu); - tableView->setTabKeyNavigation(false); - tableView->setAlternatingRowColors(true); - tableView->setSelectionMode(QAbstractItemView::SingleSelection); - tableView->setSelectionBehavior(QAbstractItemView::SelectRows); - tableView->setSortingEnabled(true); - tableView->verticalHeader()->setVisible(false); - - verticalLayout->addWidget(tableView); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - newAddress = new QPushButton(AddressBookPage); - newAddress->setObjectName(QStringLiteral("newAddress")); - QIcon icon; - icon.addFile(QStringLiteral(":/icons/add"), QSize(), QIcon::Normal, QIcon::Off); - newAddress->setIcon(icon); - - horizontalLayout->addWidget(newAddress); - - copyAddress = new QPushButton(AddressBookPage); - copyAddress->setObjectName(QStringLiteral("copyAddress")); - QIcon icon1; - icon1.addFile(QStringLiteral(":/icons/editcopy"), QSize(), QIcon::Normal, QIcon::Off); - copyAddress->setIcon(icon1); - - horizontalLayout->addWidget(copyAddress); - - deleteAddress = new QPushButton(AddressBookPage); - deleteAddress->setObjectName(QStringLiteral("deleteAddress")); - QIcon icon2; - icon2.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); - deleteAddress->setIcon(icon2); - - horizontalLayout->addWidget(deleteAddress); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout->addItem(horizontalSpacer); - - exportButton = new QPushButton(AddressBookPage); - exportButton->setObjectName(QStringLiteral("exportButton")); - QIcon icon3; - icon3.addFile(QStringLiteral(":/icons/export"), QSize(), QIcon::Normal, QIcon::Off); - exportButton->setIcon(icon3); - - horizontalLayout->addWidget(exportButton); - - closeButton = new QPushButton(AddressBookPage); - closeButton->setObjectName(QStringLiteral("closeButton")); - QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(closeButton->sizePolicy().hasHeightForWidth()); - closeButton->setSizePolicy(sizePolicy); - - horizontalLayout->addWidget(closeButton); - - - verticalLayout->addLayout(horizontalLayout); - - - retranslateUi(AddressBookPage); - - QMetaObject::connectSlotsByName(AddressBookPage); - } // setupUi - - void retranslateUi(QWidget *AddressBookPage) - { -#ifndef QT_NO_TOOLTIP - tableView->setToolTip(QApplication::translate("AddressBookPage", "Double-click to edit address or label", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newAddress->setToolTip(QApplication::translate("AddressBookPage", "Create a new address", 0)); -#endif // QT_NO_TOOLTIP - newAddress->setText(QApplication::translate("AddressBookPage", "&New", 0)); -#ifndef QT_NO_TOOLTIP - copyAddress->setToolTip(QApplication::translate("AddressBookPage", "Copy the currently selected address to the system clipboard", 0)); -#endif // QT_NO_TOOLTIP - copyAddress->setText(QApplication::translate("AddressBookPage", "&Copy", 0)); -#ifndef QT_NO_TOOLTIP - deleteAddress->setToolTip(QApplication::translate("AddressBookPage", "Delete the currently selected address from the list", 0)); -#endif // QT_NO_TOOLTIP - deleteAddress->setText(QApplication::translate("AddressBookPage", "&Delete", 0)); -#ifndef QT_NO_TOOLTIP - exportButton->setToolTip(QApplication::translate("AddressBookPage", "Export the data in the current tab to a file", 0)); -#endif // QT_NO_TOOLTIP - exportButton->setText(QApplication::translate("AddressBookPage", "&Export", 0)); - closeButton->setText(QApplication::translate("AddressBookPage", "C&lose", 0)); - Q_UNUSED(AddressBookPage); - } // retranslateUi - -}; - -namespace Ui { - class AddressBookPage: public Ui_AddressBookPage {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_ADDRESSBOOKPAGE_H diff --git a/contrib/ui_askpassphrasedialog.h b/contrib/ui_askpassphrasedialog.h deleted file mode 100644 index 86a5f2038..000000000 --- a/contrib/ui_askpassphrasedialog.h +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'askpassphrasedialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_ASKPASSPHRASEDIALOG_H -#define UI_ASKPASSPHRASEDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_AskPassphraseDialog -{ -public: - QVBoxLayout *verticalLayout; - QLabel *warningLabel; - QFormLayout *formLayout; - QLabel *passLabel1; - QLineEdit *passEdit1; - QLabel *passLabel2; - QLineEdit *passEdit2; - QLabel *passLabel3; - QLineEdit *passEdit3; - QLabel *capsLabel; - QCheckBox *anonymizationCheckBox; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *AskPassphraseDialog) - { - if (AskPassphraseDialog->objectName().isEmpty()) - AskPassphraseDialog->setObjectName(QStringLiteral("AskPassphraseDialog")); - AskPassphraseDialog->resize(598, 198); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(AskPassphraseDialog->sizePolicy().hasHeightForWidth()); - AskPassphraseDialog->setSizePolicy(sizePolicy); - AskPassphraseDialog->setMinimumSize(QSize(550, 0)); - verticalLayout = new QVBoxLayout(AskPassphraseDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - warningLabel = new QLabel(AskPassphraseDialog); - warningLabel->setObjectName(QStringLiteral("warningLabel")); - warningLabel->setTextFormat(Qt::RichText); - warningLabel->setWordWrap(true); - - verticalLayout->addWidget(warningLabel); - - formLayout = new QFormLayout(); - formLayout->setObjectName(QStringLiteral("formLayout")); - formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - passLabel1 = new QLabel(AskPassphraseDialog); - passLabel1->setObjectName(QStringLiteral("passLabel1")); - - formLayout->setWidget(0, QFormLayout::LabelRole, passLabel1); - - passEdit1 = new QLineEdit(AskPassphraseDialog); - passEdit1->setObjectName(QStringLiteral("passEdit1")); - passEdit1->setEchoMode(QLineEdit::Password); - - formLayout->setWidget(0, QFormLayout::FieldRole, passEdit1); - - passLabel2 = new QLabel(AskPassphraseDialog); - passLabel2->setObjectName(QStringLiteral("passLabel2")); - - formLayout->setWidget(1, QFormLayout::LabelRole, passLabel2); - - passEdit2 = new QLineEdit(AskPassphraseDialog); - passEdit2->setObjectName(QStringLiteral("passEdit2")); - passEdit2->setEchoMode(QLineEdit::Password); - - formLayout->setWidget(1, QFormLayout::FieldRole, passEdit2); - - passLabel3 = new QLabel(AskPassphraseDialog); - passLabel3->setObjectName(QStringLiteral("passLabel3")); - - formLayout->setWidget(2, QFormLayout::LabelRole, passLabel3); - - passEdit3 = new QLineEdit(AskPassphraseDialog); - passEdit3->setObjectName(QStringLiteral("passEdit3")); - passEdit3->setEchoMode(QLineEdit::Password); - - formLayout->setWidget(2, QFormLayout::FieldRole, passEdit3); - - capsLabel = new QLabel(AskPassphraseDialog); - capsLabel->setObjectName(QStringLiteral("capsLabel")); - QFont font; - font.setBold(true); - font.setWeight(75); - capsLabel->setFont(font); - capsLabel->setAlignment(Qt::AlignCenter); - - formLayout->setWidget(3, QFormLayout::FieldRole, capsLabel); - - anonymizationCheckBox = new QCheckBox(AskPassphraseDialog); - anonymizationCheckBox->setObjectName(QStringLiteral("anonymizationCheckBox")); - anonymizationCheckBox->setEnabled(true); - anonymizationCheckBox->setVisible(false); - - formLayout->setWidget(4, QFormLayout::LabelRole, anonymizationCheckBox); - - - verticalLayout->addLayout(formLayout); - - buttonBox = new QDialogButtonBox(AskPassphraseDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - - verticalLayout->addWidget(buttonBox); - - - retranslateUi(AskPassphraseDialog); - QObject::connect(buttonBox, SIGNAL(accepted()), AskPassphraseDialog, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), AskPassphraseDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(AskPassphraseDialog); - } // setupUi - - void retranslateUi(QDialog *AskPassphraseDialog) - { - AskPassphraseDialog->setWindowTitle(QApplication::translate("AskPassphraseDialog", "Passphrase Dialog", 0)); - passLabel1->setText(QApplication::translate("AskPassphraseDialog", "Enter passphrase", 0)); - passLabel2->setText(QApplication::translate("AskPassphraseDialog", "New passphrase", 0)); - passLabel3->setText(QApplication::translate("AskPassphraseDialog", "Repeat new passphrase", 0)); - capsLabel->setText(QString()); -#ifndef QT_NO_TOOLTIP - anonymizationCheckBox->setToolTip(QApplication::translate("AskPassphraseDialog", "Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.", 0)); -#endif // QT_NO_TOOLTIP - anonymizationCheckBox->setText(QApplication::translate("AskPassphraseDialog", "For anonymization only", 0)); - } // retranslateUi - -}; - -namespace Ui { - class AskPassphraseDialog: public Ui_AskPassphraseDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_ASKPASSPHRASEDIALOG_H diff --git a/contrib/ui_coincontroldialog.h b/contrib/ui_coincontroldialog.h deleted file mode 100644 index d9dd99786..000000000 --- a/contrib/ui_coincontroldialog.h +++ /dev/null @@ -1,356 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'coincontroldialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_COINCONTROLDIALOG_H -#define UI_COINCONTROLDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "coincontroltreewidget.h" - -QT_BEGIN_NAMESPACE - -class Ui_CoinControlDialog -{ -public: - QVBoxLayout *verticalLayout; - QHBoxLayout *horizontalLayoutTop; - QFormLayout *formLayoutCoinControl1; - QLabel *labelCoinControlQuantityText; - QLabel *labelCoinControlQuantity; - QLabel *labelCoinControlBytesText; - QLabel *labelCoinControlBytes; - QFormLayout *formLayoutCoinControl2; - QLabel *labelCoinControlAmountText; - QLabel *labelCoinControlAmount; - QLabel *labelCoinControlPriorityText; - QLabel *labelCoinControlPriority; - QFormLayout *formLayoutCoinControl3; - QLabel *labelCoinControlFeeText; - QLabel *labelCoinControlFee; - QLabel *labelCoinControlLowOutputText; - QLabel *labelCoinControlLowOutput; - QFormLayout *formLayoutCoinControl4; - QLabel *labelCoinControlAfterFeeText; - QLabel *labelCoinControlAfterFee; - QLabel *labelCoinControlChangeText; - QLabel *labelCoinControlChange; - QFrame *frame; - QHBoxLayout *horizontalLayout; - QHBoxLayout *horizontalLayoutPanel; - QPushButton *pushButtonSelectAll; - QRadioButton *radioTreeMode; - QRadioButton *radioListMode; - QLabel *labelLocked; - QSpacerItem *horizontalSpacer; - CoinControlTreeWidget *treeWidget; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *CoinControlDialog) - { - if (CoinControlDialog->objectName().isEmpty()) - CoinControlDialog->setObjectName(QStringLiteral("CoinControlDialog")); - CoinControlDialog->resize(1000, 500); - verticalLayout = new QVBoxLayout(CoinControlDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - horizontalLayoutTop = new QHBoxLayout(); - horizontalLayoutTop->setObjectName(QStringLiteral("horizontalLayoutTop")); - horizontalLayoutTop->setContentsMargins(-1, 0, -1, 10); - formLayoutCoinControl1 = new QFormLayout(); - formLayoutCoinControl1->setObjectName(QStringLiteral("formLayoutCoinControl1")); - formLayoutCoinControl1->setHorizontalSpacing(10); - formLayoutCoinControl1->setVerticalSpacing(10); - formLayoutCoinControl1->setContentsMargins(6, -1, 6, -1); - labelCoinControlQuantityText = new QLabel(CoinControlDialog); - labelCoinControlQuantityText->setObjectName(QStringLiteral("labelCoinControlQuantityText")); - QFont font; - font.setBold(true); - font.setWeight(75); - labelCoinControlQuantityText->setFont(font); - - formLayoutCoinControl1->setWidget(0, QFormLayout::LabelRole, labelCoinControlQuantityText); - - labelCoinControlQuantity = new QLabel(CoinControlDialog); - labelCoinControlQuantity->setObjectName(QStringLiteral("labelCoinControlQuantity")); - labelCoinControlQuantity->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlQuantity->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlQuantity->setText(QStringLiteral("0")); - labelCoinControlQuantity->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl1->setWidget(0, QFormLayout::FieldRole, labelCoinControlQuantity); - - labelCoinControlBytesText = new QLabel(CoinControlDialog); - labelCoinControlBytesText->setObjectName(QStringLiteral("labelCoinControlBytesText")); - labelCoinControlBytesText->setFont(font); - - formLayoutCoinControl1->setWidget(1, QFormLayout::LabelRole, labelCoinControlBytesText); - - labelCoinControlBytes = new QLabel(CoinControlDialog); - labelCoinControlBytes->setObjectName(QStringLiteral("labelCoinControlBytes")); - labelCoinControlBytes->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlBytes->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlBytes->setText(QStringLiteral("0")); - labelCoinControlBytes->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl1->setWidget(1, QFormLayout::FieldRole, labelCoinControlBytes); - - - horizontalLayoutTop->addLayout(formLayoutCoinControl1); - - formLayoutCoinControl2 = new QFormLayout(); - formLayoutCoinControl2->setObjectName(QStringLiteral("formLayoutCoinControl2")); - formLayoutCoinControl2->setHorizontalSpacing(10); - formLayoutCoinControl2->setVerticalSpacing(10); - formLayoutCoinControl2->setContentsMargins(6, -1, 6, -1); - labelCoinControlAmountText = new QLabel(CoinControlDialog); - labelCoinControlAmountText->setObjectName(QStringLiteral("labelCoinControlAmountText")); - labelCoinControlAmountText->setFont(font); - - formLayoutCoinControl2->setWidget(0, QFormLayout::LabelRole, labelCoinControlAmountText); - - labelCoinControlAmount = new QLabel(CoinControlDialog); - labelCoinControlAmount->setObjectName(QStringLiteral("labelCoinControlAmount")); - labelCoinControlAmount->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlAmount->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlAmount->setText(QStringLiteral("0.00 DASH")); - labelCoinControlAmount->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl2->setWidget(0, QFormLayout::FieldRole, labelCoinControlAmount); - - labelCoinControlPriorityText = new QLabel(CoinControlDialog); - labelCoinControlPriorityText->setObjectName(QStringLiteral("labelCoinControlPriorityText")); - labelCoinControlPriorityText->setFont(font); - - formLayoutCoinControl2->setWidget(1, QFormLayout::LabelRole, labelCoinControlPriorityText); - - labelCoinControlPriority = new QLabel(CoinControlDialog); - labelCoinControlPriority->setObjectName(QStringLiteral("labelCoinControlPriority")); - labelCoinControlPriority->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlPriority->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlPriority->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl2->setWidget(1, QFormLayout::FieldRole, labelCoinControlPriority); - - - horizontalLayoutTop->addLayout(formLayoutCoinControl2); - - formLayoutCoinControl3 = new QFormLayout(); - formLayoutCoinControl3->setObjectName(QStringLiteral("formLayoutCoinControl3")); - formLayoutCoinControl3->setHorizontalSpacing(10); - formLayoutCoinControl3->setVerticalSpacing(10); - formLayoutCoinControl3->setContentsMargins(6, -1, 6, -1); - labelCoinControlFeeText = new QLabel(CoinControlDialog); - labelCoinControlFeeText->setObjectName(QStringLiteral("labelCoinControlFeeText")); - labelCoinControlFeeText->setFont(font); - - formLayoutCoinControl3->setWidget(0, QFormLayout::LabelRole, labelCoinControlFeeText); - - labelCoinControlFee = new QLabel(CoinControlDialog); - labelCoinControlFee->setObjectName(QStringLiteral("labelCoinControlFee")); - labelCoinControlFee->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlFee->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlFee->setText(QStringLiteral("0.00 DASH")); - labelCoinControlFee->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl3->setWidget(0, QFormLayout::FieldRole, labelCoinControlFee); - - labelCoinControlLowOutputText = new QLabel(CoinControlDialog); - labelCoinControlLowOutputText->setObjectName(QStringLiteral("labelCoinControlLowOutputText")); - labelCoinControlLowOutputText->setEnabled(false); - labelCoinControlLowOutputText->setFont(font); - - formLayoutCoinControl3->setWidget(1, QFormLayout::LabelRole, labelCoinControlLowOutputText); - - labelCoinControlLowOutput = new QLabel(CoinControlDialog); - labelCoinControlLowOutput->setObjectName(QStringLiteral("labelCoinControlLowOutput")); - labelCoinControlLowOutput->setEnabled(false); - labelCoinControlLowOutput->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlLowOutput->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlLowOutput->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl3->setWidget(1, QFormLayout::FieldRole, labelCoinControlLowOutput); - - - horizontalLayoutTop->addLayout(formLayoutCoinControl3); - - formLayoutCoinControl4 = new QFormLayout(); - formLayoutCoinControl4->setObjectName(QStringLiteral("formLayoutCoinControl4")); - formLayoutCoinControl4->setHorizontalSpacing(10); - formLayoutCoinControl4->setVerticalSpacing(10); - formLayoutCoinControl4->setContentsMargins(6, -1, 6, -1); - labelCoinControlAfterFeeText = new QLabel(CoinControlDialog); - labelCoinControlAfterFeeText->setObjectName(QStringLiteral("labelCoinControlAfterFeeText")); - labelCoinControlAfterFeeText->setFont(font); - - formLayoutCoinControl4->setWidget(0, QFormLayout::LabelRole, labelCoinControlAfterFeeText); - - labelCoinControlAfterFee = new QLabel(CoinControlDialog); - labelCoinControlAfterFee->setObjectName(QStringLiteral("labelCoinControlAfterFee")); - labelCoinControlAfterFee->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlAfterFee->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlAfterFee->setText(QStringLiteral("0.00 DASH")); - labelCoinControlAfterFee->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl4->setWidget(0, QFormLayout::FieldRole, labelCoinControlAfterFee); - - labelCoinControlChangeText = new QLabel(CoinControlDialog); - labelCoinControlChangeText->setObjectName(QStringLiteral("labelCoinControlChangeText")); - labelCoinControlChangeText->setEnabled(false); - labelCoinControlChangeText->setFont(font); - - formLayoutCoinControl4->setWidget(1, QFormLayout::LabelRole, labelCoinControlChangeText); - - labelCoinControlChange = new QLabel(CoinControlDialog); - labelCoinControlChange->setObjectName(QStringLiteral("labelCoinControlChange")); - labelCoinControlChange->setEnabled(false); - labelCoinControlChange->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlChange->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlChange->setText(QStringLiteral("0.00 DASH")); - labelCoinControlChange->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl4->setWidget(1, QFormLayout::FieldRole, labelCoinControlChange); - - - horizontalLayoutTop->addLayout(formLayoutCoinControl4); - - - verticalLayout->addLayout(horizontalLayoutTop); - - frame = new QFrame(CoinControlDialog); - frame->setObjectName(QStringLiteral("frame")); - frame->setMinimumSize(QSize(0, 40)); - frame->setFrameShape(QFrame::StyledPanel); - frame->setFrameShadow(QFrame::Sunken); - horizontalLayout = new QHBoxLayout(frame); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - horizontalLayoutPanel = new QHBoxLayout(); - horizontalLayoutPanel->setSpacing(14); - horizontalLayoutPanel->setObjectName(QStringLiteral("horizontalLayoutPanel")); - pushButtonSelectAll = new QPushButton(frame); - pushButtonSelectAll->setObjectName(QStringLiteral("pushButtonSelectAll")); - QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(pushButtonSelectAll->sizePolicy().hasHeightForWidth()); - pushButtonSelectAll->setSizePolicy(sizePolicy); - - horizontalLayoutPanel->addWidget(pushButtonSelectAll); - - radioTreeMode = new QRadioButton(frame); - radioTreeMode->setObjectName(QStringLiteral("radioTreeMode")); - sizePolicy.setHeightForWidth(radioTreeMode->sizePolicy().hasHeightForWidth()); - radioTreeMode->setSizePolicy(sizePolicy); - radioTreeMode->setChecked(true); - - horizontalLayoutPanel->addWidget(radioTreeMode); - - radioListMode = new QRadioButton(frame); - radioListMode->setObjectName(QStringLiteral("radioListMode")); - sizePolicy.setHeightForWidth(radioListMode->sizePolicy().hasHeightForWidth()); - radioListMode->setSizePolicy(sizePolicy); - - horizontalLayoutPanel->addWidget(radioListMode); - - labelLocked = new QLabel(frame); - labelLocked->setObjectName(QStringLiteral("labelLocked")); - - horizontalLayoutPanel->addWidget(labelLocked); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayoutPanel->addItem(horizontalSpacer); - - - horizontalLayout->addLayout(horizontalLayoutPanel); - - - verticalLayout->addWidget(frame); - - treeWidget = new CoinControlTreeWidget(CoinControlDialog); - treeWidget->headerItem()->setText(0, QString()); - treeWidget->headerItem()->setText(8, QString()); - treeWidget->headerItem()->setText(9, QString()); - treeWidget->headerItem()->setText(10, QString()); - treeWidget->headerItem()->setText(11, QString()); - treeWidget->headerItem()->setText(12, QString()); - treeWidget->setObjectName(QStringLiteral("treeWidget")); - treeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - treeWidget->setSortingEnabled(false); - treeWidget->setColumnCount(12); - treeWidget->header()->setProperty("showSortIndicator", QVariant(true)); - treeWidget->header()->setStretchLastSection(false); - - verticalLayout->addWidget(treeWidget); - - buttonBox = new QDialogButtonBox(CoinControlDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - sizePolicy.setHeightForWidth(buttonBox->sizePolicy().hasHeightForWidth()); - buttonBox->setSizePolicy(sizePolicy); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Ok); - - verticalLayout->addWidget(buttonBox); - - - retranslateUi(CoinControlDialog); - - QMetaObject::connectSlotsByName(CoinControlDialog); - } // setupUi - - void retranslateUi(QDialog *CoinControlDialog) - { - CoinControlDialog->setWindowTitle(QApplication::translate("CoinControlDialog", "Coin Control Address Selection", 0)); - labelCoinControlQuantityText->setText(QApplication::translate("CoinControlDialog", "Quantity:", 0)); - labelCoinControlBytesText->setText(QApplication::translate("CoinControlDialog", "Bytes:", 0)); - labelCoinControlAmountText->setText(QApplication::translate("CoinControlDialog", "Amount:", 0)); - labelCoinControlPriorityText->setText(QApplication::translate("CoinControlDialog", "Priority:", 0)); - labelCoinControlPriority->setText(QApplication::translate("CoinControlDialog", "medium", 0)); - labelCoinControlFeeText->setText(QApplication::translate("CoinControlDialog", "Fee:", 0)); - labelCoinControlLowOutputText->setText(QApplication::translate("CoinControlDialog", "Low Output:", 0)); - labelCoinControlLowOutput->setText(QApplication::translate("CoinControlDialog", "no", 0)); - labelCoinControlAfterFeeText->setText(QApplication::translate("CoinControlDialog", "After Fee:", 0)); - labelCoinControlChangeText->setText(QApplication::translate("CoinControlDialog", "Change:", 0)); - pushButtonSelectAll->setText(QApplication::translate("CoinControlDialog", "(un)select all", 0)); - radioTreeMode->setText(QApplication::translate("CoinControlDialog", "Tree mode", 0)); - radioListMode->setText(QApplication::translate("CoinControlDialog", "List mode", 0)); - labelLocked->setText(QApplication::translate("CoinControlDialog", "(1 locked)", 0)); - QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(7, QApplication::translate("CoinControlDialog", "Priority", 0)); - ___qtreewidgetitem->setText(6, QApplication::translate("CoinControlDialog", "Confirmations", 0)); - ___qtreewidgetitem->setText(5, QApplication::translate("CoinControlDialog", "Date", 0)); - ___qtreewidgetitem->setText(4, QApplication::translate("CoinControlDialog", "Darksend Rounds", 0)); - ___qtreewidgetitem->setText(3, QApplication::translate("CoinControlDialog", "Address", 0)); - ___qtreewidgetitem->setText(2, QApplication::translate("CoinControlDialog", "Label", 0)); - ___qtreewidgetitem->setText(1, QApplication::translate("CoinControlDialog", "Amount", 0)); -#ifndef QT_NO_TOOLTIP - ___qtreewidgetitem->setToolTip(6, QApplication::translate("CoinControlDialog", "Confirmed", 0)); -#endif // QT_NO_TOOLTIP - } // retranslateUi - -}; - -namespace Ui { - class CoinControlDialog: public Ui_CoinControlDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_COINCONTROLDIALOG_H diff --git a/contrib/ui_darksendconfig.h b/contrib/ui_darksendconfig.h deleted file mode 100644 index 21dd5987c..000000000 --- a/contrib/ui_darksendconfig.h +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'darksendconfig.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_DARKSENDCONFIG_H -#define UI_DARKSENDCONFIG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_DarksendConfig -{ -public: - QPushButton *buttonBasic; - QPushButton *buttonHigh; - QPushButton *buttonMax; - QLabel *label; - QLabel *label_2; - QLabel *label_3; - QLabel *label_4; - QLabel *label_6; - QLabel *label_7; - QLabel *label_8; - QLabel *label_9; - QFrame *line; - QFrame *line_2; - - void setupUi(QDialog *DarksendConfig) - { - if (DarksendConfig->objectName().isEmpty()) - DarksendConfig->setObjectName(QStringLiteral("DarksendConfig")); - DarksendConfig->resize(630, 307); - buttonBasic = new QPushButton(DarksendConfig); - buttonBasic->setObjectName(QStringLiteral("buttonBasic")); - buttonBasic->setGeometry(QRect(20, 70, 151, 27)); - buttonHigh = new QPushButton(DarksendConfig); - buttonHigh->setObjectName(QStringLiteral("buttonHigh")); - buttonHigh->setGeometry(QRect(20, 140, 151, 27)); - buttonMax = new QPushButton(DarksendConfig); - buttonMax->setObjectName(QStringLiteral("buttonMax")); - buttonMax->setGeometry(QRect(20, 210, 151, 27)); - label = new QLabel(DarksendConfig); - label->setObjectName(QStringLiteral("label")); - label->setGeometry(QRect(30, 20, 571, 31)); - label_2 = new QLabel(DarksendConfig); - label_2->setObjectName(QStringLiteral("label_2")); - label_2->setGeometry(QRect(190, 70, 421, 21)); - label_3 = new QLabel(DarksendConfig); - label_3->setObjectName(QStringLiteral("label_3")); - label_3->setGeometry(QRect(190, 140, 411, 21)); - label_4 = new QLabel(DarksendConfig); - label_4->setObjectName(QStringLiteral("label_4")); - label_4->setGeometry(QRect(190, 210, 421, 21)); - label_6 = new QLabel(DarksendConfig); - label_6->setObjectName(QStringLiteral("label_6")); - label_6->setGeometry(QRect(40, 100, 561, 21)); - label_7 = new QLabel(DarksendConfig); - label_7->setObjectName(QStringLiteral("label_7")); - label_7->setGeometry(QRect(40, 170, 561, 21)); - label_8 = new QLabel(DarksendConfig); - label_8->setObjectName(QStringLiteral("label_8")); - label_8->setGeometry(QRect(40, 240, 561, 21)); - label_9 = new QLabel(DarksendConfig); - label_9->setObjectName(QStringLiteral("label_9")); - label_9->setGeometry(QRect(40, 260, 561, 21)); - line = new QFrame(DarksendConfig); - line->setObjectName(QStringLiteral("line")); - line->setGeometry(QRect(10, 120, 601, 16)); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - line_2 = new QFrame(DarksendConfig); - line_2->setObjectName(QStringLiteral("line_2")); - line_2->setGeometry(QRect(10, 190, 601, 16)); - line_2->setFrameShape(QFrame::HLine); - line_2->setFrameShadow(QFrame::Sunken); - - retranslateUi(DarksendConfig); - - QMetaObject::connectSlotsByName(DarksendConfig); - } // setupUi - - void retranslateUi(QDialog *DarksendConfig) - { - DarksendConfig->setWindowTitle(QApplication::translate("DarksendConfig", "Configure Darksend", 0)); - buttonBasic->setText(QApplication::translate("DarksendConfig", "Basic Privacy", 0)); - buttonHigh->setText(QApplication::translate("DarksendConfig", "High Privacy", 0)); - buttonMax->setText(QApplication::translate("DarksendConfig", "Maximum Privacy", 0)); - label->setText(QApplication::translate("DarksendConfig", "Please select a privacy level.", 0)); - label_2->setText(QApplication::translate("DarksendConfig", "Use 2 separate masternodes to mix funds up to 1000 DASH", 0)); - label_3->setText(QApplication::translate("DarksendConfig", "Use 8 separate masternodes to mix funds up to 1000 DASH", 0)); - label_4->setText(QApplication::translate("DarksendConfig", "Use 16 separate masternodes", 0)); - label_6->setText(QApplication::translate("DarksendConfig", "This option is the quickest and will cost about ~0.025 DASH to anonymize 1000 DASH", 0)); - label_7->setText(QApplication::translate("DarksendConfig", "This option is moderately fast and will cost about 0.05 DASH to anonymize 1000 DASH", 0)); - label_8->setText(QApplication::translate("DarksendConfig", "This is the slowest and most secure option. Using maximum anonymity will cost", 0)); - label_9->setText(QApplication::translate("DarksendConfig", "0.1 DASH per 1000 DASH you anonymize.", 0)); - } // retranslateUi - -}; - -namespace Ui { - class DarksendConfig: public Ui_DarksendConfig {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_DARKSENDCONFIG_H diff --git a/contrib/ui_editaddressdialog.h b/contrib/ui_editaddressdialog.h deleted file mode 100644 index 11a327899..000000000 --- a/contrib/ui_editaddressdialog.h +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'editaddressdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_EDITADDRESSDIALOG_H -#define UI_EDITADDRESSDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "qvalidatedlineedit.h" - -QT_BEGIN_NAMESPACE - -class Ui_EditAddressDialog -{ -public: - QVBoxLayout *verticalLayout; - QFormLayout *formLayout; - QLabel *label; - QLineEdit *labelEdit; - QLabel *label_2; - QValidatedLineEdit *addressEdit; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *EditAddressDialog) - { - if (EditAddressDialog->objectName().isEmpty()) - EditAddressDialog->setObjectName(QStringLiteral("EditAddressDialog")); - EditAddressDialog->resize(457, 126); - verticalLayout = new QVBoxLayout(EditAddressDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - formLayout = new QFormLayout(); - formLayout->setObjectName(QStringLiteral("formLayout")); - formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - label = new QLabel(EditAddressDialog); - label->setObjectName(QStringLiteral("label")); - - formLayout->setWidget(0, QFormLayout::LabelRole, label); - - labelEdit = new QLineEdit(EditAddressDialog); - labelEdit->setObjectName(QStringLiteral("labelEdit")); - - formLayout->setWidget(0, QFormLayout::FieldRole, labelEdit); - - label_2 = new QLabel(EditAddressDialog); - label_2->setObjectName(QStringLiteral("label_2")); - - formLayout->setWidget(1, QFormLayout::LabelRole, label_2); - - addressEdit = new QValidatedLineEdit(EditAddressDialog); - addressEdit->setObjectName(QStringLiteral("addressEdit")); - - formLayout->setWidget(1, QFormLayout::FieldRole, addressEdit); - - - verticalLayout->addLayout(formLayout); - - buttonBox = new QDialogButtonBox(EditAddressDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - - verticalLayout->addWidget(buttonBox); - -#ifndef QT_NO_SHORTCUT - label->setBuddy(labelEdit); - label_2->setBuddy(addressEdit); -#endif // QT_NO_SHORTCUT - - retranslateUi(EditAddressDialog); - QObject::connect(buttonBox, SIGNAL(accepted()), EditAddressDialog, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), EditAddressDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(EditAddressDialog); - } // setupUi - - void retranslateUi(QDialog *EditAddressDialog) - { - EditAddressDialog->setWindowTitle(QApplication::translate("EditAddressDialog", "Edit Address", 0)); - label->setText(QApplication::translate("EditAddressDialog", "&Label", 0)); -#ifndef QT_NO_TOOLTIP - labelEdit->setToolTip(QApplication::translate("EditAddressDialog", "The label associated with this address list entry", 0)); -#endif // QT_NO_TOOLTIP - label_2->setText(QApplication::translate("EditAddressDialog", "&Address", 0)); -#ifndef QT_NO_TOOLTIP - addressEdit->setToolTip(QApplication::translate("EditAddressDialog", "The address associated with this address list entry. This can only be modified for sending addresses.", 0)); -#endif // QT_NO_TOOLTIP - } // retranslateUi - -}; - -namespace Ui { - class EditAddressDialog: public Ui_EditAddressDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_EDITADDRESSDIALOG_H diff --git a/contrib/ui_helpmessagedialog.h b/contrib/ui_helpmessagedialog.h deleted file mode 100644 index 5ba24a06c..000000000 --- a/contrib/ui_helpmessagedialog.h +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'helpmessagedialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_HELPMESSAGEDIALOG_H -#define UI_HELPMESSAGEDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_HelpMessageDialog -{ -public: - QHBoxLayout *horizontalLayout_2; - QLabel *graphic; - QVBoxLayout *verticalLayout; - QScrollArea *scrollArea; - QWidget *scrollAreaWidgetContents; - QVBoxLayout *verticalLayout_2; - QLabel *helpMessageLabel; - QDialogButtonBox *okButton; - - void setupUi(QDialog *HelpMessageDialog) - { - if (HelpMessageDialog->objectName().isEmpty()) - HelpMessageDialog->setObjectName(QStringLiteral("HelpMessageDialog")); - HelpMessageDialog->resize(800, 400); - QFont font; - font.setPointSize(10); - HelpMessageDialog->setFont(font); - horizontalLayout_2 = new QHBoxLayout(HelpMessageDialog); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - graphic = new QLabel(HelpMessageDialog); - graphic->setObjectName(QStringLiteral("graphic")); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(graphic->sizePolicy().hasHeightForWidth()); - graphic->setSizePolicy(sizePolicy); - graphic->setPixmap(QPixmap(QString::fromUtf8(":/images/about"))); - - horizontalLayout_2->addWidget(graphic); - - verticalLayout = new QVBoxLayout(); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - scrollArea = new QScrollArea(HelpMessageDialog); - scrollArea->setObjectName(QStringLiteral("scrollArea")); - scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - scrollArea->setWidgetResizable(true); - scrollAreaWidgetContents = new QWidget(); - scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); - scrollAreaWidgetContents->setGeometry(QRect(0, 0, 659, 348)); - verticalLayout_2 = new QVBoxLayout(scrollAreaWidgetContents); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - helpMessageLabel = new QLabel(scrollAreaWidgetContents); - helpMessageLabel->setObjectName(QStringLiteral("helpMessageLabel")); - QFont font1; - font1.setFamily(QStringLiteral("Terminal")); - helpMessageLabel->setFont(font1); - helpMessageLabel->setCursor(QCursor(Qt::IBeamCursor)); - helpMessageLabel->setTextFormat(Qt::PlainText); - helpMessageLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - verticalLayout_2->addWidget(helpMessageLabel); - - scrollArea->setWidget(scrollAreaWidgetContents); - - verticalLayout->addWidget(scrollArea); - - okButton = new QDialogButtonBox(HelpMessageDialog); - okButton->setObjectName(QStringLiteral("okButton")); - okButton->setOrientation(Qt::Horizontal); - okButton->setStandardButtons(QDialogButtonBox::Ok); - - verticalLayout->addWidget(okButton); - - - horizontalLayout_2->addLayout(verticalLayout); - - - retranslateUi(HelpMessageDialog); - QObject::connect(okButton, SIGNAL(accepted()), HelpMessageDialog, SLOT(accept())); - QObject::connect(okButton, SIGNAL(rejected()), HelpMessageDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(HelpMessageDialog); - } // setupUi - - void retranslateUi(QDialog *HelpMessageDialog) - { - HelpMessageDialog->setWindowTitle(QApplication::translate("HelpMessageDialog", "Interzone Core - Command-line options", 0)); - } // retranslateUi - -}; - -namespace Ui { - class HelpMessageDialog: public Ui_HelpMessageDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_HELPMESSAGEDIALOG_H diff --git a/contrib/ui_intro.h b/contrib/ui_intro.h deleted file mode 100644 index 4ebef4d71..000000000 --- a/contrib/ui_intro.h +++ /dev/null @@ -1,201 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'intro.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_INTRO_H -#define UI_INTRO_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_Intro -{ -public: - QVBoxLayout *verticalLayout; - QLabel *label_2; - QSpacerItem *verticalSpacer_4; - QLabel *label_4; - QLabel *sizeWarningLabel; - QRadioButton *dataDirDefault; - QRadioButton *dataDirCustom; - QHBoxLayout *horizontalLayout; - QSpacerItem *horizontalSpacer; - QVBoxLayout *verticalLayout_2; - QHBoxLayout *horizontalLayout_2; - QLineEdit *dataDirectory; - QPushButton *ellipsisButton; - QSpacerItem *verticalSpacer_3; - QLabel *freeSpace; - QSpacerItem *verticalSpacer_2; - QLabel *errorMessage; - QSpacerItem *verticalSpacer; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *Intro) - { - if (Intro->objectName().isEmpty()) - Intro->setObjectName(QStringLiteral("Intro")); - Intro->resize(674, 363); - verticalLayout = new QVBoxLayout(Intro); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - label_2 = new QLabel(Intro); - label_2->setObjectName(QStringLiteral("label_2")); - label_2->setStyleSheet(QStringLiteral("QLabel { font-style:italic; }")); - label_2->setWordWrap(true); - - verticalLayout->addWidget(label_2); - - verticalSpacer_4 = new QSpacerItem(20, 15, QSizePolicy::Minimum, QSizePolicy::Minimum); - - verticalLayout->addItem(verticalSpacer_4); - - label_4 = new QLabel(Intro); - label_4->setObjectName(QStringLiteral("label_4")); - label_4->setWordWrap(true); - - verticalLayout->addWidget(label_4); - - sizeWarningLabel = new QLabel(Intro); - sizeWarningLabel->setObjectName(QStringLiteral("sizeWarningLabel")); - sizeWarningLabel->setWordWrap(true); - - verticalLayout->addWidget(sizeWarningLabel); - - dataDirDefault = new QRadioButton(Intro); - dataDirDefault->setObjectName(QStringLiteral("dataDirDefault")); - - verticalLayout->addWidget(dataDirDefault); - - dataDirCustom = new QRadioButton(Intro); - dataDirCustom->setObjectName(QStringLiteral("dataDirCustom")); - - verticalLayout->addWidget(dataDirCustom); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setSpacing(0); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - horizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint); - horizontalSpacer = new QSpacerItem(60, 20, QSizePolicy::Fixed, QSizePolicy::Minimum); - - horizontalLayout->addItem(horizontalSpacer); - - verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - verticalLayout_2->setSizeConstraint(QLayout::SetDefaultConstraint); - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - dataDirectory = new QLineEdit(Intro); - dataDirectory->setObjectName(QStringLiteral("dataDirectory")); - - horizontalLayout_2->addWidget(dataDirectory); - - ellipsisButton = new QPushButton(Intro); - ellipsisButton->setObjectName(QStringLiteral("ellipsisButton")); - QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(ellipsisButton->sizePolicy().hasHeightForWidth()); - ellipsisButton->setSizePolicy(sizePolicy); - ellipsisButton->setMaximumSize(QSize(30, 16777215)); - ellipsisButton->setText(QStringLiteral("...")); - ellipsisButton->setAutoDefault(false); - - horizontalLayout_2->addWidget(ellipsisButton); - - - verticalLayout_2->addLayout(horizontalLayout_2); - - verticalSpacer_3 = new QSpacerItem(20, 5, QSizePolicy::Minimum, QSizePolicy::Fixed); - - verticalLayout_2->addItem(verticalSpacer_3); - - freeSpace = new QLabel(Intro); - freeSpace->setObjectName(QStringLiteral("freeSpace")); - QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Expanding); - sizePolicy1.setHorizontalStretch(1); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(freeSpace->sizePolicy().hasHeightForWidth()); - freeSpace->setSizePolicy(sizePolicy1); - freeSpace->setWordWrap(true); - - verticalLayout_2->addWidget(freeSpace); - - verticalSpacer_2 = new QSpacerItem(20, 5, QSizePolicy::Minimum, QSizePolicy::Fixed); - - verticalLayout_2->addItem(verticalSpacer_2); - - errorMessage = new QLabel(Intro); - errorMessage->setObjectName(QStringLiteral("errorMessage")); - QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Expanding); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(errorMessage->sizePolicy().hasHeightForWidth()); - errorMessage->setSizePolicy(sizePolicy2); - errorMessage->setTextFormat(Qt::RichText); - errorMessage->setWordWrap(true); - - verticalLayout_2->addWidget(errorMessage); - - - horizontalLayout->addLayout(verticalLayout_2); - - - verticalLayout->addLayout(horizontalLayout); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout->addItem(verticalSpacer); - - buttonBox = new QDialogButtonBox(Intro); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - - verticalLayout->addWidget(buttonBox); - - - retranslateUi(Intro); - QObject::connect(buttonBox, SIGNAL(accepted()), Intro, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), Intro, SLOT(reject())); - - QMetaObject::connectSlotsByName(Intro); - } // setupUi - - void retranslateUi(QDialog *Intro) - { - Intro->setWindowTitle(QApplication::translate("Intro", "Welcome", 0)); - label_2->setText(QApplication::translate("Intro", "Welcome to Interzone Core.", 0)); - label_4->setText(QApplication::translate("Intro", "As this is the first time the program is launched, you can choose where Interzone Core will store its data.", 0)); - sizeWarningLabel->setText(QApplication::translate("Intro", "Interzone Core will download and store a copy of the Interzone block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.", 0)); - dataDirDefault->setText(QApplication::translate("Intro", "Use the default data directory", 0)); - dataDirCustom->setText(QApplication::translate("Intro", "Use a custom data directory:", 0)); - freeSpace->setText(QString()); - } // retranslateUi - -}; - -namespace Ui { - class Intro: public Ui_Intro {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_INTRO_H diff --git a/contrib/ui_loggerpage.h b/contrib/ui_loggerpage.h deleted file mode 100644 index 42d20230c..000000000 --- a/contrib/ui_loggerpage.h +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'loggerpage.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_LOGGERPAGE_H -#define UI_LOGGERPAGE_H - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_LoggerPage -{ -public: - QTableWidget *tblLogs; - - void setupUi(QWidget *LoggerPage) - { - if (LoggerPage->objectName().isEmpty()) - LoggerPage->setObjectName(QStringLiteral("LoggerPage")); - LoggerPage->resize(1020, 632); - tblLogs = new QTableWidget(LoggerPage); - if (tblLogs->columnCount() < 2) - tblLogs->setColumnCount(2); - tblLogs->setObjectName(QStringLiteral("tblLogs")); - tblLogs->setGeometry(QRect(20, 20, 831, 591)); - tblLogs->setAlternatingRowColors(true); - tblLogs->setColumnCount(2); - - retranslateUi(LoggerPage); - - QMetaObject::connectSlotsByName(LoggerPage); - } // setupUi - - void retranslateUi(QWidget *LoggerPage) - { - LoggerPage->setWindowTitle(QApplication::translate("LoggerPage", "Form", 0)); - } // retranslateUi - -}; - -namespace Ui { - class LoggerPage: public Ui_LoggerPage {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_LOGGERPAGE_H diff --git a/contrib/ui_masternodelist.h b/contrib/ui_masternodelist.h deleted file mode 100644 index d2ed5cf92..000000000 --- a/contrib/ui_masternodelist.h +++ /dev/null @@ -1,304 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'masternodelist.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_MASTERNODELIST_H -#define UI_MASTERNODELIST_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_MasternodeList -{ -public: - QVBoxLayout *topLayout; - QVBoxLayout *verticalLayout; - QSpacerItem *horizontalSpacer0; - QTabWidget *tabWidget; - QWidget *tabMyMasternodes; - QGridLayout *gridLayout_2; - QVBoxLayout *verticalLayout_2; - QHBoxLayout *horizontalLayout_note; - QLabel *updateNote; - QTableWidget *tableWidgetMyMasternodes; - QHBoxLayout *horizontalLayout_5; - QPushButton *startButton; - QPushButton *startAllButton; - QPushButton *startMissingButton; - QPushButton *UpdateButton; - QLabel *autoupdate_label; - QLabel *secondsLabel; - QSpacerItem *horizontalSpacer_5; - QCheckBox *cbxAutoStartMissingMNs; - QWidget *tabAllMasternodes; - QGridLayout *gridLayout; - QTableWidget *tableWidgetMasternodes; - QHBoxLayout *horizontalLayout_3; - QLabel *label_filter; - QLineEdit *filterLineEdit; - QSpacerItem *horizontalSpacer_3; - QLabel *label_count; - QLabel *countLabel; - - void setupUi(QWidget *MasternodeList) - { - if (MasternodeList->objectName().isEmpty()) - MasternodeList->setObjectName(QStringLiteral("MasternodeList")); - MasternodeList->resize(930, 520); - topLayout = new QVBoxLayout(MasternodeList); - topLayout->setObjectName(QStringLiteral("topLayout")); - topLayout->setContentsMargins(0, 0, 0, 0); - verticalLayout = new QVBoxLayout(); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - verticalLayout->setContentsMargins(-1, -1, -1, 0); - horizontalSpacer0 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - verticalLayout->addItem(horizontalSpacer0); - - tabWidget = new QTabWidget(MasternodeList); - tabWidget->setObjectName(QStringLiteral("tabWidget")); - tabMyMasternodes = new QWidget(); - tabMyMasternodes->setObjectName(QStringLiteral("tabMyMasternodes")); - gridLayout_2 = new QGridLayout(tabMyMasternodes); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - verticalLayout_2->setContentsMargins(-1, -1, -1, 0); - horizontalLayout_note = new QHBoxLayout(); - horizontalLayout_note->setObjectName(QStringLiteral("horizontalLayout_note")); - horizontalLayout_note->setContentsMargins(-1, -1, -1, 0); - updateNote = new QLabel(tabMyMasternodes); - updateNote->setObjectName(QStringLiteral("updateNote")); - - horizontalLayout_note->addWidget(updateNote); - - - verticalLayout_2->addLayout(horizontalLayout_note); - - tableWidgetMyMasternodes = new QTableWidget(tabMyMasternodes); - if (tableWidgetMyMasternodes->columnCount() < 7) - tableWidgetMyMasternodes->setColumnCount(7); - QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(0, __qtablewidgetitem); - QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(1, __qtablewidgetitem1); - QTableWidgetItem *__qtablewidgetitem2 = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(2, __qtablewidgetitem2); - QTableWidgetItem *__qtablewidgetitem3 = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(3, __qtablewidgetitem3); - QTableWidgetItem *__qtablewidgetitem4 = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(4, __qtablewidgetitem4); - QTableWidgetItem *__qtablewidgetitem5 = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(5, __qtablewidgetitem5); - QTableWidgetItem *__qtablewidgetitem6 = new QTableWidgetItem(); - tableWidgetMyMasternodes->setHorizontalHeaderItem(6, __qtablewidgetitem6); - tableWidgetMyMasternodes->setObjectName(QStringLiteral("tableWidgetMyMasternodes")); - tableWidgetMyMasternodes->setMinimumSize(QSize(695, 0)); - tableWidgetMyMasternodes->setEditTriggers(QAbstractItemView::NoEditTriggers); - tableWidgetMyMasternodes->setAlternatingRowColors(true); - tableWidgetMyMasternodes->setSelectionMode(QAbstractItemView::SingleSelection); - tableWidgetMyMasternodes->setSelectionBehavior(QAbstractItemView::SelectRows); - tableWidgetMyMasternodes->setSortingEnabled(true); - tableWidgetMyMasternodes->horizontalHeader()->setStretchLastSection(true); - - verticalLayout_2->addWidget(tableWidgetMyMasternodes); - - horizontalLayout_5 = new QHBoxLayout(); - horizontalLayout_5->setObjectName(QStringLiteral("horizontalLayout_5")); - horizontalLayout_5->setContentsMargins(-1, -1, -1, 0); - startButton = new QPushButton(tabMyMasternodes); - startButton->setObjectName(QStringLiteral("startButton")); - - horizontalLayout_5->addWidget(startButton); - - startAllButton = new QPushButton(tabMyMasternodes); - startAllButton->setObjectName(QStringLiteral("startAllButton")); - - horizontalLayout_5->addWidget(startAllButton); - - startMissingButton = new QPushButton(tabMyMasternodes); - startMissingButton->setObjectName(QStringLiteral("startMissingButton")); - - horizontalLayout_5->addWidget(startMissingButton); - - UpdateButton = new QPushButton(tabMyMasternodes); - UpdateButton->setObjectName(QStringLiteral("UpdateButton")); - - horizontalLayout_5->addWidget(UpdateButton); - - autoupdate_label = new QLabel(tabMyMasternodes); - autoupdate_label->setObjectName(QStringLiteral("autoupdate_label")); - - horizontalLayout_5->addWidget(autoupdate_label); - - secondsLabel = new QLabel(tabMyMasternodes); - secondsLabel->setObjectName(QStringLiteral("secondsLabel")); - - horizontalLayout_5->addWidget(secondsLabel); - - horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_5->addItem(horizontalSpacer_5); - - cbxAutoStartMissingMNs = new QCheckBox(tabMyMasternodes); - cbxAutoStartMissingMNs->setObjectName(QStringLiteral("cbxAutoStartMissingMNs")); - - horizontalLayout_5->addWidget(cbxAutoStartMissingMNs); - - - verticalLayout_2->addLayout(horizontalLayout_5); - - - gridLayout_2->addLayout(verticalLayout_2, 0, 0, 1, 1); - - tabWidget->addTab(tabMyMasternodes, QString()); - tabAllMasternodes = new QWidget(); - tabAllMasternodes->setObjectName(QStringLiteral("tabAllMasternodes")); - gridLayout = new QGridLayout(tabAllMasternodes); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - tableWidgetMasternodes = new QTableWidget(tabAllMasternodes); - if (tableWidgetMasternodes->columnCount() < 6) - tableWidgetMasternodes->setColumnCount(6); - QTableWidgetItem *__qtablewidgetitem7 = new QTableWidgetItem(); - tableWidgetMasternodes->setHorizontalHeaderItem(0, __qtablewidgetitem7); - QTableWidgetItem *__qtablewidgetitem8 = new QTableWidgetItem(); - tableWidgetMasternodes->setHorizontalHeaderItem(1, __qtablewidgetitem8); - QTableWidgetItem *__qtablewidgetitem9 = new QTableWidgetItem(); - tableWidgetMasternodes->setHorizontalHeaderItem(2, __qtablewidgetitem9); - QTableWidgetItem *__qtablewidgetitem10 = new QTableWidgetItem(); - tableWidgetMasternodes->setHorizontalHeaderItem(3, __qtablewidgetitem10); - QTableWidgetItem *__qtablewidgetitem11 = new QTableWidgetItem(); - tableWidgetMasternodes->setHorizontalHeaderItem(4, __qtablewidgetitem11); - QTableWidgetItem *__qtablewidgetitem12 = new QTableWidgetItem(); - tableWidgetMasternodes->setHorizontalHeaderItem(5, __qtablewidgetitem12); - tableWidgetMasternodes->setObjectName(QStringLiteral("tableWidgetMasternodes")); - tableWidgetMasternodes->setEditTriggers(QAbstractItemView::NoEditTriggers); - tableWidgetMasternodes->setAlternatingRowColors(true); - tableWidgetMasternodes->setSelectionBehavior(QAbstractItemView::SelectRows); - tableWidgetMasternodes->setSortingEnabled(true); - tableWidgetMasternodes->horizontalHeader()->setStretchLastSection(true); - - gridLayout->addWidget(tableWidgetMasternodes, 1, 0, 1, 1); - - horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); - horizontalLayout_3->setContentsMargins(-1, -1, -1, 0); - label_filter = new QLabel(tabAllMasternodes); - label_filter->setObjectName(QStringLiteral("label_filter")); - - horizontalLayout_3->addWidget(label_filter); - - filterLineEdit = new QLineEdit(tabAllMasternodes); - filterLineEdit->setObjectName(QStringLiteral("filterLineEdit")); - - horizontalLayout_3->addWidget(filterLineEdit); - - horizontalSpacer_3 = new QSpacerItem(10, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_3->addItem(horizontalSpacer_3); - - label_count = new QLabel(tabAllMasternodes); - label_count->setObjectName(QStringLiteral("label_count")); - - horizontalLayout_3->addWidget(label_count); - - countLabel = new QLabel(tabAllMasternodes); - countLabel->setObjectName(QStringLiteral("countLabel")); - - horizontalLayout_3->addWidget(countLabel); - - - gridLayout->addLayout(horizontalLayout_3, 0, 0, 1, 1); - - tabWidget->addTab(tabAllMasternodes, QString()); - - verticalLayout->addWidget(tabWidget); - - - topLayout->addLayout(verticalLayout); - - - retranslateUi(MasternodeList); - - tabWidget->setCurrentIndex(0); - - - QMetaObject::connectSlotsByName(MasternodeList); - } // setupUi - - void retranslateUi(QWidget *MasternodeList) - { - MasternodeList->setWindowTitle(QApplication::translate("MasternodeList", "Form", 0)); - updateNote->setText(QApplication::translate("MasternodeList", "Note: Status of your masternodes in local wallet can potentially be slightly incorrect.
Always wait for wallet to sync additional data and then double check from another node
if your masternode should be running but you still do not see \"ENABLED\" in \"Status\" field.", 0)); - QTableWidgetItem *___qtablewidgetitem = tableWidgetMyMasternodes->horizontalHeaderItem(0); - ___qtablewidgetitem->setText(QApplication::translate("MasternodeList", "Alias", 0)); - QTableWidgetItem *___qtablewidgetitem1 = tableWidgetMyMasternodes->horizontalHeaderItem(1); - ___qtablewidgetitem1->setText(QApplication::translate("MasternodeList", "Address", 0)); - QTableWidgetItem *___qtablewidgetitem2 = tableWidgetMyMasternodes->horizontalHeaderItem(2); - ___qtablewidgetitem2->setText(QApplication::translate("MasternodeList", "Protocol", 0)); - QTableWidgetItem *___qtablewidgetitem3 = tableWidgetMyMasternodes->horizontalHeaderItem(3); - ___qtablewidgetitem3->setText(QApplication::translate("MasternodeList", "Status", 0)); - QTableWidgetItem *___qtablewidgetitem4 = tableWidgetMyMasternodes->horizontalHeaderItem(4); - ___qtablewidgetitem4->setText(QApplication::translate("MasternodeList", "Active", 0)); - QTableWidgetItem *___qtablewidgetitem5 = tableWidgetMyMasternodes->horizontalHeaderItem(5); - ___qtablewidgetitem5->setText(QApplication::translate("MasternodeList", "Last Seen", 0)); - QTableWidgetItem *___qtablewidgetitem6 = tableWidgetMyMasternodes->horizontalHeaderItem(6); - ___qtablewidgetitem6->setText(QApplication::translate("MasternodeList", "Payee", 0)); - startButton->setText(QApplication::translate("MasternodeList", "S&tart alias", 0)); - startAllButton->setText(QApplication::translate("MasternodeList", "Start &all", 0)); - startMissingButton->setText(QApplication::translate("MasternodeList", "Start &MISSING", 0)); - UpdateButton->setText(QApplication::translate("MasternodeList", "&Update status", 0)); - autoupdate_label->setText(QApplication::translate("MasternodeList", "Status will be updated automatically in (sec):", 0)); - secondsLabel->setText(QApplication::translate("MasternodeList", "0", 0)); - cbxAutoStartMissingMNs->setText(QApplication::translate("MasternodeList", "Autostart MISSING", 0)); - tabWidget->setTabText(tabWidget->indexOf(tabMyMasternodes), QApplication::translate("MasternodeList", "My Masternodes", 0)); - QTableWidgetItem *___qtablewidgetitem7 = tableWidgetMasternodes->horizontalHeaderItem(0); - ___qtablewidgetitem7->setText(QApplication::translate("MasternodeList", "Address", 0)); - QTableWidgetItem *___qtablewidgetitem8 = tableWidgetMasternodes->horizontalHeaderItem(1); - ___qtablewidgetitem8->setText(QApplication::translate("MasternodeList", "Protocol", 0)); - QTableWidgetItem *___qtablewidgetitem9 = tableWidgetMasternodes->horizontalHeaderItem(2); - ___qtablewidgetitem9->setText(QApplication::translate("MasternodeList", "Status", 0)); - QTableWidgetItem *___qtablewidgetitem10 = tableWidgetMasternodes->horizontalHeaderItem(3); - ___qtablewidgetitem10->setText(QApplication::translate("MasternodeList", "Active", 0)); - QTableWidgetItem *___qtablewidgetitem11 = tableWidgetMasternodes->horizontalHeaderItem(4); - ___qtablewidgetitem11->setText(QApplication::translate("MasternodeList", "Last Seen", 0)); - QTableWidgetItem *___qtablewidgetitem12 = tableWidgetMasternodes->horizontalHeaderItem(5); - ___qtablewidgetitem12->setText(QApplication::translate("MasternodeList", "Payee", 0)); - label_filter->setText(QApplication::translate("MasternodeList", "Filter List:", 0)); -#ifndef QT_NO_TOOLTIP - filterLineEdit->setToolTip(QApplication::translate("MasternodeList", "Filter masternode list", 0)); -#endif // QT_NO_TOOLTIP - label_count->setText(QApplication::translate("MasternodeList", "Node Count:", 0)); - countLabel->setText(QApplication::translate("MasternodeList", "0", 0)); - tabWidget->setTabText(tabWidget->indexOf(tabAllMasternodes), QApplication::translate("MasternodeList", "All Masternodes", 0)); - } // retranslateUi - -}; - -namespace Ui { - class MasternodeList: public Ui_MasternodeList {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_MASTERNODELIST_H diff --git a/contrib/ui_openuridialog.h b/contrib/ui_openuridialog.h deleted file mode 100644 index 8034d2d85..000000000 --- a/contrib/ui_openuridialog.h +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'openuridialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_OPENURIDIALOG_H -#define UI_OPENURIDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "qvalidatedlineedit.h" - -QT_BEGIN_NAMESPACE - -class Ui_OpenURIDialog -{ -public: - QVBoxLayout *verticalLayout; - QLabel *label_2; - QHBoxLayout *horizontalLayout; - QLabel *label; - QValidatedLineEdit *uriEdit; - QPushButton *selectFileButton; - QSpacerItem *verticalSpacer; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *OpenURIDialog) - { - if (OpenURIDialog->objectName().isEmpty()) - OpenURIDialog->setObjectName(QStringLiteral("OpenURIDialog")); - OpenURIDialog->resize(564, 109); - verticalLayout = new QVBoxLayout(OpenURIDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - label_2 = new QLabel(OpenURIDialog); - label_2->setObjectName(QStringLiteral("label_2")); - - verticalLayout->addWidget(label_2); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - label = new QLabel(OpenURIDialog); - label->setObjectName(QStringLiteral("label")); - - horizontalLayout->addWidget(label); - - uriEdit = new QValidatedLineEdit(OpenURIDialog); - uriEdit->setObjectName(QStringLiteral("uriEdit")); - - horizontalLayout->addWidget(uriEdit); - - selectFileButton = new QPushButton(OpenURIDialog); - selectFileButton->setObjectName(QStringLiteral("selectFileButton")); - selectFileButton->setText(QStringLiteral("...")); - - horizontalLayout->addWidget(selectFileButton); - - - verticalLayout->addLayout(horizontalLayout); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout->addItem(verticalSpacer); - - buttonBox = new QDialogButtonBox(OpenURIDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - - verticalLayout->addWidget(buttonBox); - - - retranslateUi(OpenURIDialog); - QObject::connect(buttonBox, SIGNAL(accepted()), OpenURIDialog, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), OpenURIDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(OpenURIDialog); - } // setupUi - - void retranslateUi(QDialog *OpenURIDialog) - { - OpenURIDialog->setWindowTitle(QApplication::translate("OpenURIDialog", "Open URI", 0)); - label_2->setText(QApplication::translate("OpenURIDialog", "Open payment request from URI or file", 0)); - label->setText(QApplication::translate("OpenURIDialog", "URI:", 0)); -#ifndef QT_NO_TOOLTIP - selectFileButton->setToolTip(QApplication::translate("OpenURIDialog", "Select payment request file", 0)); -#endif // QT_NO_TOOLTIP - } // retranslateUi - -}; - -namespace Ui { - class OpenURIDialog: public Ui_OpenURIDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_OPENURIDIALOG_H diff --git a/contrib/ui_optionsdialog.h b/contrib/ui_optionsdialog.h deleted file mode 100644 index b15257d23..000000000 --- a/contrib/ui_optionsdialog.h +++ /dev/null @@ -1,681 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'optionsdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_OPTIONSDIALOG_H -#define UI_OPTIONSDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "bitcoinamountfield.h" -#include "qvalidatedlineedit.h" -#include "qvaluecombobox.h" - -QT_BEGIN_NAMESPACE - -class Ui_OptionsDialog -{ -public: - QVBoxLayout *verticalLayout; - QTabWidget *tabWidget; - QWidget *tabMain; - QVBoxLayout *verticalLayout_Main; - QCheckBox *bitcoinAtStartup; - QHBoxLayout *horizontalLayout_2_Main; - QLabel *databaseCacheLabel; - QSpinBox *databaseCache; - QLabel *databaseCacheUnitLabel; - QSpacerItem *horizontalSpacer_2_Main; - QHBoxLayout *horizontalLayout_3_Main; - QLabel *threadsScriptVerifLabel; - QSpinBox *threadsScriptVerif; - QSpacerItem *horizontalSpacer_3_Main; - QSpacerItem *verticalSpacer_Main; - QHBoxLayout *horizontalLayout_2_Main1; - QLabel *label; - QSpinBox *darksendRounds; - QHBoxLayout *horizontalLayout; - QLabel *label_2; - QSpinBox *anonymizeDarkcoin; - QWidget *tabWallet; - QVBoxLayout *verticalLayout_Wallet; - QLabel *transactionFeeInfoLabel; - QHBoxLayout *horizontalLayout_1_Wallet; - QLabel *transactionFeeLabel; - BitcoinAmountField *transactionFee; - QSpacerItem *horizontalSpacer_1_Wallet; - QSpacerItem *verticalSpacer_Wallet; - QGroupBox *groupBox; - QVBoxLayout *verticalLayout_2; - QCheckBox *coinControlFeatures; - QCheckBox *spendZeroConfChange; - QWidget *tabNetwork; - QVBoxLayout *verticalLayout_Network; - QCheckBox *mapPortUpnp; - QCheckBox *connectSocks; - QHBoxLayout *horizontalLayout_1_Network; - QLabel *proxyIpLabel; - QValidatedLineEdit *proxyIp; - QLabel *proxyPortLabel; - QLineEdit *proxyPort; - QLabel *socksVersionLabel; - QValueComboBox *socksVersion; - QSpacerItem *horizontalSpacer_1_Network; - QSpacerItem *verticalSpacer_Network; - QWidget *tabWindow; - QVBoxLayout *verticalLayout_Window; - QCheckBox *minimizeToTray; - QCheckBox *minimizeOnClose; - QSpacerItem *verticalSpacer_Window; - QWidget *tabDisplay; - QVBoxLayout *verticalLayout_Display; - QHBoxLayout *horizontalLayout_1_Display; - QLabel *langLabel; - QValueComboBox *lang; - QLabel *label_3; - QHBoxLayout *horizontalLayout_4_Display; - QLabel *themeLabel; - QValueComboBox *theme; - QFrame *line; - QHBoxLayout *horizontalLayout_2_Display; - QLabel *unitLabel; - QValueComboBox *unit; - QCheckBox *displayAddresses; - QHBoxLayout *horizontalLayout_3_Display; - QLabel *thirdPartyTxUrlsLabel; - QLineEdit *thirdPartyTxUrls; - QSpacerItem *verticalSpacer; - QFrame *frame; - QVBoxLayout *verticalLayout_Bottom; - QHBoxLayout *horizontalLayout_Bottom; - QLabel *overriddenByCommandLineInfoLabel; - QSpacerItem *horizontalSpacer_Bottom; - QLabel *overriddenByCommandLineLabel; - QHBoxLayout *horizontalLayout_Buttons; - QPushButton *resetButton; - QSpacerItem *horizontalSpacer_1; - QLabel *statusLabel; - QSpacerItem *horizontalSpacer_2; - QPushButton *okButton; - QPushButton *cancelButton; - - void setupUi(QDialog *OptionsDialog) - { - if (OptionsDialog->objectName().isEmpty()) - OptionsDialog->setObjectName(QStringLiteral("OptionsDialog")); - OptionsDialog->resize(576, 402); - OptionsDialog->setModal(true); - verticalLayout = new QVBoxLayout(OptionsDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - tabWidget = new QTabWidget(OptionsDialog); - tabWidget->setObjectName(QStringLiteral("tabWidget")); - tabMain = new QWidget(); - tabMain->setObjectName(QStringLiteral("tabMain")); - verticalLayout_Main = new QVBoxLayout(tabMain); - verticalLayout_Main->setObjectName(QStringLiteral("verticalLayout_Main")); - bitcoinAtStartup = new QCheckBox(tabMain); - bitcoinAtStartup->setObjectName(QStringLiteral("bitcoinAtStartup")); - - verticalLayout_Main->addWidget(bitcoinAtStartup); - - horizontalLayout_2_Main = new QHBoxLayout(); - horizontalLayout_2_Main->setObjectName(QStringLiteral("horizontalLayout_2_Main")); - databaseCacheLabel = new QLabel(tabMain); - databaseCacheLabel->setObjectName(QStringLiteral("databaseCacheLabel")); - databaseCacheLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_2_Main->addWidget(databaseCacheLabel); - - databaseCache = new QSpinBox(tabMain); - databaseCache->setObjectName(QStringLiteral("databaseCache")); - - horizontalLayout_2_Main->addWidget(databaseCache); - - databaseCacheUnitLabel = new QLabel(tabMain); - databaseCacheUnitLabel->setObjectName(QStringLiteral("databaseCacheUnitLabel")); - databaseCacheUnitLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_2_Main->addWidget(databaseCacheUnitLabel); - - horizontalSpacer_2_Main = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_2_Main->addItem(horizontalSpacer_2_Main); - - - verticalLayout_Main->addLayout(horizontalLayout_2_Main); - - horizontalLayout_3_Main = new QHBoxLayout(); - horizontalLayout_3_Main->setObjectName(QStringLiteral("horizontalLayout_3_Main")); - threadsScriptVerifLabel = new QLabel(tabMain); - threadsScriptVerifLabel->setObjectName(QStringLiteral("threadsScriptVerifLabel")); - threadsScriptVerifLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_3_Main->addWidget(threadsScriptVerifLabel); - - threadsScriptVerif = new QSpinBox(tabMain); - threadsScriptVerif->setObjectName(QStringLiteral("threadsScriptVerif")); - - horizontalLayout_3_Main->addWidget(threadsScriptVerif); - - horizontalSpacer_3_Main = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_3_Main->addItem(horizontalSpacer_3_Main); - - - verticalLayout_Main->addLayout(horizontalLayout_3_Main); - - verticalSpacer_Main = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_Main->addItem(verticalSpacer_Main); - - horizontalLayout_2_Main1 = new QHBoxLayout(); - horizontalLayout_2_Main1->setObjectName(QStringLiteral("horizontalLayout_2_Main1")); - label = new QLabel(tabMain); - label->setObjectName(QStringLiteral("label")); - - horizontalLayout_2_Main1->addWidget(label); - - darksendRounds = new QSpinBox(tabMain); - darksendRounds->setObjectName(QStringLiteral("darksendRounds")); - darksendRounds->setMinimum(2); - darksendRounds->setMaximum(8); - darksendRounds->setValue(4); - - horizontalLayout_2_Main1->addWidget(darksendRounds); - - - verticalLayout_Main->addLayout(horizontalLayout_2_Main1); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - label_2 = new QLabel(tabMain); - label_2->setObjectName(QStringLiteral("label_2")); -#ifndef QT_NO_STATUSTIP - label_2->setStatusTip(QStringLiteral("")); -#endif // QT_NO_STATUSTIP -#ifndef QT_NO_WHATSTHIS - label_2->setWhatsThis(QStringLiteral("")); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_ACCESSIBILITY - label_2->setAccessibleName(QStringLiteral("")); -#endif // QT_NO_ACCESSIBILITY -#ifndef QT_NO_ACCESSIBILITY - label_2->setAccessibleDescription(QStringLiteral("")); -#endif // QT_NO_ACCESSIBILITY - - horizontalLayout->addWidget(label_2); - - anonymizeDarkcoin = new QSpinBox(tabMain); - anonymizeDarkcoin->setObjectName(QStringLiteral("anonymizeDarkcoin")); - anonymizeDarkcoin->setMinimum(2); - anonymizeDarkcoin->setMaximum(2000); - anonymizeDarkcoin->setSingleStep(10); - anonymizeDarkcoin->setValue(1000); - - horizontalLayout->addWidget(anonymizeDarkcoin); - - - verticalLayout_Main->addLayout(horizontalLayout); - - tabWidget->addTab(tabMain, QString()); - tabWallet = new QWidget(); - tabWallet->setObjectName(QStringLiteral("tabWallet")); - verticalLayout_Wallet = new QVBoxLayout(tabWallet); - verticalLayout_Wallet->setObjectName(QStringLiteral("verticalLayout_Wallet")); - transactionFeeInfoLabel = new QLabel(tabWallet); - transactionFeeInfoLabel->setObjectName(QStringLiteral("transactionFeeInfoLabel")); - transactionFeeInfoLabel->setTextFormat(Qt::PlainText); - transactionFeeInfoLabel->setWordWrap(true); - - verticalLayout_Wallet->addWidget(transactionFeeInfoLabel); - - horizontalLayout_1_Wallet = new QHBoxLayout(); - horizontalLayout_1_Wallet->setObjectName(QStringLiteral("horizontalLayout_1_Wallet")); - transactionFeeLabel = new QLabel(tabWallet); - transactionFeeLabel->setObjectName(QStringLiteral("transactionFeeLabel")); - transactionFeeLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_1_Wallet->addWidget(transactionFeeLabel); - - transactionFee = new BitcoinAmountField(tabWallet); - transactionFee->setObjectName(QStringLiteral("transactionFee")); - - horizontalLayout_1_Wallet->addWidget(transactionFee); - - horizontalSpacer_1_Wallet = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_1_Wallet->addItem(horizontalSpacer_1_Wallet); - - - verticalLayout_Wallet->addLayout(horizontalLayout_1_Wallet); - - verticalSpacer_Wallet = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_Wallet->addItem(verticalSpacer_Wallet); - - groupBox = new QGroupBox(tabWallet); - groupBox->setObjectName(QStringLiteral("groupBox")); - verticalLayout_2 = new QVBoxLayout(groupBox); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - coinControlFeatures = new QCheckBox(groupBox); - coinControlFeatures->setObjectName(QStringLiteral("coinControlFeatures")); - - verticalLayout_2->addWidget(coinControlFeatures); - - spendZeroConfChange = new QCheckBox(groupBox); - spendZeroConfChange->setObjectName(QStringLiteral("spendZeroConfChange")); - - verticalLayout_2->addWidget(spendZeroConfChange); - - - verticalLayout_Wallet->addWidget(groupBox); - - tabWidget->addTab(tabWallet, QString()); - tabNetwork = new QWidget(); - tabNetwork->setObjectName(QStringLiteral("tabNetwork")); - verticalLayout_Network = new QVBoxLayout(tabNetwork); - verticalLayout_Network->setObjectName(QStringLiteral("verticalLayout_Network")); - mapPortUpnp = new QCheckBox(tabNetwork); - mapPortUpnp->setObjectName(QStringLiteral("mapPortUpnp")); - - verticalLayout_Network->addWidget(mapPortUpnp); - - connectSocks = new QCheckBox(tabNetwork); - connectSocks->setObjectName(QStringLiteral("connectSocks")); - - verticalLayout_Network->addWidget(connectSocks); - - horizontalLayout_1_Network = new QHBoxLayout(); - horizontalLayout_1_Network->setObjectName(QStringLiteral("horizontalLayout_1_Network")); - proxyIpLabel = new QLabel(tabNetwork); - proxyIpLabel->setObjectName(QStringLiteral("proxyIpLabel")); - proxyIpLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_1_Network->addWidget(proxyIpLabel); - - proxyIp = new QValidatedLineEdit(tabNetwork); - proxyIp->setObjectName(QStringLiteral("proxyIp")); - proxyIp->setMinimumSize(QSize(140, 0)); - proxyIp->setMaximumSize(QSize(140, 16777215)); - - horizontalLayout_1_Network->addWidget(proxyIp); - - proxyPortLabel = new QLabel(tabNetwork); - proxyPortLabel->setObjectName(QStringLiteral("proxyPortLabel")); - proxyPortLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_1_Network->addWidget(proxyPortLabel); - - proxyPort = new QLineEdit(tabNetwork); - proxyPort->setObjectName(QStringLiteral("proxyPort")); - proxyPort->setMinimumSize(QSize(55, 0)); - proxyPort->setMaximumSize(QSize(55, 16777215)); - - horizontalLayout_1_Network->addWidget(proxyPort); - - socksVersionLabel = new QLabel(tabNetwork); - socksVersionLabel->setObjectName(QStringLiteral("socksVersionLabel")); - socksVersionLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_1_Network->addWidget(socksVersionLabel); - - socksVersion = new QValueComboBox(tabNetwork); - socksVersion->setObjectName(QStringLiteral("socksVersion")); - - horizontalLayout_1_Network->addWidget(socksVersion); - - horizontalSpacer_1_Network = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_1_Network->addItem(horizontalSpacer_1_Network); - - - verticalLayout_Network->addLayout(horizontalLayout_1_Network); - - verticalSpacer_Network = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_Network->addItem(verticalSpacer_Network); - - tabWidget->addTab(tabNetwork, QString()); - tabWindow = new QWidget(); - tabWindow->setObjectName(QStringLiteral("tabWindow")); - verticalLayout_Window = new QVBoxLayout(tabWindow); - verticalLayout_Window->setObjectName(QStringLiteral("verticalLayout_Window")); - minimizeToTray = new QCheckBox(tabWindow); - minimizeToTray->setObjectName(QStringLiteral("minimizeToTray")); - - verticalLayout_Window->addWidget(minimizeToTray); - - minimizeOnClose = new QCheckBox(tabWindow); - minimizeOnClose->setObjectName(QStringLiteral("minimizeOnClose")); - - verticalLayout_Window->addWidget(minimizeOnClose); - - verticalSpacer_Window = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_Window->addItem(verticalSpacer_Window); - - tabWidget->addTab(tabWindow, QString()); - tabDisplay = new QWidget(); - tabDisplay->setObjectName(QStringLiteral("tabDisplay")); - verticalLayout_Display = new QVBoxLayout(tabDisplay); - verticalLayout_Display->setObjectName(QStringLiteral("verticalLayout_Display")); - horizontalLayout_1_Display = new QHBoxLayout(); - horizontalLayout_1_Display->setObjectName(QStringLiteral("horizontalLayout_1_Display")); - langLabel = new QLabel(tabDisplay); - langLabel->setObjectName(QStringLiteral("langLabel")); - langLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_1_Display->addWidget(langLabel); - - lang = new QValueComboBox(tabDisplay); - lang->setObjectName(QStringLiteral("lang")); - - horizontalLayout_1_Display->addWidget(lang); - - - verticalLayout_Display->addLayout(horizontalLayout_1_Display); - - label_3 = new QLabel(tabDisplay); - label_3->setObjectName(QStringLiteral("label_3")); -#ifndef QT_NO_TOOLTIP - label_3->setToolTip(QStringLiteral("")); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - label_3->setStatusTip(QStringLiteral("")); -#endif // QT_NO_STATUSTIP -#ifndef QT_NO_WHATSTHIS - label_3->setWhatsThis(QStringLiteral("")); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_ACCESSIBILITY - label_3->setAccessibleName(QStringLiteral("")); -#endif // QT_NO_ACCESSIBILITY - label_3->setWordWrap(true); - label_3->setOpenExternalLinks(true); - label_3->setTextInteractionFlags(Qt::TextBrowserInteraction); - - verticalLayout_Display->addWidget(label_3); - - horizontalLayout_4_Display = new QHBoxLayout(); - horizontalLayout_4_Display->setObjectName(QStringLiteral("horizontalLayout_4_Display")); - themeLabel = new QLabel(tabDisplay); - themeLabel->setObjectName(QStringLiteral("themeLabel")); - - horizontalLayout_4_Display->addWidget(themeLabel); - - theme = new QValueComboBox(tabDisplay); - theme->setObjectName(QStringLiteral("theme")); - - horizontalLayout_4_Display->addWidget(theme); - - - verticalLayout_Display->addLayout(horizontalLayout_4_Display); - - line = new QFrame(tabDisplay); - line->setObjectName(QStringLiteral("line")); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - verticalLayout_Display->addWidget(line); - - horizontalLayout_2_Display = new QHBoxLayout(); - horizontalLayout_2_Display->setObjectName(QStringLiteral("horizontalLayout_2_Display")); - unitLabel = new QLabel(tabDisplay); - unitLabel->setObjectName(QStringLiteral("unitLabel")); - unitLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_2_Display->addWidget(unitLabel); - - unit = new QValueComboBox(tabDisplay); - unit->setObjectName(QStringLiteral("unit")); - - horizontalLayout_2_Display->addWidget(unit); - - - verticalLayout_Display->addLayout(horizontalLayout_2_Display); - - displayAddresses = new QCheckBox(tabDisplay); - displayAddresses->setObjectName(QStringLiteral("displayAddresses")); - - verticalLayout_Display->addWidget(displayAddresses); - - horizontalLayout_3_Display = new QHBoxLayout(); - horizontalLayout_3_Display->setObjectName(QStringLiteral("horizontalLayout_3_Display")); - thirdPartyTxUrlsLabel = new QLabel(tabDisplay); - thirdPartyTxUrlsLabel->setObjectName(QStringLiteral("thirdPartyTxUrlsLabel")); - - horizontalLayout_3_Display->addWidget(thirdPartyTxUrlsLabel); - - thirdPartyTxUrls = new QLineEdit(tabDisplay); - thirdPartyTxUrls->setObjectName(QStringLiteral("thirdPartyTxUrls")); - - horizontalLayout_3_Display->addWidget(thirdPartyTxUrls); - - - verticalLayout_Display->addLayout(horizontalLayout_3_Display); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_Display->addItem(verticalSpacer); - - tabWidget->addTab(tabDisplay, QString()); - - verticalLayout->addWidget(tabWidget); - - frame = new QFrame(OptionsDialog); - frame->setObjectName(QStringLiteral("frame")); - verticalLayout_Bottom = new QVBoxLayout(frame); - verticalLayout_Bottom->setObjectName(QStringLiteral("verticalLayout_Bottom")); - horizontalLayout_Bottom = new QHBoxLayout(); - horizontalLayout_Bottom->setObjectName(QStringLiteral("horizontalLayout_Bottom")); - overriddenByCommandLineInfoLabel = new QLabel(frame); - overriddenByCommandLineInfoLabel->setObjectName(QStringLiteral("overriddenByCommandLineInfoLabel")); - overriddenByCommandLineInfoLabel->setTextFormat(Qt::PlainText); - - horizontalLayout_Bottom->addWidget(overriddenByCommandLineInfoLabel); - - horizontalSpacer_Bottom = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_Bottom->addItem(horizontalSpacer_Bottom); - - - verticalLayout_Bottom->addLayout(horizontalLayout_Bottom); - - overriddenByCommandLineLabel = new QLabel(frame); - overriddenByCommandLineLabel->setObjectName(QStringLiteral("overriddenByCommandLineLabel")); - overriddenByCommandLineLabel->setTextFormat(Qt::PlainText); - overriddenByCommandLineLabel->setWordWrap(true); - - verticalLayout_Bottom->addWidget(overriddenByCommandLineLabel); - - - verticalLayout->addWidget(frame); - - horizontalLayout_Buttons = new QHBoxLayout(); - horizontalLayout_Buttons->setObjectName(QStringLiteral("horizontalLayout_Buttons")); - resetButton = new QPushButton(OptionsDialog); - resetButton->setObjectName(QStringLiteral("resetButton")); - resetButton->setAutoDefault(false); - - horizontalLayout_Buttons->addWidget(resetButton); - - horizontalSpacer_1 = new QSpacerItem(40, 48, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_Buttons->addItem(horizontalSpacer_1); - - statusLabel = new QLabel(OptionsDialog); - statusLabel->setObjectName(QStringLiteral("statusLabel")); - statusLabel->setMinimumSize(QSize(200, 0)); - QFont font; - font.setBold(true); - font.setWeight(75); - statusLabel->setFont(font); - statusLabel->setTextFormat(Qt::PlainText); - statusLabel->setWordWrap(true); - - horizontalLayout_Buttons->addWidget(statusLabel); - - horizontalSpacer_2 = new QSpacerItem(40, 48, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_Buttons->addItem(horizontalSpacer_2); - - okButton = new QPushButton(OptionsDialog); - okButton->setObjectName(QStringLiteral("okButton")); - - horizontalLayout_Buttons->addWidget(okButton); - - cancelButton = new QPushButton(OptionsDialog); - cancelButton->setObjectName(QStringLiteral("cancelButton")); - cancelButton->setAutoDefault(false); - - horizontalLayout_Buttons->addWidget(cancelButton); - - - verticalLayout->addLayout(horizontalLayout_Buttons); - -#ifndef QT_NO_SHORTCUT - databaseCacheLabel->setBuddy(databaseCache); - threadsScriptVerifLabel->setBuddy(threadsScriptVerif); - transactionFeeLabel->setBuddy(transactionFee); - proxyIpLabel->setBuddy(proxyIp); - proxyPortLabel->setBuddy(proxyPort); - socksVersionLabel->setBuddy(socksVersion); - langLabel->setBuddy(lang); - unitLabel->setBuddy(unit); - thirdPartyTxUrlsLabel->setBuddy(thirdPartyTxUrls); -#endif // QT_NO_SHORTCUT - - retranslateUi(OptionsDialog); - - tabWidget->setCurrentIndex(0); - - - QMetaObject::connectSlotsByName(OptionsDialog); - } // setupUi - - void retranslateUi(QDialog *OptionsDialog) - { - OptionsDialog->setWindowTitle(QApplication::translate("OptionsDialog", "Options", 0)); -#ifndef QT_NO_TOOLTIP - bitcoinAtStartup->setToolTip(QApplication::translate("OptionsDialog", "Automatically start Interzone after logging in to the system.", 0)); -#endif // QT_NO_TOOLTIP - bitcoinAtStartup->setText(QApplication::translate("OptionsDialog", "&Start Interzone on system login", 0)); - databaseCacheLabel->setText(QApplication::translate("OptionsDialog", "Size of &database cache", 0)); - databaseCacheUnitLabel->setText(QApplication::translate("OptionsDialog", "MB", 0)); - threadsScriptVerifLabel->setText(QApplication::translate("OptionsDialog", "Number of script &verification threads", 0)); -#ifndef QT_NO_TOOLTIP - threadsScriptVerif->setToolTip(QApplication::translate("OptionsDialog", "(0 = auto, <0 = leave that many cores free)", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - label->setToolTip(QApplication::translate("OptionsDialog", "

This setting determines the amount of individual masternodes that an input will be anonymized through. More rounds of anonymization gives a higher degree of privacy, but also costs more in fees.

", 0)); -#endif // QT_NO_TOOLTIP - label->setText(QApplication::translate("OptionsDialog", "Darksend rounds to use", 0)); -#ifndef QT_NO_TOOLTIP - label_2->setToolTip(QApplication::translate("OptionsDialog", "This amount acts as a threshold to turn off Darksend once it's reached.", 0)); -#endif // QT_NO_TOOLTIP - label_2->setText(QApplication::translate("OptionsDialog", "Amount of Interzone to keep anonymized", 0)); - tabWidget->setTabText(tabWidget->indexOf(tabMain), QApplication::translate("OptionsDialog", "&Main", 0)); - transactionFeeInfoLabel->setText(QApplication::translate("OptionsDialog", "Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.", 0)); - transactionFeeLabel->setText(QApplication::translate("OptionsDialog", "Pay transaction &fee", 0)); - groupBox->setTitle(QApplication::translate("OptionsDialog", "Expert", 0)); -#ifndef QT_NO_TOOLTIP - coinControlFeatures->setToolTip(QApplication::translate("OptionsDialog", "Whether to show coin control features or not.", 0)); -#endif // QT_NO_TOOLTIP - coinControlFeatures->setText(QApplication::translate("OptionsDialog", "Enable coin &control features", 0)); -#ifndef QT_NO_TOOLTIP - spendZeroConfChange->setToolTip(QApplication::translate("OptionsDialog", "If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.", 0)); -#endif // QT_NO_TOOLTIP - spendZeroConfChange->setText(QApplication::translate("OptionsDialog", "&Spend unconfirmed change", 0)); - tabWidget->setTabText(tabWidget->indexOf(tabWallet), QApplication::translate("OptionsDialog", "W&allet", 0)); -#ifndef QT_NO_TOOLTIP - mapPortUpnp->setToolTip(QApplication::translate("OptionsDialog", "Automatically open the Interzone client port on the router. This only works when your router supports UPnP and it is enabled.", 0)); -#endif // QT_NO_TOOLTIP - mapPortUpnp->setText(QApplication::translate("OptionsDialog", "Map port using &UPnP", 0)); -#ifndef QT_NO_TOOLTIP - connectSocks->setToolTip(QApplication::translate("OptionsDialog", "Connect to the Interzone network through a SOCKS proxy.", 0)); -#endif // QT_NO_TOOLTIP - connectSocks->setText(QApplication::translate("OptionsDialog", "&Connect through SOCKS proxy (default proxy):", 0)); - proxyIpLabel->setText(QApplication::translate("OptionsDialog", "Proxy &IP:", 0)); -#ifndef QT_NO_TOOLTIP - proxyIp->setToolTip(QApplication::translate("OptionsDialog", "IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)", 0)); -#endif // QT_NO_TOOLTIP - proxyPortLabel->setText(QApplication::translate("OptionsDialog", "&Port:", 0)); -#ifndef QT_NO_TOOLTIP - proxyPort->setToolTip(QApplication::translate("OptionsDialog", "Port of the proxy (e.g. 9050)", 0)); -#endif // QT_NO_TOOLTIP - socksVersionLabel->setText(QApplication::translate("OptionsDialog", "SOCKS &Version:", 0)); -#ifndef QT_NO_TOOLTIP - socksVersion->setToolTip(QApplication::translate("OptionsDialog", "SOCKS version of the proxy (e.g. 5)", 0)); -#endif // QT_NO_TOOLTIP - tabWidget->setTabText(tabWidget->indexOf(tabNetwork), QApplication::translate("OptionsDialog", "&Network", 0)); -#ifndef QT_NO_TOOLTIP - minimizeToTray->setToolTip(QApplication::translate("OptionsDialog", "Show only a tray icon after minimizing the window.", 0)); -#endif // QT_NO_TOOLTIP - minimizeToTray->setText(QApplication::translate("OptionsDialog", "&Minimize to the tray instead of the taskbar", 0)); -#ifndef QT_NO_TOOLTIP - minimizeOnClose->setToolTip(QApplication::translate("OptionsDialog", "Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.", 0)); -#endif // QT_NO_TOOLTIP - minimizeOnClose->setText(QApplication::translate("OptionsDialog", "M&inimize on close", 0)); - tabWidget->setTabText(tabWidget->indexOf(tabWindow), QApplication::translate("OptionsDialog", "&Window", 0)); - langLabel->setText(QApplication::translate("OptionsDialog", "User Interface &language:", 0)); -#ifndef QT_NO_TOOLTIP - lang->setToolTip(QApplication::translate("OptionsDialog", "The user interface language can be set here. This setting will take effect after restarting Interzone.", 0)); -#endif // QT_NO_TOOLTIP - label_3->setText(QApplication::translate("OptionsDialog", "Language missing or translation incomplete? Help contributing translations here:\n" -"https://www.transifex.com/projects/p/interzone/", 0)); - themeLabel->setText(QApplication::translate("OptionsDialog", "User Interface Theme:", 0)); - unitLabel->setText(QApplication::translate("OptionsDialog", "&Unit to show amounts in:", 0)); -#ifndef QT_NO_TOOLTIP - unit->setToolTip(QApplication::translate("OptionsDialog", "Choose the default subdivision unit to show in the interface and when sending coins.", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - displayAddresses->setToolTip(QApplication::translate("OptionsDialog", "Whether to show Interzone addresses in the transaction list or not.", 0)); -#endif // QT_NO_TOOLTIP - displayAddresses->setText(QApplication::translate("OptionsDialog", "&Display addresses in transaction list", 0)); -#ifndef QT_NO_TOOLTIP - thirdPartyTxUrlsLabel->setToolTip(QApplication::translate("OptionsDialog", "Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.", 0)); -#endif // QT_NO_TOOLTIP - thirdPartyTxUrlsLabel->setText(QApplication::translate("OptionsDialog", "Third party transaction URLs", 0)); -#ifndef QT_NO_TOOLTIP - thirdPartyTxUrls->setToolTip(QApplication::translate("OptionsDialog", "Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.", 0)); -#endif // QT_NO_TOOLTIP - tabWidget->setTabText(tabWidget->indexOf(tabDisplay), QApplication::translate("OptionsDialog", "&Display", 0)); - overriddenByCommandLineInfoLabel->setText(QApplication::translate("OptionsDialog", "Active command-line options that override above options:", 0)); - overriddenByCommandLineLabel->setText(QString()); -#ifndef QT_NO_TOOLTIP - resetButton->setToolTip(QApplication::translate("OptionsDialog", "Reset all client options to default.", 0)); -#endif // QT_NO_TOOLTIP - resetButton->setText(QApplication::translate("OptionsDialog", "&Reset Options", 0)); - statusLabel->setText(QString()); - okButton->setText(QApplication::translate("OptionsDialog", "&OK", 0)); - cancelButton->setText(QApplication::translate("OptionsDialog", "&Cancel", 0)); - } // retranslateUi - -}; - -namespace Ui { - class OptionsDialog: public Ui_OptionsDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_OPTIONSDIALOG_H diff --git a/contrib/ui_overviewpage.h b/contrib/ui_overviewpage.h deleted file mode 100644 index dd27223ea..000000000 --- a/contrib/ui_overviewpage.h +++ /dev/null @@ -1,554 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'overviewpage.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_OVERVIEWPAGE_H -#define UI_OVERVIEWPAGE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_OverviewPage -{ -public: - QVBoxLayout *topLayout; - QLabel *labelAlerts; - QHBoxLayout *horizontalLayout; - QVBoxLayout *verticalLayout_2; - QFrame *frame; - QVBoxLayout *verticalLayout_4; - QHBoxLayout *horizontalLayout_4; - QLabel *label_5; - QLabel *labelWalletStatus; - QSpacerItem *horizontalSpacer_2; - QHBoxLayout *horizontalLayout_3; - QFormLayout *formLayout_2; - QLabel *label; - QLabel *labelBalance; - QLabel *label_3; - QLabel *labelUnconfirmed; - QLabel *labelImmatureText; - QLabel *labelImmature; - QLabel *labelTotalText; - QLabel *labelTotal; - QFrame *line; - QSpacerItem *horizontalSpacer_3; - QFrame *frameDarksend; - QWidget *formLayoutWidget; - QFormLayout *formLayout; - QLabel *label_6; - QLabel *darksendEnabled; - QLabel *label_7; - QProgressBar *darksendProgress; - QLabel *labelAnonymizedText; - QLabel *labelAnonymized; - QLabel *label_8; - QLabel *labelAmountRounds; - QLabel *label_9; - QLabel *labelSubmittedDenom; - QPushButton *runAutoDenom; - QPushButton *toggleDarksend; - QFrame *line1; - QLabel *darksendStatus; - QPushButton *darksendAuto; - QPushButton *darksendReset; - QWidget *widget; - QHBoxLayout *horizontalLayout_5; - QLabel *label_2; - QLabel *labelDarksendSyncStatus; - QSpacerItem *horizontalSpacer_4; - QSpacerItem *verticalSpacer; - QVBoxLayout *verticalLayout_3; - QFrame *frame_2; - QVBoxLayout *verticalLayout; - QHBoxLayout *horizontalLayout_2; - QLabel *label_4; - QLabel *labelTransactionsStatus; - QSpacerItem *horizontalSpacer; - QListView *listTransactions; - QSpacerItem *verticalSpacer_2; - - void setupUi(QWidget *OverviewPage) - { - if (OverviewPage->objectName().isEmpty()) - OverviewPage->setObjectName(QStringLiteral("OverviewPage")); - OverviewPage->resize(960, 585); - OverviewPage->setMinimumSize(QSize(960, 0)); - topLayout = new QVBoxLayout(OverviewPage); - topLayout->setObjectName(QStringLiteral("topLayout")); - labelAlerts = new QLabel(OverviewPage); - labelAlerts->setObjectName(QStringLiteral("labelAlerts")); - labelAlerts->setVisible(false); - labelAlerts->setStyleSheet(QStringLiteral("background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #F0D0A0, stop:1 #F8D488); color:#000000;")); - labelAlerts->setWordWrap(true); - labelAlerts->setMargin(3); - - topLayout->addWidget(labelAlerts); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - frame = new QFrame(OverviewPage); - frame->setObjectName(QStringLiteral("frame")); - frame->setFrameShape(QFrame::StyledPanel); - frame->setFrameShadow(QFrame::Raised); - verticalLayout_4 = new QVBoxLayout(frame); - verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4")); - horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); - label_5 = new QLabel(frame); - label_5->setObjectName(QStringLiteral("label_5")); - QFont font; - font.setBold(true); - font.setWeight(75); - label_5->setFont(font); - - horizontalLayout_4->addWidget(label_5); - - labelWalletStatus = new QLabel(frame); - labelWalletStatus->setObjectName(QStringLiteral("labelWalletStatus")); - labelWalletStatus->setStyleSheet(QStringLiteral("QLabel { color: red; }")); - labelWalletStatus->setText(QStringLiteral("(out of sync)")); - labelWalletStatus->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); - - horizontalLayout_4->addWidget(labelWalletStatus); - - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_4->addItem(horizontalSpacer_2); - - - verticalLayout_4->addLayout(horizontalLayout_4); - - horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); - formLayout_2 = new QFormLayout(); - formLayout_2->setObjectName(QStringLiteral("formLayout_2")); - formLayout_2->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - formLayout_2->setHorizontalSpacing(12); - formLayout_2->setVerticalSpacing(12); - label = new QLabel(frame); - label->setObjectName(QStringLiteral("label")); - - formLayout_2->setWidget(0, QFormLayout::LabelRole, label); - - labelBalance = new QLabel(frame); - labelBalance->setObjectName(QStringLiteral("labelBalance")); - labelBalance->setFont(font); - labelBalance->setCursor(QCursor(Qt::IBeamCursor)); - labelBalance->setText(QStringLiteral("0 DASH")); - labelBalance->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - labelBalance->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayout_2->setWidget(0, QFormLayout::FieldRole, labelBalance); - - label_3 = new QLabel(frame); - label_3->setObjectName(QStringLiteral("label_3")); - - formLayout_2->setWidget(1, QFormLayout::LabelRole, label_3); - - labelUnconfirmed = new QLabel(frame); - labelUnconfirmed->setObjectName(QStringLiteral("labelUnconfirmed")); - labelUnconfirmed->setFont(font); - labelUnconfirmed->setCursor(QCursor(Qt::IBeamCursor)); - labelUnconfirmed->setText(QStringLiteral("0 DASH")); - labelUnconfirmed->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - labelUnconfirmed->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayout_2->setWidget(1, QFormLayout::FieldRole, labelUnconfirmed); - - labelImmatureText = new QLabel(frame); - labelImmatureText->setObjectName(QStringLiteral("labelImmatureText")); - - formLayout_2->setWidget(2, QFormLayout::LabelRole, labelImmatureText); - - labelImmature = new QLabel(frame); - labelImmature->setObjectName(QStringLiteral("labelImmature")); - labelImmature->setFont(font); - labelImmature->setText(QStringLiteral("0 DASH")); - labelImmature->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - labelImmature->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayout_2->setWidget(2, QFormLayout::FieldRole, labelImmature); - - labelTotalText = new QLabel(frame); - labelTotalText->setObjectName(QStringLiteral("labelTotalText")); - - formLayout_2->setWidget(4, QFormLayout::LabelRole, labelTotalText); - - labelTotal = new QLabel(frame); - labelTotal->setObjectName(QStringLiteral("labelTotal")); - labelTotal->setFont(font); - labelTotal->setCursor(QCursor(Qt::IBeamCursor)); - labelTotal->setText(QStringLiteral("0 DASH")); - labelTotal->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - labelTotal->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayout_2->setWidget(4, QFormLayout::FieldRole, labelTotal); - - line = new QFrame(frame); - line->setObjectName(QStringLiteral("line")); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - formLayout_2->setWidget(3, QFormLayout::SpanningRole, line); - - - horizontalLayout_3->addLayout(formLayout_2); - - horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_3->addItem(horizontalSpacer_3); - - - verticalLayout_4->addLayout(horizontalLayout_3); - - - verticalLayout_2->addWidget(frame); - - frameDarksend = new QFrame(OverviewPage); - frameDarksend->setObjectName(QStringLiteral("frameDarksend")); - frameDarksend->setVisible(true); - frameDarksend->setMinimumSize(QSize(0, 350)); - frameDarksend->setLayoutDirection(Qt::LeftToRight); - frameDarksend->setFrameShape(QFrame::StyledPanel); - frameDarksend->setFrameShadow(QFrame::Raised); - formLayoutWidget = new QWidget(frameDarksend); - formLayoutWidget->setObjectName(QStringLiteral("formLayoutWidget")); - formLayoutWidget->setGeometry(QRect(10, 40, 451, 161)); - formLayout = new QFormLayout(formLayoutWidget); - formLayout->setObjectName(QStringLiteral("formLayout")); - formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - formLayout->setHorizontalSpacing(30); - formLayout->setVerticalSpacing(12); - formLayout->setContentsMargins(0, 0, 0, 0); - label_6 = new QLabel(formLayoutWidget); - label_6->setObjectName(QStringLiteral("label_6")); - - formLayout->setWidget(0, QFormLayout::LabelRole, label_6); - - darksendEnabled = new QLabel(formLayoutWidget); - darksendEnabled->setObjectName(QStringLiteral("darksendEnabled")); - - formLayout->setWidget(0, QFormLayout::FieldRole, darksendEnabled); - - label_7 = new QLabel(formLayoutWidget); - label_7->setObjectName(QStringLiteral("label_7")); - - formLayout->setWidget(1, QFormLayout::LabelRole, label_7); - - darksendProgress = new QProgressBar(formLayoutWidget); - darksendProgress->setObjectName(QStringLiteral("darksendProgress")); - darksendProgress->setMaximumSize(QSize(154, 16777215)); - darksendProgress->setValue(0); - - formLayout->setWidget(1, QFormLayout::FieldRole, darksendProgress); - - labelAnonymizedText = new QLabel(formLayoutWidget); - labelAnonymizedText->setObjectName(QStringLiteral("labelAnonymizedText")); - - formLayout->setWidget(2, QFormLayout::LabelRole, labelAnonymizedText); - - labelAnonymized = new QLabel(formLayoutWidget); - labelAnonymized->setObjectName(QStringLiteral("labelAnonymized")); - labelAnonymized->setFont(font); - - formLayout->setWidget(2, QFormLayout::FieldRole, labelAnonymized); - - label_8 = new QLabel(formLayoutWidget); - label_8->setObjectName(QStringLiteral("label_8")); - - formLayout->setWidget(3, QFormLayout::LabelRole, label_8); - - labelAmountRounds = new QLabel(formLayoutWidget); - labelAmountRounds->setObjectName(QStringLiteral("labelAmountRounds")); - - formLayout->setWidget(3, QFormLayout::FieldRole, labelAmountRounds); - - label_9 = new QLabel(formLayoutWidget); - label_9->setObjectName(QStringLiteral("label_9")); - - formLayout->setWidget(4, QFormLayout::LabelRole, label_9); - - labelSubmittedDenom = new QLabel(formLayoutWidget); - labelSubmittedDenom->setObjectName(QStringLiteral("labelSubmittedDenom")); - - formLayout->setWidget(4, QFormLayout::FieldRole, labelSubmittedDenom); - - runAutoDenom = new QPushButton(frameDarksend); - runAutoDenom->setObjectName(QStringLiteral("runAutoDenom")); - runAutoDenom->setGeometry(QRect(251, 17, 1, 1)); - QPalette palette; - QBrush brush(QColor(0, 0, 0, 255)); - brush.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::WindowText, brush); - QBrush brush1(QColor(239, 238, 238, 255)); - brush1.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Button, brush1); - QBrush brush2(QColor(255, 255, 255, 255)); - brush2.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Light, brush2); - QBrush brush3(QColor(247, 246, 246, 255)); - brush3.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Midlight, brush3); - QBrush brush4(QColor(119, 119, 119, 255)); - brush4.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Dark, brush4); - QBrush brush5(QColor(159, 159, 159, 255)); - brush5.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Mid, brush5); - palette.setBrush(QPalette::Active, QPalette::Text, brush); - palette.setBrush(QPalette::Active, QPalette::BrightText, brush2); - palette.setBrush(QPalette::Active, QPalette::ButtonText, brush); - palette.setBrush(QPalette::Active, QPalette::Base, brush2); - palette.setBrush(QPalette::Active, QPalette::Window, brush1); - palette.setBrush(QPalette::Active, QPalette::Shadow, brush); - palette.setBrush(QPalette::Active, QPalette::AlternateBase, brush3); - QBrush brush6(QColor(255, 255, 220, 255)); - brush6.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::ToolTipBase, brush6); - palette.setBrush(QPalette::Active, QPalette::ToolTipText, brush); - palette.setBrush(QPalette::Inactive, QPalette::WindowText, brush); - palette.setBrush(QPalette::Inactive, QPalette::Button, brush1); - palette.setBrush(QPalette::Inactive, QPalette::Light, brush2); - palette.setBrush(QPalette::Inactive, QPalette::Midlight, brush3); - palette.setBrush(QPalette::Inactive, QPalette::Dark, brush4); - palette.setBrush(QPalette::Inactive, QPalette::Mid, brush5); - palette.setBrush(QPalette::Inactive, QPalette::Text, brush); - palette.setBrush(QPalette::Inactive, QPalette::BrightText, brush2); - palette.setBrush(QPalette::Inactive, QPalette::ButtonText, brush); - palette.setBrush(QPalette::Inactive, QPalette::Base, brush2); - palette.setBrush(QPalette::Inactive, QPalette::Window, brush1); - palette.setBrush(QPalette::Inactive, QPalette::Shadow, brush); - palette.setBrush(QPalette::Inactive, QPalette::AlternateBase, brush3); - palette.setBrush(QPalette::Inactive, QPalette::ToolTipBase, brush6); - palette.setBrush(QPalette::Inactive, QPalette::ToolTipText, brush); - palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush4); - palette.setBrush(QPalette::Disabled, QPalette::Button, brush1); - palette.setBrush(QPalette::Disabled, QPalette::Light, brush2); - palette.setBrush(QPalette::Disabled, QPalette::Midlight, brush3); - palette.setBrush(QPalette::Disabled, QPalette::Dark, brush4); - palette.setBrush(QPalette::Disabled, QPalette::Mid, brush5); - palette.setBrush(QPalette::Disabled, QPalette::Text, brush4); - palette.setBrush(QPalette::Disabled, QPalette::BrightText, brush2); - palette.setBrush(QPalette::Disabled, QPalette::ButtonText, brush4); - palette.setBrush(QPalette::Disabled, QPalette::Base, brush1); - palette.setBrush(QPalette::Disabled, QPalette::Window, brush1); - palette.setBrush(QPalette::Disabled, QPalette::Shadow, brush); - palette.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush1); - palette.setBrush(QPalette::Disabled, QPalette::ToolTipBase, brush6); - palette.setBrush(QPalette::Disabled, QPalette::ToolTipText, brush); - runAutoDenom->setPalette(palette); - runAutoDenom->setFocusPolicy(Qt::NoFocus); - runAutoDenom->setAutoFillBackground(true); - runAutoDenom->setFlat(true); - toggleDarksend = new QPushButton(frameDarksend); - toggleDarksend->setObjectName(QStringLiteral("toggleDarksend")); - toggleDarksend->setGeometry(QRect(10, 292, 221, 56)); - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(toggleDarksend->sizePolicy().hasHeightForWidth()); - toggleDarksend->setSizePolicy(sizePolicy); - line1 = new QFrame(frameDarksend); - line1->setObjectName(QStringLiteral("line1")); - line1->setGeometry(QRect(10, 200, 441, 16)); - line1->setFrameShape(QFrame::HLine); - line1->setFrameShadow(QFrame::Sunken); - darksendStatus = new QLabel(frameDarksend); - darksendStatus->setObjectName(QStringLiteral("darksendStatus")); - darksendStatus->setGeometry(QRect(10, 220, 451, 61)); - darksendStatus->setMinimumSize(QSize(288, 43)); - darksendStatus->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); - darksendStatus->setWordWrap(true); - darksendAuto = new QPushButton(frameDarksend); - darksendAuto->setObjectName(QStringLiteral("darksendAuto")); - darksendAuto->setGeometry(QRect(230, 292, 221, 28)); - sizePolicy.setHeightForWidth(darksendAuto->sizePolicy().hasHeightForWidth()); - darksendAuto->setSizePolicy(sizePolicy); - darksendReset = new QPushButton(frameDarksend); - darksendReset->setObjectName(QStringLiteral("darksendReset")); - darksendReset->setGeometry(QRect(230, 319, 221, 28)); - sizePolicy.setHeightForWidth(darksendReset->sizePolicy().hasHeightForWidth()); - darksendReset->setSizePolicy(sizePolicy); - darksendReset->setAutoFillBackground(false); - widget = new QWidget(frameDarksend); - widget->setObjectName(QStringLiteral("widget")); - widget->setGeometry(QRect(10, 10, 431, 22)); - horizontalLayout_5 = new QHBoxLayout(widget); - horizontalLayout_5->setObjectName(QStringLiteral("horizontalLayout_5")); - horizontalLayout_5->setContentsMargins(0, 0, 0, 0); - label_2 = new QLabel(widget); - label_2->setObjectName(QStringLiteral("label_2")); - label_2->setFont(font); - - horizontalLayout_5->addWidget(label_2); - - labelDarksendSyncStatus = new QLabel(widget); - labelDarksendSyncStatus->setObjectName(QStringLiteral("labelDarksendSyncStatus")); - labelDarksendSyncStatus->setStyleSheet(QStringLiteral("QLabel { color: red; }")); - labelDarksendSyncStatus->setText(QStringLiteral("(out of sync)")); - labelDarksendSyncStatus->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); - - horizontalLayout_5->addWidget(labelDarksendSyncStatus); - - horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_5->addItem(horizontalSpacer_4); - - - verticalLayout_2->addWidget(frameDarksend); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_2->addItem(verticalSpacer); - - - horizontalLayout->addLayout(verticalLayout_2); - - verticalLayout_3 = new QVBoxLayout(); - verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3")); - frame_2 = new QFrame(OverviewPage); - frame_2->setObjectName(QStringLiteral("frame_2")); - frame_2->setFrameShape(QFrame::StyledPanel); - frame_2->setFrameShadow(QFrame::Raised); - verticalLayout = new QVBoxLayout(frame_2); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - label_4 = new QLabel(frame_2); - label_4->setObjectName(QStringLiteral("label_4")); - - horizontalLayout_2->addWidget(label_4); - - labelTransactionsStatus = new QLabel(frame_2); - labelTransactionsStatus->setObjectName(QStringLiteral("labelTransactionsStatus")); - labelTransactionsStatus->setStyleSheet(QStringLiteral("QLabel { color: red; }")); - labelTransactionsStatus->setText(QStringLiteral("(out of sync)")); - labelTransactionsStatus->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - horizontalLayout_2->addWidget(labelTransactionsStatus); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_2->addItem(horizontalSpacer); - - - verticalLayout->addLayout(horizontalLayout_2); - - listTransactions = new QListView(frame_2); - listTransactions->setObjectName(QStringLiteral("listTransactions")); - listTransactions->setStyleSheet(QStringLiteral("QListView { background: transparent; }")); - listTransactions->setFrameShape(QFrame::NoFrame); - listTransactions->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - listTransactions->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - listTransactions->setSelectionMode(QAbstractItemView::NoSelection); - - verticalLayout->addWidget(listTransactions); - - - verticalLayout_3->addWidget(frame_2); - - verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_3->addItem(verticalSpacer_2); - - - horizontalLayout->addLayout(verticalLayout_3); - - horizontalLayout->setStretch(0, 1); - horizontalLayout->setStretch(1, 1); - - topLayout->addLayout(horizontalLayout); - - - retranslateUi(OverviewPage); - - QMetaObject::connectSlotsByName(OverviewPage); - } // setupUi - - void retranslateUi(QWidget *OverviewPage) - { - OverviewPage->setWindowTitle(QApplication::translate("OverviewPage", "Form", 0)); - label_5->setText(QApplication::translate("OverviewPage", "Wallet", 0)); -#ifndef QT_NO_TOOLTIP - labelWalletStatus->setToolTip(QApplication::translate("OverviewPage", "The displayed information may be out of date. Your wallet automatically synchronizes with the Interzone network after a connection is established, but this process has not completed yet.", 0)); -#endif // QT_NO_TOOLTIP - label->setText(QApplication::translate("OverviewPage", "Available:", 0)); -#ifndef QT_NO_TOOLTIP - labelBalance->setToolTip(QApplication::translate("OverviewPage", "Your current spendable balance", 0)); -#endif // QT_NO_TOOLTIP - label_3->setText(QApplication::translate("OverviewPage", "Pending:", 0)); -#ifndef QT_NO_TOOLTIP - labelUnconfirmed->setToolTip(QApplication::translate("OverviewPage", "Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance", 0)); -#endif // QT_NO_TOOLTIP - labelImmatureText->setText(QApplication::translate("OverviewPage", "Immature:", 0)); -#ifndef QT_NO_TOOLTIP - labelImmature->setToolTip(QApplication::translate("OverviewPage", "Mined balance that has not yet matured", 0)); -#endif // QT_NO_TOOLTIP - labelTotalText->setText(QApplication::translate("OverviewPage", "Total:", 0)); -#ifndef QT_NO_TOOLTIP - labelTotal->setToolTip(QApplication::translate("OverviewPage", "Your current total balance", 0)); -#endif // QT_NO_TOOLTIP - label_6->setText(QApplication::translate("OverviewPage", "Status:", 0)); - darksendEnabled->setText(QApplication::translate("OverviewPage", "Enabled/Disabled", 0)); - label_7->setText(QApplication::translate("OverviewPage", "Completion:", 0)); - labelAnonymizedText->setText(QApplication::translate("OverviewPage", "Darksend Balance:", 0)); - labelAnonymized->setText(QApplication::translate("OverviewPage", "0 DASH", 0)); - label_8->setText(QApplication::translate("OverviewPage", "Amount and Rounds:", 0)); - labelAmountRounds->setText(QApplication::translate("OverviewPage", "0 DASH / 0 Rounds", 0)); - label_9->setText(QApplication::translate("OverviewPage", "Submitted Denom:", 0)); -#ifndef QT_NO_STATUSTIP - labelSubmittedDenom->setStatusTip(QApplication::translate("OverviewPage", "The denominations you submitted to the Masternode. To mix, other users must submit the exact same denominations.", 0)); -#endif // QT_NO_STATUSTIP - labelSubmittedDenom->setText(QApplication::translate("OverviewPage", "n/a", 0)); - runAutoDenom->setText(QString()); - toggleDarksend->setText(QApplication::translate("OverviewPage", "Start/Stop Mixing", 0)); - darksendStatus->setText(QApplication::translate("OverviewPage", "(Last Message)", 0)); -#ifndef QT_NO_TOOLTIP - darksendAuto->setToolTip(QApplication::translate("OverviewPage", "Try to manually submit a Darksend request.", 0)); -#endif // QT_NO_TOOLTIP - darksendAuto->setText(QApplication::translate("OverviewPage", "Try Mix", 0)); -#ifndef QT_NO_TOOLTIP - darksendReset->setToolTip(QApplication::translate("OverviewPage", "Reset the current status of Darksend (can interrupt Darksend if it's in the process of Mixing, which can cost you money!)", 0)); -#endif // QT_NO_TOOLTIP - darksendReset->setText(QApplication::translate("OverviewPage", "Reset", 0)); - label_2->setText(QApplication::translate("OverviewPage", "Darksend", 0)); -#ifndef QT_NO_TOOLTIP - labelDarksendSyncStatus->setToolTip(QApplication::translate("OverviewPage", "The displayed information may be out of date. Your wallet automatically synchronizes with the Interzone network after a connection is established, but this process has not completed yet.", 0)); -#endif // QT_NO_TOOLTIP - label_4->setText(QApplication::translate("OverviewPage", "Recent transactions", 0)); -#ifndef QT_NO_TOOLTIP - labelTransactionsStatus->setToolTip(QApplication::translate("OverviewPage", "The displayed information may be out of date. Your wallet automatically synchronizes with the Interzone network after a connection is established, but this process has not completed yet.", 0)); -#endif // QT_NO_TOOLTIP - } // retranslateUi - -}; - -namespace Ui { - class OverviewPage: public Ui_OverviewPage {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_OVERVIEWPAGE_H diff --git a/contrib/ui_receivecoinsdialog.h b/contrib/ui_receivecoinsdialog.h deleted file mode 100644 index 40b815359..000000000 --- a/contrib/ui_receivecoinsdialog.h +++ /dev/null @@ -1,308 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'receivecoinsdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_RECEIVECOINSDIALOG_H -#define UI_RECEIVECOINSDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "bitcoinamountfield.h" - -QT_BEGIN_NAMESPACE - -class Ui_ReceiveCoinsDialog -{ -public: - QVBoxLayout *verticalLayout; - QFrame *frame2; - QVBoxLayout *verticalLayout_3; - QGridLayout *gridLayout; - QCheckBox *reuseAddress; - QLabel *label_4; - QLabel *label_3; - QLineEdit *reqLabel; - QLineEdit *reqMessage; - QLabel *label_5; - QLabel *label_2; - QLabel *label; - BitcoinAmountField *reqAmount; - QHBoxLayout *horizontalLayout; - QPushButton *receiveButton; - QPushButton *clearButton; - QSpacerItem *horizontalSpacer; - QLabel *label_7; - QSpacerItem *verticalSpacer_2; - QFrame *frame; - QVBoxLayout *verticalLayout_2; - QLabel *label_6; - QTableView *recentRequestsView; - QHBoxLayout *horizontalLayout_2; - QPushButton *showRequestButton; - QPushButton *removeRequestButton; - QSpacerItem *horizontalSpacer_2; - - void setupUi(QWidget *ReceiveCoinsDialog) - { - if (ReceiveCoinsDialog->objectName().isEmpty()) - ReceiveCoinsDialog->setObjectName(QStringLiteral("ReceiveCoinsDialog")); - ReceiveCoinsDialog->resize(776, 364); - verticalLayout = new QVBoxLayout(ReceiveCoinsDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - frame2 = new QFrame(ReceiveCoinsDialog); - frame2->setObjectName(QStringLiteral("frame2")); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(frame2->sizePolicy().hasHeightForWidth()); - frame2->setSizePolicy(sizePolicy); - frame2->setFrameShape(QFrame::StyledPanel); - frame2->setFrameShadow(QFrame::Sunken); - verticalLayout_3 = new QVBoxLayout(frame2); - verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3")); - gridLayout = new QGridLayout(); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - reuseAddress = new QCheckBox(frame2); - reuseAddress->setObjectName(QStringLiteral("reuseAddress")); - - gridLayout->addWidget(reuseAddress, 7, 2, 1, 1); - - label_4 = new QLabel(frame2); - label_4->setObjectName(QStringLiteral("label_4")); - - gridLayout->addWidget(label_4, 7, 0, 1, 1); - - label_3 = new QLabel(frame2); - label_3->setObjectName(QStringLiteral("label_3")); - label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(label_3, 6, 0, 1, 1); - - reqLabel = new QLineEdit(frame2); - reqLabel->setObjectName(QStringLiteral("reqLabel")); - - gridLayout->addWidget(reqLabel, 4, 2, 1, 1); - - reqMessage = new QLineEdit(frame2); - reqMessage->setObjectName(QStringLiteral("reqMessage")); - - gridLayout->addWidget(reqMessage, 6, 2, 1, 1); - - label_5 = new QLabel(frame2); - label_5->setObjectName(QStringLiteral("label_5")); - - gridLayout->addWidget(label_5, 2, 2, 1, 1); - - label_2 = new QLabel(frame2); - label_2->setObjectName(QStringLiteral("label_2")); - label_2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(label_2, 4, 0, 1, 1); - - label = new QLabel(frame2); - label->setObjectName(QStringLiteral("label")); - label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(label, 5, 0, 1, 1); - - reqAmount = new BitcoinAmountField(frame2); - reqAmount->setObjectName(QStringLiteral("reqAmount")); - reqAmount->setMinimumSize(QSize(80, 0)); - - gridLayout->addWidget(reqAmount, 5, 2, 1, 1); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - receiveButton = new QPushButton(frame2); - receiveButton->setObjectName(QStringLiteral("receiveButton")); - receiveButton->setMinimumSize(QSize(150, 0)); - QIcon icon; - icon.addFile(QStringLiteral(":/icons/receiving_addresses"), QSize(), QIcon::Normal, QIcon::Off); - receiveButton->setIcon(icon); - - horizontalLayout->addWidget(receiveButton); - - clearButton = new QPushButton(frame2); - clearButton->setObjectName(QStringLiteral("clearButton")); - QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(clearButton->sizePolicy().hasHeightForWidth()); - clearButton->setSizePolicy(sizePolicy1); - QIcon icon1; - icon1.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); - clearButton->setIcon(icon1); - clearButton->setAutoRepeatDelay(300); - clearButton->setAutoDefault(false); - - horizontalLayout->addWidget(clearButton); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout->addItem(horizontalSpacer); - - - gridLayout->addLayout(horizontalLayout, 8, 2, 1, 1); - - label_7 = new QLabel(frame2); - label_7->setObjectName(QStringLiteral("label_7")); - - gridLayout->addWidget(label_7, 8, 0, 1, 1); - - - verticalLayout_3->addLayout(gridLayout); - - - verticalLayout->addWidget(frame2); - - verticalSpacer_2 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout->addItem(verticalSpacer_2); - - frame = new QFrame(ReceiveCoinsDialog); - frame->setObjectName(QStringLiteral("frame")); - sizePolicy.setHeightForWidth(frame->sizePolicy().hasHeightForWidth()); - frame->setSizePolicy(sizePolicy); - frame->setFrameShape(QFrame::StyledPanel); - frame->setFrameShadow(QFrame::Raised); - verticalLayout_2 = new QVBoxLayout(frame); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - label_6 = new QLabel(frame); - label_6->setObjectName(QStringLiteral("label_6")); - QFont font; - font.setBold(true); - font.setWeight(75); - label_6->setFont(font); - - verticalLayout_2->addWidget(label_6); - - recentRequestsView = new QTableView(frame); - recentRequestsView->setObjectName(QStringLiteral("recentRequestsView")); - recentRequestsView->setContextMenuPolicy(Qt::CustomContextMenu); - recentRequestsView->setTabKeyNavigation(false); - recentRequestsView->setSortingEnabled(true); - - verticalLayout_2->addWidget(recentRequestsView); - - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - showRequestButton = new QPushButton(frame); - showRequestButton->setObjectName(QStringLiteral("showRequestButton")); - showRequestButton->setEnabled(false); - QIcon icon2; - icon2.addFile(QStringLiteral(":/icons/edit"), QSize(), QIcon::Normal, QIcon::Off); - showRequestButton->setIcon(icon2); - - horizontalLayout_2->addWidget(showRequestButton); - - removeRequestButton = new QPushButton(frame); - removeRequestButton->setObjectName(QStringLiteral("removeRequestButton")); - removeRequestButton->setEnabled(false); - removeRequestButton->setIcon(icon1); - - horizontalLayout_2->addWidget(removeRequestButton); - - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_2->addItem(horizontalSpacer_2); - - - verticalLayout_2->addLayout(horizontalLayout_2); - - - verticalLayout->addWidget(frame); - - verticalLayout->setStretch(2, 1); -#ifndef QT_NO_SHORTCUT - label_3->setBuddy(reqMessage); - label_2->setBuddy(reqLabel); - label->setBuddy(reqAmount); -#endif // QT_NO_SHORTCUT - QWidget::setTabOrder(reqLabel, reqAmount); - QWidget::setTabOrder(reqAmount, reqMessage); - QWidget::setTabOrder(reqMessage, reuseAddress); - QWidget::setTabOrder(reuseAddress, receiveButton); - QWidget::setTabOrder(receiveButton, clearButton); - QWidget::setTabOrder(clearButton, recentRequestsView); - QWidget::setTabOrder(recentRequestsView, showRequestButton); - QWidget::setTabOrder(showRequestButton, removeRequestButton); - - retranslateUi(ReceiveCoinsDialog); - - QMetaObject::connectSlotsByName(ReceiveCoinsDialog); - } // setupUi - - void retranslateUi(QWidget *ReceiveCoinsDialog) - { -#ifndef QT_NO_TOOLTIP - reuseAddress->setToolTip(QApplication::translate("ReceiveCoinsDialog", "Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.", 0)); -#endif // QT_NO_TOOLTIP - reuseAddress->setText(QApplication::translate("ReceiveCoinsDialog", "R&euse an existing receiving address (not recommended)", 0)); - label_4->setText(QString()); -#ifndef QT_NO_TOOLTIP - label_3->setToolTip(QApplication::translate("ReceiveCoinsDialog", "An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Interzone network.", 0)); -#endif // QT_NO_TOOLTIP - label_3->setText(QApplication::translate("ReceiveCoinsDialog", "&Message:", 0)); -#ifndef QT_NO_TOOLTIP - reqLabel->setToolTip(QApplication::translate("ReceiveCoinsDialog", "An optional label to associate with the new receiving address.", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - reqMessage->setToolTip(QApplication::translate("ReceiveCoinsDialog", "An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Interzone network.", 0)); -#endif // QT_NO_TOOLTIP - label_5->setText(QApplication::translate("ReceiveCoinsDialog", "Use this form to request payments. All fields are optional.", 0)); -#ifndef QT_NO_TOOLTIP - label_2->setToolTip(QApplication::translate("ReceiveCoinsDialog", "An optional label to associate with the new receiving address.", 0)); -#endif // QT_NO_TOOLTIP - label_2->setText(QApplication::translate("ReceiveCoinsDialog", "&Label:", 0)); -#ifndef QT_NO_TOOLTIP - label->setToolTip(QApplication::translate("ReceiveCoinsDialog", "An optional amount to request. Leave this empty or zero to not request a specific amount.", 0)); -#endif // QT_NO_TOOLTIP - label->setText(QApplication::translate("ReceiveCoinsDialog", "&Amount:", 0)); -#ifndef QT_NO_TOOLTIP - reqAmount->setToolTip(QApplication::translate("ReceiveCoinsDialog", "An optional amount to request. Leave this empty or zero to not request a specific amount.", 0)); -#endif // QT_NO_TOOLTIP - receiveButton->setText(QApplication::translate("ReceiveCoinsDialog", "&Request payment", 0)); -#ifndef QT_NO_TOOLTIP - clearButton->setToolTip(QApplication::translate("ReceiveCoinsDialog", "Clear all fields of the form.", 0)); -#endif // QT_NO_TOOLTIP - clearButton->setText(QApplication::translate("ReceiveCoinsDialog", "Clear", 0)); - label_7->setText(QString()); - label_6->setText(QApplication::translate("ReceiveCoinsDialog", "Requested payments history", 0)); -#ifndef QT_NO_TOOLTIP - showRequestButton->setToolTip(QApplication::translate("ReceiveCoinsDialog", "Show the selected request (does the same as double clicking an entry)", 0)); -#endif // QT_NO_TOOLTIP - showRequestButton->setText(QApplication::translate("ReceiveCoinsDialog", "Show", 0)); -#ifndef QT_NO_TOOLTIP - removeRequestButton->setToolTip(QApplication::translate("ReceiveCoinsDialog", "Remove the selected entries from the list", 0)); -#endif // QT_NO_TOOLTIP - removeRequestButton->setText(QApplication::translate("ReceiveCoinsDialog", "Remove", 0)); - Q_UNUSED(ReceiveCoinsDialog); - } // retranslateUi - -}; - -namespace Ui { - class ReceiveCoinsDialog: public Ui_ReceiveCoinsDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_RECEIVECOINSDIALOG_H diff --git a/contrib/ui_receiverequestdialog.h b/contrib/ui_receiverequestdialog.h deleted file mode 100644 index 67fa5a330..000000000 --- a/contrib/ui_receiverequestdialog.h +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'receiverequestdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_RECEIVEREQUESTDIALOG_H -#define UI_RECEIVEREQUESTDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "receiverequestdialog.h" - -QT_BEGIN_NAMESPACE - -class Ui_ReceiveRequestDialog -{ -public: - QVBoxLayout *verticalLayout_3; - QRImageWidget *lblQRCode; - QTextEdit *outUri; - QHBoxLayout *horizontalLayout; - QPushButton *btnCopyURI; - QPushButton *btnCopyAddress; - QPushButton *btnSaveAs; - QSpacerItem *horizontalSpacer_2; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *ReceiveRequestDialog) - { - if (ReceiveRequestDialog->objectName().isEmpty()) - ReceiveRequestDialog->setObjectName(QStringLiteral("ReceiveRequestDialog")); - ReceiveRequestDialog->resize(487, 597); - verticalLayout_3 = new QVBoxLayout(ReceiveRequestDialog); - verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3")); - lblQRCode = new QRImageWidget(ReceiveRequestDialog); - lblQRCode->setObjectName(QStringLiteral("lblQRCode")); - QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(lblQRCode->sizePolicy().hasHeightForWidth()); - lblQRCode->setSizePolicy(sizePolicy); - lblQRCode->setMinimumSize(QSize(300, 300)); - lblQRCode->setTextFormat(Qt::PlainText); - lblQRCode->setAlignment(Qt::AlignCenter); - lblQRCode->setWordWrap(true); - - verticalLayout_3->addWidget(lblQRCode); - - outUri = new QTextEdit(ReceiveRequestDialog); - outUri->setObjectName(QStringLiteral("outUri")); - QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(outUri->sizePolicy().hasHeightForWidth()); - outUri->setSizePolicy(sizePolicy1); - outUri->setMinimumSize(QSize(0, 50)); - outUri->setFrameShape(QFrame::NoFrame); - outUri->setFrameShadow(QFrame::Plain); - outUri->setTabChangesFocus(true); - outUri->setTextInteractionFlags(Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - verticalLayout_3->addWidget(outUri); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - btnCopyURI = new QPushButton(ReceiveRequestDialog); - btnCopyURI->setObjectName(QStringLiteral("btnCopyURI")); - - horizontalLayout->addWidget(btnCopyURI); - - btnCopyAddress = new QPushButton(ReceiveRequestDialog); - btnCopyAddress->setObjectName(QStringLiteral("btnCopyAddress")); - - horizontalLayout->addWidget(btnCopyAddress); - - btnSaveAs = new QPushButton(ReceiveRequestDialog); - btnSaveAs->setObjectName(QStringLiteral("btnSaveAs")); - - horizontalLayout->addWidget(btnSaveAs); - - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout->addItem(horizontalSpacer_2); - - buttonBox = new QDialogButtonBox(ReceiveRequestDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setStandardButtons(QDialogButtonBox::Close); - - horizontalLayout->addWidget(buttonBox); - - - verticalLayout_3->addLayout(horizontalLayout); - - - retranslateUi(ReceiveRequestDialog); - QObject::connect(buttonBox, SIGNAL(rejected()), ReceiveRequestDialog, SLOT(reject())); - QObject::connect(buttonBox, SIGNAL(accepted()), ReceiveRequestDialog, SLOT(accept())); - - QMetaObject::connectSlotsByName(ReceiveRequestDialog); - } // setupUi - - void retranslateUi(QDialog *ReceiveRequestDialog) - { -#ifndef QT_NO_TOOLTIP - lblQRCode->setToolTip(QApplication::translate("ReceiveRequestDialog", "QR Code", 0)); -#endif // QT_NO_TOOLTIP - btnCopyURI->setText(QApplication::translate("ReceiveRequestDialog", "Copy &URI", 0)); - btnCopyAddress->setText(QApplication::translate("ReceiveRequestDialog", "Copy &Address", 0)); - btnSaveAs->setText(QApplication::translate("ReceiveRequestDialog", "&Save Image...", 0)); - Q_UNUSED(ReceiveRequestDialog); - } // retranslateUi - -}; - -namespace Ui { - class ReceiveRequestDialog: public Ui_ReceiveRequestDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_RECEIVEREQUESTDIALOG_H diff --git a/contrib/ui_rpcconsole.h b/contrib/ui_rpcconsole.h deleted file mode 100644 index 595075864..000000000 --- a/contrib/ui_rpcconsole.h +++ /dev/null @@ -1,922 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'rpcconsole.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_RPCCONSOLE_H -#define UI_RPCCONSOLE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "trafficgraphwidget.h" - -QT_BEGIN_NAMESPACE - -class Ui_RPCConsole -{ -public: - QVBoxLayout *verticalLayout_2; - QTabWidget *tabWidget; - QWidget *tab_info; - QGridLayout *gridLayout; - QLabel *label_4; - QLabel *label_9; - QLabel *label_8; - QLabel *label_5; - QLabel *networkName; - QLabel *label_7; - QPushButton *openDebugLogfileButton; - QSpacerItem *verticalSpacer; - QLabel *label_13; - QLabel *label_11; - QLabel *numberOfBlocks; - QLabel *label_2; - QLabel *labelDebugLogfile; - QLabel *label_14; - QLabel *label_12; - QLabel *openSSLVersion; - QLabel *label_3; - QLabel *clientName; - QLabel *clientVersion; - QLabel *lastBlockTime; - QSpacerItem *verticalSpacer_2; - QLabel *numberOfConnections; - QLabel *buildDate; - QLabel *label_6; - QLabel *startupTime; - QLabel *label_10; - QLabel *masternodeCount; - QWidget *tab_console; - QVBoxLayout *verticalLayout_3; - QTextEdit *messagesWidget; - QHBoxLayout *horizontalLayout; - QLabel *label; - QLineEdit *lineEdit; - QPushButton *clearButton; - QWidget *tab; - QHBoxLayout *horizontalLayout_3; - QVBoxLayout *verticalLayout_4; - TrafficGraphWidget *trafficGraph; - QHBoxLayout *horizontalLayout_2; - QSlider *sldGraphRange; - QLabel *lblGraphRange; - QPushButton *btnClearTrafficGraph; - QVBoxLayout *verticalLayout; - QGroupBox *groupBox; - QVBoxLayout *verticalLayout_5; - QHBoxLayout *horizontalLayout_4; - QFrame *line; - QLabel *label_16; - QLabel *lblBytesIn; - QHBoxLayout *horizontalLayout_5; - QFrame *line_2; - QLabel *label_17; - QLabel *lblBytesOut; - QSpacerItem *verticalSpacer_4; - QWidget *tab_peers; - QGridLayout *gridLayout_2; - QVBoxLayout *verticalLayout_101; - QTableView *peerWidget; - QLabel *banHeading; - QTableView *banlistWidget; - QLabel *peerHeading; - QWidget *detailWidget; - QGridLayout *gridLayout_3; - QLabel *label_30; - QLabel *peerWhitelisted; - QLabel *label_23; - QLabel *peerDirection; - QLabel *label_21; - QLabel *peerVersion; - QLabel *label_28; - QLabel *peerSubversion; - QLabel *label_41; - QLabel *peerServices; - QLabel *label_29; - QLabel *peerHeight; - QLabel *label_27; - QLabel *peerSyncHeight; - QLabel *label_25; - QLabel *peerCommonHeight; - QLabel *label_24; - QLabel *peerBanScore; - QLabel *label_22; - QLabel *peerConnTime; - QLabel *label_15; - QLabel *peerLastSend; - QLabel *label_19; - QLabel *peerLastRecv; - QLabel *label_18; - QLabel *peerBytesSent; - QLabel *label_20; - QLabel *peerBytesRecv; - QLabel *label_26; - QLabel *peerPingTime; - QLabel *peerPingWaitLabel; - QLabel *peerPingWait; - QLabel *peerMinPingLabel; - QLabel *peerMinPing; - QLabel *label_timeoffset; - QLabel *timeoffset; - QSpacerItem *verticalSpacer_3; - - void setupUi(QDialog *RPCConsole) - { - if (RPCConsole->objectName().isEmpty()) - RPCConsole->setObjectName(QStringLiteral("RPCConsole")); - RPCConsole->resize(740, 596); - verticalLayout_2 = new QVBoxLayout(RPCConsole); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - tabWidget = new QTabWidget(RPCConsole); - tabWidget->setObjectName(QStringLiteral("tabWidget")); - tab_info = new QWidget(); - tab_info->setObjectName(QStringLiteral("tab_info")); - gridLayout = new QGridLayout(tab_info); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - gridLayout->setHorizontalSpacing(12); - label_4 = new QLabel(tab_info); - label_4->setObjectName(QStringLiteral("label_4")); - - gridLayout->addWidget(label_4, 9, 0, 1, 1); - - label_9 = new QLabel(tab_info); - label_9->setObjectName(QStringLiteral("label_9")); - QFont font; - font.setBold(true); - font.setWeight(75); - label_9->setFont(font); - - gridLayout->addWidget(label_9, 0, 0, 1, 1); - - label_8 = new QLabel(tab_info); - label_8->setObjectName(QStringLiteral("label_8")); - - gridLayout->addWidget(label_8, 7, 0, 1, 1); - - label_5 = new QLabel(tab_info); - label_5->setObjectName(QStringLiteral("label_5")); - - gridLayout->addWidget(label_5, 1, 0, 1, 1); - - networkName = new QLabel(tab_info); - networkName->setObjectName(QStringLiteral("networkName")); - networkName->setCursor(QCursor(Qt::IBeamCursor)); - networkName->setTextFormat(Qt::PlainText); - networkName->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(networkName, 7, 1, 1, 1); - - label_7 = new QLabel(tab_info); - label_7->setObjectName(QStringLiteral("label_7")); - - gridLayout->addWidget(label_7, 8, 0, 1, 1); - - openDebugLogfileButton = new QPushButton(tab_info); - openDebugLogfileButton->setObjectName(QStringLiteral("openDebugLogfileButton")); - openDebugLogfileButton->setAutoDefault(false); - - gridLayout->addWidget(openDebugLogfileButton, 15, 0, 1, 1); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(verticalSpacer, 16, 0, 1, 1); - - label_13 = new QLabel(tab_info); - label_13->setObjectName(QStringLiteral("label_13")); - - gridLayout->addWidget(label_13, 5, 0, 1, 1); - - label_11 = new QLabel(tab_info); - label_11->setObjectName(QStringLiteral("label_11")); - label_11->setFont(font); - - gridLayout->addWidget(label_11, 6, 0, 1, 1); - - numberOfBlocks = new QLabel(tab_info); - numberOfBlocks->setObjectName(QStringLiteral("numberOfBlocks")); - numberOfBlocks->setCursor(QCursor(Qt::IBeamCursor)); - numberOfBlocks->setTextFormat(Qt::PlainText); - numberOfBlocks->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(numberOfBlocks, 11, 1, 1, 1); - - label_2 = new QLabel(tab_info); - label_2->setObjectName(QStringLiteral("label_2")); - - gridLayout->addWidget(label_2, 12, 0, 1, 1); - - labelDebugLogfile = new QLabel(tab_info); - labelDebugLogfile->setObjectName(QStringLiteral("labelDebugLogfile")); - labelDebugLogfile->setFont(font); - - gridLayout->addWidget(labelDebugLogfile, 14, 0, 1, 1); - - label_14 = new QLabel(tab_info); - label_14->setObjectName(QStringLiteral("label_14")); - label_14->setIndent(10); - - gridLayout->addWidget(label_14, 3, 0, 1, 1); - - label_12 = new QLabel(tab_info); - label_12->setObjectName(QStringLiteral("label_12")); - - gridLayout->addWidget(label_12, 4, 0, 1, 1); - - openSSLVersion = new QLabel(tab_info); - openSSLVersion->setObjectName(QStringLiteral("openSSLVersion")); - openSSLVersion->setCursor(QCursor(Qt::IBeamCursor)); - openSSLVersion->setTextFormat(Qt::PlainText); - openSSLVersion->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(openSSLVersion, 3, 1, 1, 1); - - label_3 = new QLabel(tab_info); - label_3->setObjectName(QStringLiteral("label_3")); - - gridLayout->addWidget(label_3, 11, 0, 1, 1); - - clientName = new QLabel(tab_info); - clientName->setObjectName(QStringLiteral("clientName")); - clientName->setCursor(QCursor(Qt::IBeamCursor)); - clientName->setTextFormat(Qt::PlainText); - clientName->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(clientName, 1, 1, 1, 1); - - clientVersion = new QLabel(tab_info); - clientVersion->setObjectName(QStringLiteral("clientVersion")); - clientVersion->setCursor(QCursor(Qt::IBeamCursor)); - clientVersion->setTextFormat(Qt::PlainText); - clientVersion->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(clientVersion, 2, 1, 1, 1); - - lastBlockTime = new QLabel(tab_info); - lastBlockTime->setObjectName(QStringLiteral("lastBlockTime")); - lastBlockTime->setCursor(QCursor(Qt::IBeamCursor)); - lastBlockTime->setTextFormat(Qt::PlainText); - lastBlockTime->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(lastBlockTime, 12, 1, 1, 1); - - verticalSpacer_2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(verticalSpacer_2, 13, 0, 1, 1); - - numberOfConnections = new QLabel(tab_info); - numberOfConnections->setObjectName(QStringLiteral("numberOfConnections")); - numberOfConnections->setCursor(QCursor(Qt::IBeamCursor)); - numberOfConnections->setTextFormat(Qt::PlainText); - numberOfConnections->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(numberOfConnections, 8, 1, 1, 1); - - buildDate = new QLabel(tab_info); - buildDate->setObjectName(QStringLiteral("buildDate")); - buildDate->setCursor(QCursor(Qt::IBeamCursor)); - buildDate->setTextFormat(Qt::PlainText); - buildDate->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(buildDate, 4, 1, 1, 1); - - label_6 = new QLabel(tab_info); - label_6->setObjectName(QStringLiteral("label_6")); - - gridLayout->addWidget(label_6, 2, 0, 1, 1); - - startupTime = new QLabel(tab_info); - startupTime->setObjectName(QStringLiteral("startupTime")); - startupTime->setCursor(QCursor(Qt::IBeamCursor)); - startupTime->setTextFormat(Qt::PlainText); - startupTime->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout->addWidget(startupTime, 5, 1, 1, 1); - - label_10 = new QLabel(tab_info); - label_10->setObjectName(QStringLiteral("label_10")); - label_10->setFont(font); - - gridLayout->addWidget(label_10, 10, 0, 1, 1); - - masternodeCount = new QLabel(tab_info); - masternodeCount->setObjectName(QStringLiteral("masternodeCount")); - - gridLayout->addWidget(masternodeCount, 9, 1, 1, 1); - - tabWidget->addTab(tab_info, QString()); - tab_console = new QWidget(); - tab_console->setObjectName(QStringLiteral("tab_console")); - verticalLayout_3 = new QVBoxLayout(tab_console); - verticalLayout_3->setSpacing(3); - verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3")); - messagesWidget = new QTextEdit(tab_console); - messagesWidget->setObjectName(QStringLiteral("messagesWidget")); - messagesWidget->setMinimumSize(QSize(0, 100)); - messagesWidget->setReadOnly(true); - messagesWidget->setProperty("tabKeyNavigation", QVariant(false)); - messagesWidget->setProperty("columnCount", QVariant(2)); - - verticalLayout_3->addWidget(messagesWidget); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setSpacing(3); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - label = new QLabel(tab_console); - label->setObjectName(QStringLiteral("label")); - label->setText(QStringLiteral(">")); - - horizontalLayout->addWidget(label); - - lineEdit = new QLineEdit(tab_console); - lineEdit->setObjectName(QStringLiteral("lineEdit")); - - horizontalLayout->addWidget(lineEdit); - - clearButton = new QPushButton(tab_console); - clearButton->setObjectName(QStringLiteral("clearButton")); - clearButton->setMaximumSize(QSize(24, 24)); - QIcon icon; - icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); - clearButton->setIcon(icon); - clearButton->setShortcut(QStringLiteral("Ctrl+L")); - clearButton->setAutoDefault(false); - - horizontalLayout->addWidget(clearButton); - - - verticalLayout_3->addLayout(horizontalLayout); - - tabWidget->addTab(tab_console, QString()); - tab = new QWidget(); - tab->setObjectName(QStringLiteral("tab")); - horizontalLayout_3 = new QHBoxLayout(tab); - horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); - verticalLayout_4 = new QVBoxLayout(); - verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4")); - trafficGraph = new TrafficGraphWidget(tab); - trafficGraph->setObjectName(QStringLiteral("trafficGraph")); - QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(trafficGraph->sizePolicy().hasHeightForWidth()); - trafficGraph->setSizePolicy(sizePolicy); - - verticalLayout_4->addWidget(trafficGraph); - - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - sldGraphRange = new QSlider(tab); - sldGraphRange->setObjectName(QStringLiteral("sldGraphRange")); - sldGraphRange->setMinimum(1); - sldGraphRange->setMaximum(288); - sldGraphRange->setPageStep(12); - sldGraphRange->setValue(6); - sldGraphRange->setOrientation(Qt::Horizontal); - - horizontalLayout_2->addWidget(sldGraphRange); - - lblGraphRange = new QLabel(tab); - lblGraphRange->setObjectName(QStringLiteral("lblGraphRange")); - lblGraphRange->setMinimumSize(QSize(100, 0)); - lblGraphRange->setAlignment(Qt::AlignCenter); - - horizontalLayout_2->addWidget(lblGraphRange); - - btnClearTrafficGraph = new QPushButton(tab); - btnClearTrafficGraph->setObjectName(QStringLiteral("btnClearTrafficGraph")); - - horizontalLayout_2->addWidget(btnClearTrafficGraph); - - - verticalLayout_4->addLayout(horizontalLayout_2); - - - horizontalLayout_3->addLayout(verticalLayout_4); - - verticalLayout = new QVBoxLayout(); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - groupBox = new QGroupBox(tab); - groupBox->setObjectName(QStringLiteral("groupBox")); - verticalLayout_5 = new QVBoxLayout(groupBox); - verticalLayout_5->setObjectName(QStringLiteral("verticalLayout_5")); - horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); - line = new QFrame(groupBox); - line->setObjectName(QStringLiteral("line")); - QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(line->sizePolicy().hasHeightForWidth()); - line->setSizePolicy(sizePolicy1); - line->setMinimumSize(QSize(10, 0)); - QPalette palette; - QBrush brush(QColor(0, 255, 0, 255)); - brush.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Light, brush); - palette.setBrush(QPalette::Inactive, QPalette::Light, brush); - palette.setBrush(QPalette::Disabled, QPalette::Light, brush); - line->setPalette(palette); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - horizontalLayout_4->addWidget(line); - - label_16 = new QLabel(groupBox); - label_16->setObjectName(QStringLiteral("label_16")); - - horizontalLayout_4->addWidget(label_16); - - lblBytesIn = new QLabel(groupBox); - lblBytesIn->setObjectName(QStringLiteral("lblBytesIn")); - lblBytesIn->setMinimumSize(QSize(50, 0)); - lblBytesIn->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - horizontalLayout_4->addWidget(lblBytesIn); - - - verticalLayout_5->addLayout(horizontalLayout_4); - - horizontalLayout_5 = new QHBoxLayout(); - horizontalLayout_5->setObjectName(QStringLiteral("horizontalLayout_5")); - line_2 = new QFrame(groupBox); - line_2->setObjectName(QStringLiteral("line_2")); - sizePolicy1.setHeightForWidth(line_2->sizePolicy().hasHeightForWidth()); - line_2->setSizePolicy(sizePolicy1); - line_2->setMinimumSize(QSize(10, 0)); - QPalette palette1; - QBrush brush1(QColor(255, 0, 0, 255)); - brush1.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Light, brush1); - palette1.setBrush(QPalette::Inactive, QPalette::Light, brush1); - palette1.setBrush(QPalette::Disabled, QPalette::Light, brush1); - line_2->setPalette(palette1); - line_2->setFrameShape(QFrame::HLine); - line_2->setFrameShadow(QFrame::Sunken); - - horizontalLayout_5->addWidget(line_2); - - label_17 = new QLabel(groupBox); - label_17->setObjectName(QStringLiteral("label_17")); - - horizontalLayout_5->addWidget(label_17); - - lblBytesOut = new QLabel(groupBox); - lblBytesOut->setObjectName(QStringLiteral("lblBytesOut")); - lblBytesOut->setMinimumSize(QSize(50, 0)); - lblBytesOut->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - horizontalLayout_5->addWidget(lblBytesOut); - - - verticalLayout_5->addLayout(horizontalLayout_5); - - verticalSpacer_4 = new QSpacerItem(20, 407, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_5->addItem(verticalSpacer_4); - - - verticalLayout->addWidget(groupBox); - - - horizontalLayout_3->addLayout(verticalLayout); - - tabWidget->addTab(tab, QString()); - tab_peers = new QWidget(); - tab_peers->setObjectName(QStringLiteral("tab_peers")); - gridLayout_2 = new QGridLayout(tab_peers); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - verticalLayout_101 = new QVBoxLayout(); - verticalLayout_101->setSpacing(0); - verticalLayout_101->setObjectName(QStringLiteral("verticalLayout_101")); - peerWidget = new QTableView(tab_peers); - peerWidget->setObjectName(QStringLiteral("peerWidget")); - peerWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); - peerWidget->setTabKeyNavigation(false); - peerWidget->setSortingEnabled(true); - peerWidget->horizontalHeader()->setHighlightSections(false); - - verticalLayout_101->addWidget(peerWidget); - - banHeading = new QLabel(tab_peers); - banHeading->setObjectName(QStringLiteral("banHeading")); - QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Minimum); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(banHeading->sizePolicy().hasHeightForWidth()); - banHeading->setSizePolicy(sizePolicy2); - banHeading->setMinimumSize(QSize(300, 32)); - banHeading->setMaximumSize(QSize(16777215, 32)); - QFont font1; - font1.setPointSize(12); - banHeading->setFont(font1); - banHeading->setCursor(QCursor(Qt::IBeamCursor)); - banHeading->setAlignment(Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft); - banHeading->setWordWrap(true); - banHeading->setTextInteractionFlags(Qt::NoTextInteraction); - - verticalLayout_101->addWidget(banHeading); - - banlistWidget = new QTableView(tab_peers); - banlistWidget->setObjectName(QStringLiteral("banlistWidget")); - sizePolicy.setHeightForWidth(banlistWidget->sizePolicy().hasHeightForWidth()); - banlistWidget->setSizePolicy(sizePolicy); - banlistWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); - banlistWidget->setTabKeyNavigation(false); - banlistWidget->setSortingEnabled(true); - banlistWidget->horizontalHeader()->setHighlightSections(false); - - verticalLayout_101->addWidget(banlistWidget); - - - gridLayout_2->addLayout(verticalLayout_101, 0, 0, 2, 1); - - peerHeading = new QLabel(tab_peers); - peerHeading->setObjectName(QStringLiteral("peerHeading")); - sizePolicy2.setHeightForWidth(peerHeading->sizePolicy().hasHeightForWidth()); - peerHeading->setSizePolicy(sizePolicy2); - peerHeading->setMinimumSize(QSize(300, 32)); - QFont font2; - font2.setPointSize(10); - peerHeading->setFont(font2); - peerHeading->setCursor(QCursor(Qt::IBeamCursor)); - peerHeading->setAlignment(Qt::AlignHCenter|Qt::AlignTop); - peerHeading->setWordWrap(true); - peerHeading->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_2->addWidget(peerHeading, 0, 1, 1, 1); - - detailWidget = new QWidget(tab_peers); - detailWidget->setObjectName(QStringLiteral("detailWidget")); - detailWidget->setMinimumSize(QSize(300, 0)); - gridLayout_3 = new QGridLayout(detailWidget); - gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - label_30 = new QLabel(detailWidget); - label_30->setObjectName(QStringLiteral("label_30")); - - gridLayout_3->addWidget(label_30, 0, 0, 1, 1); - - peerWhitelisted = new QLabel(detailWidget); - peerWhitelisted->setObjectName(QStringLiteral("peerWhitelisted")); - peerWhitelisted->setCursor(QCursor(Qt::IBeamCursor)); - peerWhitelisted->setTextFormat(Qt::PlainText); - peerWhitelisted->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerWhitelisted, 0, 2, 1, 1); - - label_23 = new QLabel(detailWidget); - label_23->setObjectName(QStringLiteral("label_23")); - - gridLayout_3->addWidget(label_23, 1, 0, 1, 1); - - peerDirection = new QLabel(detailWidget); - peerDirection->setObjectName(QStringLiteral("peerDirection")); - peerDirection->setCursor(QCursor(Qt::IBeamCursor)); - peerDirection->setTextFormat(Qt::PlainText); - peerDirection->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerDirection, 1, 2, 1, 1); - - label_21 = new QLabel(detailWidget); - label_21->setObjectName(QStringLiteral("label_21")); - - gridLayout_3->addWidget(label_21, 2, 0, 1, 1); - - peerVersion = new QLabel(detailWidget); - peerVersion->setObjectName(QStringLiteral("peerVersion")); - peerVersion->setCursor(QCursor(Qt::IBeamCursor)); - peerVersion->setTextFormat(Qt::PlainText); - peerVersion->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerVersion, 2, 2, 1, 1); - - label_28 = new QLabel(detailWidget); - label_28->setObjectName(QStringLiteral("label_28")); - - gridLayout_3->addWidget(label_28, 3, 0, 1, 1); - - peerSubversion = new QLabel(detailWidget); - peerSubversion->setObjectName(QStringLiteral("peerSubversion")); - peerSubversion->setCursor(QCursor(Qt::IBeamCursor)); - peerSubversion->setTextFormat(Qt::PlainText); - peerSubversion->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerSubversion, 3, 2, 1, 1); - - label_41 = new QLabel(detailWidget); - label_41->setObjectName(QStringLiteral("label_41")); - - gridLayout_3->addWidget(label_41, 4, 0, 1, 1); - - peerServices = new QLabel(detailWidget); - peerServices->setObjectName(QStringLiteral("peerServices")); - peerServices->setCursor(QCursor(Qt::IBeamCursor)); - peerServices->setTextFormat(Qt::PlainText); - peerServices->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerServices, 4, 2, 1, 1); - - label_29 = new QLabel(detailWidget); - label_29->setObjectName(QStringLiteral("label_29")); - - gridLayout_3->addWidget(label_29, 5, 0, 1, 1); - - peerHeight = new QLabel(detailWidget); - peerHeight->setObjectName(QStringLiteral("peerHeight")); - peerHeight->setCursor(QCursor(Qt::IBeamCursor)); - peerHeight->setTextFormat(Qt::PlainText); - peerHeight->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerHeight, 5, 2, 1, 1); - - label_27 = new QLabel(detailWidget); - label_27->setObjectName(QStringLiteral("label_27")); - - gridLayout_3->addWidget(label_27, 6, 0, 1, 1); - - peerSyncHeight = new QLabel(detailWidget); - peerSyncHeight->setObjectName(QStringLiteral("peerSyncHeight")); - peerSyncHeight->setCursor(QCursor(Qt::IBeamCursor)); - peerSyncHeight->setTextFormat(Qt::PlainText); - peerSyncHeight->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerSyncHeight, 6, 2, 1, 1); - - label_25 = new QLabel(detailWidget); - label_25->setObjectName(QStringLiteral("label_25")); - - gridLayout_3->addWidget(label_25, 7, 0, 1, 1); - - peerCommonHeight = new QLabel(detailWidget); - peerCommonHeight->setObjectName(QStringLiteral("peerCommonHeight")); - peerCommonHeight->setCursor(QCursor(Qt::IBeamCursor)); - peerCommonHeight->setTextFormat(Qt::PlainText); - peerCommonHeight->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerCommonHeight, 7, 2, 1, 1); - - label_24 = new QLabel(detailWidget); - label_24->setObjectName(QStringLiteral("label_24")); - - gridLayout_3->addWidget(label_24, 8, 0, 1, 1); - - peerBanScore = new QLabel(detailWidget); - peerBanScore->setObjectName(QStringLiteral("peerBanScore")); - peerBanScore->setCursor(QCursor(Qt::IBeamCursor)); - peerBanScore->setTextFormat(Qt::PlainText); - peerBanScore->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerBanScore, 8, 2, 1, 1); - - label_22 = new QLabel(detailWidget); - label_22->setObjectName(QStringLiteral("label_22")); - - gridLayout_3->addWidget(label_22, 9, 0, 1, 1); - - peerConnTime = new QLabel(detailWidget); - peerConnTime->setObjectName(QStringLiteral("peerConnTime")); - peerConnTime->setCursor(QCursor(Qt::IBeamCursor)); - peerConnTime->setTextFormat(Qt::PlainText); - peerConnTime->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerConnTime, 9, 2, 1, 1); - - label_15 = new QLabel(detailWidget); - label_15->setObjectName(QStringLiteral("label_15")); - - gridLayout_3->addWidget(label_15, 10, 0, 1, 1); - - peerLastSend = new QLabel(detailWidget); - peerLastSend->setObjectName(QStringLiteral("peerLastSend")); - peerLastSend->setCursor(QCursor(Qt::IBeamCursor)); - peerLastSend->setTextFormat(Qt::PlainText); - peerLastSend->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerLastSend, 10, 2, 1, 1); - - label_19 = new QLabel(detailWidget); - label_19->setObjectName(QStringLiteral("label_19")); - - gridLayout_3->addWidget(label_19, 11, 0, 1, 1); - - peerLastRecv = new QLabel(detailWidget); - peerLastRecv->setObjectName(QStringLiteral("peerLastRecv")); - peerLastRecv->setCursor(QCursor(Qt::IBeamCursor)); - peerLastRecv->setTextFormat(Qt::PlainText); - peerLastRecv->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerLastRecv, 11, 2, 1, 1); - - label_18 = new QLabel(detailWidget); - label_18->setObjectName(QStringLiteral("label_18")); - - gridLayout_3->addWidget(label_18, 12, 0, 1, 1); - - peerBytesSent = new QLabel(detailWidget); - peerBytesSent->setObjectName(QStringLiteral("peerBytesSent")); - peerBytesSent->setCursor(QCursor(Qt::IBeamCursor)); - peerBytesSent->setTextFormat(Qt::PlainText); - peerBytesSent->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerBytesSent, 12, 2, 1, 1); - - label_20 = new QLabel(detailWidget); - label_20->setObjectName(QStringLiteral("label_20")); - - gridLayout_3->addWidget(label_20, 13, 0, 1, 1); - - peerBytesRecv = new QLabel(detailWidget); - peerBytesRecv->setObjectName(QStringLiteral("peerBytesRecv")); - peerBytesRecv->setCursor(QCursor(Qt::IBeamCursor)); - peerBytesRecv->setTextFormat(Qt::PlainText); - peerBytesRecv->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerBytesRecv, 13, 2, 1, 1); - - label_26 = new QLabel(detailWidget); - label_26->setObjectName(QStringLiteral("label_26")); - - gridLayout_3->addWidget(label_26, 14, 0, 1, 1); - - peerPingTime = new QLabel(detailWidget); - peerPingTime->setObjectName(QStringLiteral("peerPingTime")); - peerPingTime->setCursor(QCursor(Qt::IBeamCursor)); - peerPingTime->setTextFormat(Qt::PlainText); - peerPingTime->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerPingTime, 14, 2, 1, 1); - - peerPingWaitLabel = new QLabel(detailWidget); - peerPingWaitLabel->setObjectName(QStringLiteral("peerPingWaitLabel")); - - gridLayout_3->addWidget(peerPingWaitLabel, 15, 0, 1, 1); - - peerPingWait = new QLabel(detailWidget); - peerPingWait->setObjectName(QStringLiteral("peerPingWait")); - peerPingWait->setCursor(QCursor(Qt::IBeamCursor)); - peerPingWait->setTextFormat(Qt::PlainText); - peerPingWait->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerPingWait, 15, 2, 1, 1); - - peerMinPingLabel = new QLabel(detailWidget); - peerMinPingLabel->setObjectName(QStringLiteral("peerMinPingLabel")); - - gridLayout_3->addWidget(peerMinPingLabel, 16, 0, 1, 1); - - peerMinPing = new QLabel(detailWidget); - peerMinPing->setObjectName(QStringLiteral("peerMinPing")); - peerMinPing->setCursor(QCursor(Qt::IBeamCursor)); - peerMinPing->setTextFormat(Qt::PlainText); - peerMinPing->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(peerMinPing, 16, 2, 1, 1); - - label_timeoffset = new QLabel(detailWidget); - label_timeoffset->setObjectName(QStringLiteral("label_timeoffset")); - - gridLayout_3->addWidget(label_timeoffset, 17, 0, 1, 1); - - timeoffset = new QLabel(detailWidget); - timeoffset->setObjectName(QStringLiteral("timeoffset")); - timeoffset->setCursor(QCursor(Qt::IBeamCursor)); - timeoffset->setTextFormat(Qt::PlainText); - timeoffset->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - gridLayout_3->addWidget(timeoffset, 17, 2, 1, 1); - - verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_3->addItem(verticalSpacer_3, 18, 1, 1, 1); - - - gridLayout_2->addWidget(detailWidget, 1, 1, 1, 1); - - tabWidget->addTab(tab_peers, QString()); - - verticalLayout_2->addWidget(tabWidget); - - - retranslateUi(RPCConsole); - - tabWidget->setCurrentIndex(2); - - - QMetaObject::connectSlotsByName(RPCConsole); - } // setupUi - - void retranslateUi(QDialog *RPCConsole) - { - RPCConsole->setWindowTitle(QApplication::translate("RPCConsole", "Tools window", 0)); - label_4->setText(QApplication::translate("RPCConsole", "Masternode Count", 0)); - label_9->setText(QApplication::translate("RPCConsole", "General", 0)); - label_8->setText(QApplication::translate("RPCConsole", "Name", 0)); - label_5->setText(QApplication::translate("RPCConsole", "Client name", 0)); - networkName->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_7->setText(QApplication::translate("RPCConsole", "Number of connections", 0)); -#ifndef QT_NO_TOOLTIP - openDebugLogfileButton->setToolTip(QApplication::translate("RPCConsole", "Open the Interzone debug log file from the current data directory. This can take a few seconds for large log files.", 0)); -#endif // QT_NO_TOOLTIP - openDebugLogfileButton->setText(QApplication::translate("RPCConsole", "&Open", 0)); - label_13->setText(QApplication::translate("RPCConsole", "Startup time", 0)); - label_11->setText(QApplication::translate("RPCConsole", "Network", 0)); - numberOfBlocks->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_2->setText(QApplication::translate("RPCConsole", "Last block time", 0)); - labelDebugLogfile->setText(QApplication::translate("RPCConsole", "Debug log file", 0)); - label_14->setText(QApplication::translate("RPCConsole", "Using OpenSSL version", 0)); - label_12->setText(QApplication::translate("RPCConsole", "Build date", 0)); - openSSLVersion->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_3->setText(QApplication::translate("RPCConsole", "Current number of blocks", 0)); - clientName->setText(QApplication::translate("RPCConsole", "N/A", 0)); - clientVersion->setText(QApplication::translate("RPCConsole", "N/A", 0)); - lastBlockTime->setText(QApplication::translate("RPCConsole", "N/A", 0)); - numberOfConnections->setText(QApplication::translate("RPCConsole", "N/A", 0)); - buildDate->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_6->setText(QApplication::translate("RPCConsole", "Client version", 0)); - startupTime->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_10->setText(QApplication::translate("RPCConsole", "Block chain", 0)); - masternodeCount->setText(QApplication::translate("RPCConsole", "N/A", 0)); - tabWidget->setTabText(tabWidget->indexOf(tab_info), QApplication::translate("RPCConsole", "&Information", 0)); -#ifndef QT_NO_TOOLTIP - clearButton->setToolTip(QApplication::translate("RPCConsole", "Clear console", 0)); -#endif // QT_NO_TOOLTIP - clearButton->setText(QString()); - tabWidget->setTabText(tabWidget->indexOf(tab_console), QApplication::translate("RPCConsole", "&Console", 0)); - btnClearTrafficGraph->setText(QApplication::translate("RPCConsole", "&Clear", 0)); - groupBox->setTitle(QApplication::translate("RPCConsole", "Totals", 0)); - label_16->setText(QApplication::translate("RPCConsole", "In:", 0)); - label_17->setText(QApplication::translate("RPCConsole", "Out:", 0)); - tabWidget->setTabText(tabWidget->indexOf(tab), QApplication::translate("RPCConsole", "&Network Traffic", 0)); - banHeading->setText(QApplication::translate("RPCConsole", "Banned peers", 0)); - peerHeading->setText(QApplication::translate("RPCConsole", "Select a peer to view detailed information.", 0)); - label_30->setText(QApplication::translate("RPCConsole", "Whitelisted", 0)); - peerWhitelisted->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_23->setText(QApplication::translate("RPCConsole", "Direction", 0)); - peerDirection->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_21->setText(QApplication::translate("RPCConsole", "Version", 0)); - peerVersion->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_28->setText(QApplication::translate("RPCConsole", "User Agent", 0)); - peerSubversion->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_41->setText(QApplication::translate("RPCConsole", "Services", 0)); - peerServices->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_29->setText(QApplication::translate("RPCConsole", "Starting Block", 0)); - peerHeight->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_27->setText(QApplication::translate("RPCConsole", "Synced Headers", 0)); - peerSyncHeight->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_25->setText(QApplication::translate("RPCConsole", "Synced Blocks", 0)); - peerCommonHeight->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_24->setText(QApplication::translate("RPCConsole", "Ban Score", 0)); - peerBanScore->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_22->setText(QApplication::translate("RPCConsole", "Connection Time", 0)); - peerConnTime->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_15->setText(QApplication::translate("RPCConsole", "Last Send", 0)); - peerLastSend->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_19->setText(QApplication::translate("RPCConsole", "Last Receive", 0)); - peerLastRecv->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_18->setText(QApplication::translate("RPCConsole", "Sent", 0)); - peerBytesSent->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_20->setText(QApplication::translate("RPCConsole", "Received", 0)); - peerBytesRecv->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_26->setText(QApplication::translate("RPCConsole", "Ping Time", 0)); - peerPingTime->setText(QApplication::translate("RPCConsole", "N/A", 0)); -#ifndef QT_NO_TOOLTIP - peerPingWaitLabel->setToolTip(QApplication::translate("RPCConsole", "The duration of a currently outstanding ping.", 0)); -#endif // QT_NO_TOOLTIP - peerPingWaitLabel->setText(QApplication::translate("RPCConsole", "Ping Wait", 0)); - peerPingWait->setText(QApplication::translate("RPCConsole", "N/A", 0)); - peerMinPingLabel->setText(QApplication::translate("RPCConsole", "Min Ping", 0)); - peerMinPing->setText(QApplication::translate("RPCConsole", "N/A", 0)); - label_timeoffset->setText(QApplication::translate("RPCConsole", "Time Offset", 0)); - timeoffset->setText(QApplication::translate("RPCConsole", "N/A", 0)); - tabWidget->setTabText(tabWidget->indexOf(tab_peers), QApplication::translate("RPCConsole", "&Peers", 0)); - } // retranslateUi - -}; - -namespace Ui { - class RPCConsole: public Ui_RPCConsole {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_RPCCONSOLE_H diff --git a/contrib/ui_sendcoinsdialog.h b/contrib/ui_sendcoinsdialog.h deleted file mode 100644 index aec5e2033..000000000 --- a/contrib/ui_sendcoinsdialog.h +++ /dev/null @@ -1,552 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'sendcoinsdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_SENDCOINSDIALOG_H -#define UI_SENDCOINSDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "qvalidatedlineedit.h" - -QT_BEGIN_NAMESPACE - -class Ui_SendCoinsDialog -{ -public: - QVBoxLayout *verticalLayout; - QFrame *frameCoinControl; - QVBoxLayout *verticalLayoutCoinControl2; - QVBoxLayout *verticalLayoutCoinControl; - QHBoxLayout *horizontalLayoutCoinControl1; - QLabel *labelCoinControlFeatures; - QHBoxLayout *horizontalLayoutCoinControl2; - QPushButton *pushButtonCoinControl; - QLabel *labelCoinControlAutomaticallySelected; - QLabel *labelCoinControlInsuffFunds; - QSpacerItem *horizontalSpacerCoinControl; - QWidget *widgetCoinControl; - QHBoxLayout *horizontalLayoutCoinControl5; - QHBoxLayout *horizontalLayoutCoinControl3; - QFormLayout *formLayoutCoinControl1; - QLabel *labelCoinControlQuantityText; - QLabel *labelCoinControlQuantity; - QLabel *labelCoinControlBytesText; - QLabel *labelCoinControlBytes; - QFormLayout *formLayoutCoinControl2; - QLabel *labelCoinControlAmountText; - QLabel *labelCoinControlAmount; - QLabel *labelCoinControlPriorityText; - QLabel *labelCoinControlPriority; - QFormLayout *formLayoutCoinControl3; - QLabel *labelCoinControlFeeText; - QLabel *labelCoinControlFee; - QLabel *labelCoinControlLowOutputText; - QLabel *labelCoinControlLowOutput; - QFormLayout *formLayoutCoinControl4; - QLabel *labelCoinControlAfterFeeText; - QLabel *labelCoinControlAfterFee; - QLabel *labelCoinControlChangeText; - QLabel *labelCoinControlChange; - QHBoxLayout *horizontalLayoutCoinControl4; - QCheckBox *checkBoxCoinControlChange; - QValidatedLineEdit *lineEditCoinControlChange; - QLabel *labelCoinControlChangeLabel; - QSpacerItem *verticalSpacerCoinControl; - QScrollArea *scrollArea; - QWidget *scrollAreaWidgetContents; - QVBoxLayout *verticalLayout_2; - QVBoxLayout *entries; - QSpacerItem *verticalSpacer; - QHBoxLayout *horizontalLayout; - QPushButton *sendButton; - QPushButton *clearButton; - QPushButton *addButton; - QSpacerItem *horizontalSpacer; - QHBoxLayout *horizontalLayout_2; - QCheckBox *checkUseDarksend; - QCheckBox *checkInstantX; - QLabel *label; - QLabel *labelBalance; - - void setupUi(QDialog *SendCoinsDialog) - { - if (SendCoinsDialog->objectName().isEmpty()) - SendCoinsDialog->setObjectName(QStringLiteral("SendCoinsDialog")); - SendCoinsDialog->resize(850, 400); - verticalLayout = new QVBoxLayout(SendCoinsDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - verticalLayout->setContentsMargins(-1, -1, -1, 8); - frameCoinControl = new QFrame(SendCoinsDialog); - frameCoinControl->setObjectName(QStringLiteral("frameCoinControl")); - QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(frameCoinControl->sizePolicy().hasHeightForWidth()); - frameCoinControl->setSizePolicy(sizePolicy); - frameCoinControl->setMaximumSize(QSize(16777215, 16777215)); - frameCoinControl->setFrameShape(QFrame::StyledPanel); - frameCoinControl->setFrameShadow(QFrame::Sunken); - verticalLayoutCoinControl2 = new QVBoxLayout(frameCoinControl); - verticalLayoutCoinControl2->setSpacing(0); - verticalLayoutCoinControl2->setObjectName(QStringLiteral("verticalLayoutCoinControl2")); - verticalLayoutCoinControl2->setContentsMargins(0, 0, 0, 6); - verticalLayoutCoinControl = new QVBoxLayout(); - verticalLayoutCoinControl->setSpacing(0); - verticalLayoutCoinControl->setObjectName(QStringLiteral("verticalLayoutCoinControl")); - verticalLayoutCoinControl->setContentsMargins(10, 10, -1, -1); - horizontalLayoutCoinControl1 = new QHBoxLayout(); - horizontalLayoutCoinControl1->setObjectName(QStringLiteral("horizontalLayoutCoinControl1")); - horizontalLayoutCoinControl1->setContentsMargins(-1, -1, -1, 15); - labelCoinControlFeatures = new QLabel(frameCoinControl); - labelCoinControlFeatures->setObjectName(QStringLiteral("labelCoinControlFeatures")); - QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labelCoinControlFeatures->sizePolicy().hasHeightForWidth()); - labelCoinControlFeatures->setSizePolicy(sizePolicy1); - QFont font; - font.setBold(true); - font.setWeight(75); - labelCoinControlFeatures->setFont(font); - labelCoinControlFeatures->setStyleSheet(QStringLiteral("font-weight:bold;")); - - horizontalLayoutCoinControl1->addWidget(labelCoinControlFeatures); - - - verticalLayoutCoinControl->addLayout(horizontalLayoutCoinControl1); - - horizontalLayoutCoinControl2 = new QHBoxLayout(); - horizontalLayoutCoinControl2->setSpacing(8); - horizontalLayoutCoinControl2->setObjectName(QStringLiteral("horizontalLayoutCoinControl2")); - horizontalLayoutCoinControl2->setContentsMargins(-1, -1, -1, 10); - pushButtonCoinControl = new QPushButton(frameCoinControl); - pushButtonCoinControl->setObjectName(QStringLiteral("pushButtonCoinControl")); - pushButtonCoinControl->setStyleSheet(QStringLiteral("")); - - horizontalLayoutCoinControl2->addWidget(pushButtonCoinControl); - - labelCoinControlAutomaticallySelected = new QLabel(frameCoinControl); - labelCoinControlAutomaticallySelected->setObjectName(QStringLiteral("labelCoinControlAutomaticallySelected")); - labelCoinControlAutomaticallySelected->setMargin(5); - - horizontalLayoutCoinControl2->addWidget(labelCoinControlAutomaticallySelected); - - labelCoinControlInsuffFunds = new QLabel(frameCoinControl); - labelCoinControlInsuffFunds->setObjectName(QStringLiteral("labelCoinControlInsuffFunds")); - labelCoinControlInsuffFunds->setFont(font); - labelCoinControlInsuffFunds->setStyleSheet(QStringLiteral("color:red;font-weight:bold;")); - labelCoinControlInsuffFunds->setMargin(5); - - horizontalLayoutCoinControl2->addWidget(labelCoinControlInsuffFunds); - - horizontalSpacerCoinControl = new QSpacerItem(40, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayoutCoinControl2->addItem(horizontalSpacerCoinControl); - - - verticalLayoutCoinControl->addLayout(horizontalLayoutCoinControl2); - - widgetCoinControl = new QWidget(frameCoinControl); - widgetCoinControl->setObjectName(QStringLiteral("widgetCoinControl")); - QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Preferred); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(widgetCoinControl->sizePolicy().hasHeightForWidth()); - widgetCoinControl->setSizePolicy(sizePolicy2); - widgetCoinControl->setMinimumSize(QSize(0, 0)); - widgetCoinControl->setStyleSheet(QStringLiteral("")); - horizontalLayoutCoinControl5 = new QHBoxLayout(widgetCoinControl); - horizontalLayoutCoinControl5->setObjectName(QStringLiteral("horizontalLayoutCoinControl5")); - horizontalLayoutCoinControl5->setContentsMargins(0, 0, 0, 0); - horizontalLayoutCoinControl3 = new QHBoxLayout(); - horizontalLayoutCoinControl3->setSpacing(20); - horizontalLayoutCoinControl3->setObjectName(QStringLiteral("horizontalLayoutCoinControl3")); - horizontalLayoutCoinControl3->setContentsMargins(-1, 0, -1, 10); - formLayoutCoinControl1 = new QFormLayout(); - formLayoutCoinControl1->setObjectName(QStringLiteral("formLayoutCoinControl1")); - formLayoutCoinControl1->setHorizontalSpacing(10); - formLayoutCoinControl1->setVerticalSpacing(14); - formLayoutCoinControl1->setContentsMargins(10, 4, 6, -1); - labelCoinControlQuantityText = new QLabel(widgetCoinControl); - labelCoinControlQuantityText->setObjectName(QStringLiteral("labelCoinControlQuantityText")); - labelCoinControlQuantityText->setFont(font); - labelCoinControlQuantityText->setMargin(0); - - formLayoutCoinControl1->setWidget(0, QFormLayout::LabelRole, labelCoinControlQuantityText); - - labelCoinControlQuantity = new QLabel(widgetCoinControl); - labelCoinControlQuantity->setObjectName(QStringLiteral("labelCoinControlQuantity")); - labelCoinControlQuantity->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlQuantity->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlQuantity->setText(QStringLiteral("0")); - labelCoinControlQuantity->setMargin(0); - labelCoinControlQuantity->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl1->setWidget(0, QFormLayout::FieldRole, labelCoinControlQuantity); - - labelCoinControlBytesText = new QLabel(widgetCoinControl); - labelCoinControlBytesText->setObjectName(QStringLiteral("labelCoinControlBytesText")); - labelCoinControlBytesText->setFont(font); - - formLayoutCoinControl1->setWidget(1, QFormLayout::LabelRole, labelCoinControlBytesText); - - labelCoinControlBytes = new QLabel(widgetCoinControl); - labelCoinControlBytes->setObjectName(QStringLiteral("labelCoinControlBytes")); - labelCoinControlBytes->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlBytes->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlBytes->setText(QStringLiteral("0")); - labelCoinControlBytes->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl1->setWidget(1, QFormLayout::FieldRole, labelCoinControlBytes); - - - horizontalLayoutCoinControl3->addLayout(formLayoutCoinControl1); - - formLayoutCoinControl2 = new QFormLayout(); - formLayoutCoinControl2->setObjectName(QStringLiteral("formLayoutCoinControl2")); - formLayoutCoinControl2->setHorizontalSpacing(10); - formLayoutCoinControl2->setVerticalSpacing(14); - formLayoutCoinControl2->setContentsMargins(6, 4, 6, -1); - labelCoinControlAmountText = new QLabel(widgetCoinControl); - labelCoinControlAmountText->setObjectName(QStringLiteral("labelCoinControlAmountText")); - labelCoinControlAmountText->setFont(font); - labelCoinControlAmountText->setMargin(0); - - formLayoutCoinControl2->setWidget(0, QFormLayout::LabelRole, labelCoinControlAmountText); - - labelCoinControlAmount = new QLabel(widgetCoinControl); - labelCoinControlAmount->setObjectName(QStringLiteral("labelCoinControlAmount")); - labelCoinControlAmount->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlAmount->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlAmount->setText(QStringLiteral("0.00 DASH")); - labelCoinControlAmount->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl2->setWidget(0, QFormLayout::FieldRole, labelCoinControlAmount); - - labelCoinControlPriorityText = new QLabel(widgetCoinControl); - labelCoinControlPriorityText->setObjectName(QStringLiteral("labelCoinControlPriorityText")); - labelCoinControlPriorityText->setFont(font); - - formLayoutCoinControl2->setWidget(1, QFormLayout::LabelRole, labelCoinControlPriorityText); - - labelCoinControlPriority = new QLabel(widgetCoinControl); - labelCoinControlPriority->setObjectName(QStringLiteral("labelCoinControlPriority")); - labelCoinControlPriority->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlPriority->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlPriority->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl2->setWidget(1, QFormLayout::FieldRole, labelCoinControlPriority); - - - horizontalLayoutCoinControl3->addLayout(formLayoutCoinControl2); - - formLayoutCoinControl3 = new QFormLayout(); - formLayoutCoinControl3->setObjectName(QStringLiteral("formLayoutCoinControl3")); - formLayoutCoinControl3->setHorizontalSpacing(10); - formLayoutCoinControl3->setVerticalSpacing(14); - formLayoutCoinControl3->setContentsMargins(6, 4, 6, -1); - labelCoinControlFeeText = new QLabel(widgetCoinControl); - labelCoinControlFeeText->setObjectName(QStringLiteral("labelCoinControlFeeText")); - labelCoinControlFeeText->setFont(font); - labelCoinControlFeeText->setMargin(0); - - formLayoutCoinControl3->setWidget(0, QFormLayout::LabelRole, labelCoinControlFeeText); - - labelCoinControlFee = new QLabel(widgetCoinControl); - labelCoinControlFee->setObjectName(QStringLiteral("labelCoinControlFee")); - labelCoinControlFee->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlFee->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlFee->setText(QStringLiteral("0.00 DASH")); - labelCoinControlFee->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl3->setWidget(0, QFormLayout::FieldRole, labelCoinControlFee); - - labelCoinControlLowOutputText = new QLabel(widgetCoinControl); - labelCoinControlLowOutputText->setObjectName(QStringLiteral("labelCoinControlLowOutputText")); - labelCoinControlLowOutputText->setFont(font); - - formLayoutCoinControl3->setWidget(1, QFormLayout::LabelRole, labelCoinControlLowOutputText); - - labelCoinControlLowOutput = new QLabel(widgetCoinControl); - labelCoinControlLowOutput->setObjectName(QStringLiteral("labelCoinControlLowOutput")); - labelCoinControlLowOutput->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlLowOutput->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlLowOutput->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl3->setWidget(1, QFormLayout::FieldRole, labelCoinControlLowOutput); - - - horizontalLayoutCoinControl3->addLayout(formLayoutCoinControl3); - - formLayoutCoinControl4 = new QFormLayout(); - formLayoutCoinControl4->setObjectName(QStringLiteral("formLayoutCoinControl4")); - formLayoutCoinControl4->setHorizontalSpacing(10); - formLayoutCoinControl4->setVerticalSpacing(14); - formLayoutCoinControl4->setContentsMargins(6, 4, 6, -1); - labelCoinControlAfterFeeText = new QLabel(widgetCoinControl); - labelCoinControlAfterFeeText->setObjectName(QStringLiteral("labelCoinControlAfterFeeText")); - labelCoinControlAfterFeeText->setFont(font); - labelCoinControlAfterFeeText->setMargin(0); - - formLayoutCoinControl4->setWidget(0, QFormLayout::LabelRole, labelCoinControlAfterFeeText); - - labelCoinControlAfterFee = new QLabel(widgetCoinControl); - labelCoinControlAfterFee->setObjectName(QStringLiteral("labelCoinControlAfterFee")); - labelCoinControlAfterFee->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlAfterFee->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlAfterFee->setText(QStringLiteral("0.00 DASH")); - labelCoinControlAfterFee->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl4->setWidget(0, QFormLayout::FieldRole, labelCoinControlAfterFee); - - labelCoinControlChangeText = new QLabel(widgetCoinControl); - labelCoinControlChangeText->setObjectName(QStringLiteral("labelCoinControlChangeText")); - labelCoinControlChangeText->setFont(font); - - formLayoutCoinControl4->setWidget(1, QFormLayout::LabelRole, labelCoinControlChangeText); - - labelCoinControlChange = new QLabel(widgetCoinControl); - labelCoinControlChange->setObjectName(QStringLiteral("labelCoinControlChange")); - labelCoinControlChange->setCursor(QCursor(Qt::IBeamCursor)); - labelCoinControlChange->setContextMenuPolicy(Qt::ActionsContextMenu); - labelCoinControlChange->setText(QStringLiteral("0.00 DASH")); - labelCoinControlChange->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - formLayoutCoinControl4->setWidget(1, QFormLayout::FieldRole, labelCoinControlChange); - - - horizontalLayoutCoinControl3->addLayout(formLayoutCoinControl4); - - horizontalLayoutCoinControl3->setStretch(3, 1); - - horizontalLayoutCoinControl5->addLayout(horizontalLayoutCoinControl3); - - - verticalLayoutCoinControl->addWidget(widgetCoinControl); - - horizontalLayoutCoinControl4 = new QHBoxLayout(); - horizontalLayoutCoinControl4->setSpacing(12); - horizontalLayoutCoinControl4->setObjectName(QStringLiteral("horizontalLayoutCoinControl4")); - horizontalLayoutCoinControl4->setSizeConstraint(QLayout::SetDefaultConstraint); - horizontalLayoutCoinControl4->setContentsMargins(-1, 5, 5, -1); - checkBoxCoinControlChange = new QCheckBox(frameCoinControl); - checkBoxCoinControlChange->setObjectName(QStringLiteral("checkBoxCoinControlChange")); - - horizontalLayoutCoinControl4->addWidget(checkBoxCoinControlChange); - - lineEditCoinControlChange = new QValidatedLineEdit(frameCoinControl); - lineEditCoinControlChange->setObjectName(QStringLiteral("lineEditCoinControlChange")); - lineEditCoinControlChange->setEnabled(false); - QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Fixed); - sizePolicy3.setHorizontalStretch(0); - sizePolicy3.setVerticalStretch(0); - sizePolicy3.setHeightForWidth(lineEditCoinControlChange->sizePolicy().hasHeightForWidth()); - lineEditCoinControlChange->setSizePolicy(sizePolicy3); - - horizontalLayoutCoinControl4->addWidget(lineEditCoinControlChange); - - labelCoinControlChangeLabel = new QLabel(frameCoinControl); - labelCoinControlChangeLabel->setObjectName(QStringLiteral("labelCoinControlChangeLabel")); - QSizePolicy sizePolicy4(QSizePolicy::Preferred, QSizePolicy::Expanding); - sizePolicy4.setHorizontalStretch(0); - sizePolicy4.setVerticalStretch(0); - sizePolicy4.setHeightForWidth(labelCoinControlChangeLabel->sizePolicy().hasHeightForWidth()); - labelCoinControlChangeLabel->setSizePolicy(sizePolicy4); - labelCoinControlChangeLabel->setMinimumSize(QSize(0, 0)); - labelCoinControlChangeLabel->setMargin(3); - - horizontalLayoutCoinControl4->addWidget(labelCoinControlChangeLabel); - - - verticalLayoutCoinControl->addLayout(horizontalLayoutCoinControl4); - - verticalSpacerCoinControl = new QSpacerItem(800, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayoutCoinControl->addItem(verticalSpacerCoinControl); - - verticalLayoutCoinControl->setStretch(4, 1); - - verticalLayoutCoinControl2->addLayout(verticalLayoutCoinControl); - - - verticalLayout->addWidget(frameCoinControl); - - scrollArea = new QScrollArea(SendCoinsDialog); - scrollArea->setObjectName(QStringLiteral("scrollArea")); - scrollArea->setWidgetResizable(true); - scrollAreaWidgetContents = new QWidget(); - scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); - scrollAreaWidgetContents->setGeometry(QRect(0, 0, 828, 153)); - verticalLayout_2 = new QVBoxLayout(scrollAreaWidgetContents); - verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); - verticalLayout_2->setContentsMargins(0, 0, 0, 0); - entries = new QVBoxLayout(); - entries->setSpacing(6); - entries->setObjectName(QStringLiteral("entries")); - - verticalLayout_2->addLayout(entries); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - verticalLayout_2->addItem(verticalSpacer); - - verticalLayout_2->setStretch(1, 1); - scrollArea->setWidget(scrollAreaWidgetContents); - - verticalLayout->addWidget(scrollArea); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - sendButton = new QPushButton(SendCoinsDialog); - sendButton->setObjectName(QStringLiteral("sendButton")); - sendButton->setMinimumSize(QSize(150, 0)); - QIcon icon; - icon.addFile(QStringLiteral(":/icons/send"), QSize(), QIcon::Normal, QIcon::Off); - sendButton->setIcon(icon); - sendButton->setDefault(true); - - horizontalLayout->addWidget(sendButton); - - clearButton = new QPushButton(SendCoinsDialog); - clearButton->setObjectName(QStringLiteral("clearButton")); - QSizePolicy sizePolicy5(QSizePolicy::Minimum, QSizePolicy::Fixed); - sizePolicy5.setHorizontalStretch(0); - sizePolicy5.setVerticalStretch(0); - sizePolicy5.setHeightForWidth(clearButton->sizePolicy().hasHeightForWidth()); - clearButton->setSizePolicy(sizePolicy5); - QIcon icon1; - icon1.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); - clearButton->setIcon(icon1); - clearButton->setAutoRepeatDelay(300); - clearButton->setAutoDefault(false); - - horizontalLayout->addWidget(clearButton); - - addButton = new QPushButton(SendCoinsDialog); - addButton->setObjectName(QStringLiteral("addButton")); - QIcon icon2; - icon2.addFile(QStringLiteral(":/icons/add"), QSize(), QIcon::Normal, QIcon::Off); - addButton->setIcon(icon2); - addButton->setAutoDefault(false); - - horizontalLayout->addWidget(addButton); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout->addItem(horizontalSpacer); - - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setSpacing(3); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - checkUseDarksend = new QCheckBox(SendCoinsDialog); - checkUseDarksend->setObjectName(QStringLiteral("checkUseDarksend")); - checkUseDarksend->setMinimumSize(QSize(95, 0)); - checkUseDarksend->setChecked(true); - - horizontalLayout_2->addWidget(checkUseDarksend); - - checkInstantX = new QCheckBox(SendCoinsDialog); - checkInstantX->setObjectName(QStringLiteral("checkInstantX")); - checkInstantX->setEnabled(true); - checkInstantX->setMinimumSize(QSize(85, 0)); - - horizontalLayout_2->addWidget(checkInstantX); - - label = new QLabel(SendCoinsDialog); - label->setObjectName(QStringLiteral("label")); - - horizontalLayout_2->addWidget(label); - - labelBalance = new QLabel(SendCoinsDialog); - labelBalance->setObjectName(QStringLiteral("labelBalance")); - QSizePolicy sizePolicy6(QSizePolicy::Preferred, QSizePolicy::Fixed); - sizePolicy6.setHorizontalStretch(0); - sizePolicy6.setVerticalStretch(0); - sizePolicy6.setHeightForWidth(labelBalance->sizePolicy().hasHeightForWidth()); - labelBalance->setSizePolicy(sizePolicy6); - labelBalance->setCursor(QCursor(Qt::IBeamCursor)); - labelBalance->setText(QStringLiteral("123.456 DASH")); - labelBalance->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - - horizontalLayout_2->addWidget(labelBalance); - - - horizontalLayout->addLayout(horizontalLayout_2); - - - verticalLayout->addLayout(horizontalLayout); - - verticalLayout->setStretch(1, 1); - - retranslateUi(SendCoinsDialog); - - QMetaObject::connectSlotsByName(SendCoinsDialog); - } // setupUi - - void retranslateUi(QDialog *SendCoinsDialog) - { - SendCoinsDialog->setWindowTitle(QApplication::translate("SendCoinsDialog", "Send Coins", 0)); - labelCoinControlFeatures->setText(QApplication::translate("SendCoinsDialog", "Coin Control Features", 0)); - pushButtonCoinControl->setText(QApplication::translate("SendCoinsDialog", "Inputs...", 0)); - labelCoinControlAutomaticallySelected->setText(QApplication::translate("SendCoinsDialog", "automatically selected", 0)); - labelCoinControlInsuffFunds->setText(QApplication::translate("SendCoinsDialog", "Insufficient funds!", 0)); - labelCoinControlQuantityText->setText(QApplication::translate("SendCoinsDialog", "Quantity:", 0)); - labelCoinControlBytesText->setText(QApplication::translate("SendCoinsDialog", "Bytes:", 0)); - labelCoinControlAmountText->setText(QApplication::translate("SendCoinsDialog", "Amount:", 0)); - labelCoinControlPriorityText->setText(QApplication::translate("SendCoinsDialog", "Priority:", 0)); - labelCoinControlPriority->setText(QApplication::translate("SendCoinsDialog", "medium", 0)); - labelCoinControlFeeText->setText(QApplication::translate("SendCoinsDialog", "Fee:", 0)); - labelCoinControlLowOutputText->setText(QApplication::translate("SendCoinsDialog", "Low Output:", 0)); - labelCoinControlLowOutput->setText(QApplication::translate("SendCoinsDialog", "no", 0)); - labelCoinControlAfterFeeText->setText(QApplication::translate("SendCoinsDialog", "After Fee:", 0)); - labelCoinControlChangeText->setText(QApplication::translate("SendCoinsDialog", "Change:", 0)); -#ifndef QT_NO_TOOLTIP - checkBoxCoinControlChange->setToolTip(QApplication::translate("SendCoinsDialog", "If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.", 0)); -#endif // QT_NO_TOOLTIP - checkBoxCoinControlChange->setText(QApplication::translate("SendCoinsDialog", "Custom change address", 0)); - labelCoinControlChangeLabel->setText(QString()); -#ifndef QT_NO_TOOLTIP - sendButton->setToolTip(QApplication::translate("SendCoinsDialog", "Confirm the send action", 0)); -#endif // QT_NO_TOOLTIP - sendButton->setText(QApplication::translate("SendCoinsDialog", "S&end", 0)); -#ifndef QT_NO_TOOLTIP - clearButton->setToolTip(QApplication::translate("SendCoinsDialog", "Clear all fields of the form.", 0)); -#endif // QT_NO_TOOLTIP - clearButton->setText(QApplication::translate("SendCoinsDialog", "Clear &All", 0)); -#ifndef QT_NO_TOOLTIP - addButton->setToolTip(QApplication::translate("SendCoinsDialog", "Send to multiple recipients at once", 0)); -#endif // QT_NO_TOOLTIP - addButton->setText(QApplication::translate("SendCoinsDialog", "Add &Recipient", 0)); - checkUseDarksend->setText(QApplication::translate("SendCoinsDialog", "Darksend", 0)); - checkInstantX->setText(QApplication::translate("SendCoinsDialog", "InstantX", 0)); - label->setText(QApplication::translate("SendCoinsDialog", "Balance:", 0)); - } // retranslateUi - -}; - -namespace Ui { - class SendCoinsDialog: public Ui_SendCoinsDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_SENDCOINSDIALOG_H diff --git a/contrib/ui_sendcoinsentry.h b/contrib/ui_sendcoinsentry.h deleted file mode 100644 index 2ad3d6e42..000000000 --- a/contrib/ui_sendcoinsentry.h +++ /dev/null @@ -1,484 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'sendcoinsentry.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_SENDCOINSENTRY_H -#define UI_SENDCOINSENTRY_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "bitcoinamountfield.h" -#include "qvalidatedlineedit.h" - -QT_BEGIN_NAMESPACE - -class Ui_SendCoinsEntry -{ -public: - QFrame *SendCoins; - QGridLayout *gridLayout; - QLabel *payToLabel; - QHBoxLayout *payToLayout; - QValidatedLineEdit *payTo; - QToolButton *addressBookButton; - QToolButton *pasteButton; - QToolButton *deleteButton; - QLabel *labellLabel; - QLineEdit *addAsLabel; - QLabel *amountLabel; - BitcoinAmountField *payAmount; - QLabel *messageLabel; - QLabel *messageTextLabel; - QFrame *SendCoins_InsecurePaymentRequest; - QGridLayout *gridLayout_is; - QLabel *payToLabel_is; - QHBoxLayout *payToLayout_is; - QLabel *payTo_is; - QToolButton *deleteButton_is; - QLabel *memoLabel_is; - QLabel *memoTextLabel_is; - QLabel *amountLabel_is; - BitcoinAmountField *payAmount_is; - QFrame *SendCoins_SecurePaymentRequest; - QGridLayout *gridLayout_s; - QLabel *payToLabel_s; - QHBoxLayout *payToLayout_s; - QLabel *payTo_s; - QToolButton *deleteButton_s; - QLabel *memoLabel_s; - QLabel *memoTextLabel_s; - QLabel *amountLabel_s; - BitcoinAmountField *payAmount_s; - - void setupUi(QStackedWidget *SendCoinsEntry) - { - if (SendCoinsEntry->objectName().isEmpty()) - SendCoinsEntry->setObjectName(QStringLiteral("SendCoinsEntry")); - SendCoinsEntry->resize(729, 150); - SendCoinsEntry->setFocusPolicy(Qt::TabFocus); - SendCoinsEntry->setAutoFillBackground(false); - SendCoins = new QFrame(); - SendCoins->setObjectName(QStringLiteral("SendCoins")); - SendCoins->setFrameShape(QFrame::StyledPanel); - SendCoins->setFrameShadow(QFrame::Sunken); - gridLayout = new QGridLayout(SendCoins); - gridLayout->setSpacing(12); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - payToLabel = new QLabel(SendCoins); - payToLabel->setObjectName(QStringLiteral("payToLabel")); - payToLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(payToLabel, 0, 0, 1, 1); - - payToLayout = new QHBoxLayout(); - payToLayout->setSpacing(0); - payToLayout->setObjectName(QStringLiteral("payToLayout")); - payTo = new QValidatedLineEdit(SendCoins); - payTo->setObjectName(QStringLiteral("payTo")); - - payToLayout->addWidget(payTo); - - addressBookButton = new QToolButton(SendCoins); - addressBookButton->setObjectName(QStringLiteral("addressBookButton")); - QIcon icon; - icon.addFile(QStringLiteral(":/icons/address-book"), QSize(), QIcon::Normal, QIcon::Off); - addressBookButton->setIcon(icon); - - payToLayout->addWidget(addressBookButton); - - pasteButton = new QToolButton(SendCoins); - pasteButton->setObjectName(QStringLiteral("pasteButton")); - QIcon icon1; - icon1.addFile(QStringLiteral(":/icons/editpaste"), QSize(), QIcon::Normal, QIcon::Off); - pasteButton->setIcon(icon1); - - payToLayout->addWidget(pasteButton); - - deleteButton = new QToolButton(SendCoins); - deleteButton->setObjectName(QStringLiteral("deleteButton")); - QIcon icon2; - icon2.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); - deleteButton->setIcon(icon2); - - payToLayout->addWidget(deleteButton); - - - gridLayout->addLayout(payToLayout, 0, 1, 1, 1); - - labellLabel = new QLabel(SendCoins); - labellLabel->setObjectName(QStringLiteral("labellLabel")); - labellLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(labellLabel, 1, 0, 1, 1); - - addAsLabel = new QLineEdit(SendCoins); - addAsLabel->setObjectName(QStringLiteral("addAsLabel")); - - gridLayout->addWidget(addAsLabel, 1, 1, 1, 1); - - amountLabel = new QLabel(SendCoins); - amountLabel->setObjectName(QStringLiteral("amountLabel")); - amountLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(amountLabel, 2, 0, 1, 1); - - payAmount = new BitcoinAmountField(SendCoins); - payAmount->setObjectName(QStringLiteral("payAmount")); - - gridLayout->addWidget(payAmount, 2, 1, 1, 1); - - messageLabel = new QLabel(SendCoins); - messageLabel->setObjectName(QStringLiteral("messageLabel")); - messageLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout->addWidget(messageLabel, 3, 0, 1, 1); - - messageTextLabel = new QLabel(SendCoins); - messageTextLabel->setObjectName(QStringLiteral("messageTextLabel")); - messageTextLabel->setTextFormat(Qt::PlainText); - - gridLayout->addWidget(messageTextLabel, 3, 1, 1, 1); - - SendCoinsEntry->addWidget(SendCoins); - SendCoins_InsecurePaymentRequest = new QFrame(); - SendCoins_InsecurePaymentRequest->setObjectName(QStringLiteral("SendCoins_InsecurePaymentRequest")); - QPalette palette; - QBrush brush(QColor(0, 0, 0, 255)); - brush.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::WindowText, brush); - QBrush brush1(QColor(255, 255, 127, 255)); - brush1.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Button, brush1); - QBrush brush2(QColor(255, 255, 255, 255)); - brush2.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Light, brush2); - QBrush brush3(QColor(255, 255, 191, 255)); - brush3.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Midlight, brush3); - QBrush brush4(QColor(127, 127, 63, 255)); - brush4.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Dark, brush4); - QBrush brush5(QColor(170, 170, 84, 255)); - brush5.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::Mid, brush5); - palette.setBrush(QPalette::Active, QPalette::Text, brush); - palette.setBrush(QPalette::Active, QPalette::BrightText, brush2); - palette.setBrush(QPalette::Active, QPalette::ButtonText, brush); - palette.setBrush(QPalette::Active, QPalette::Base, brush2); - palette.setBrush(QPalette::Active, QPalette::Window, brush1); - palette.setBrush(QPalette::Active, QPalette::Shadow, brush); - palette.setBrush(QPalette::Active, QPalette::AlternateBase, brush3); - QBrush brush6(QColor(255, 255, 220, 255)); - brush6.setStyle(Qt::SolidPattern); - palette.setBrush(QPalette::Active, QPalette::ToolTipBase, brush6); - palette.setBrush(QPalette::Active, QPalette::ToolTipText, brush); - palette.setBrush(QPalette::Inactive, QPalette::WindowText, brush); - palette.setBrush(QPalette::Inactive, QPalette::Button, brush1); - palette.setBrush(QPalette::Inactive, QPalette::Light, brush2); - palette.setBrush(QPalette::Inactive, QPalette::Midlight, brush3); - palette.setBrush(QPalette::Inactive, QPalette::Dark, brush4); - palette.setBrush(QPalette::Inactive, QPalette::Mid, brush5); - palette.setBrush(QPalette::Inactive, QPalette::Text, brush); - palette.setBrush(QPalette::Inactive, QPalette::BrightText, brush2); - palette.setBrush(QPalette::Inactive, QPalette::ButtonText, brush); - palette.setBrush(QPalette::Inactive, QPalette::Base, brush2); - palette.setBrush(QPalette::Inactive, QPalette::Window, brush1); - palette.setBrush(QPalette::Inactive, QPalette::Shadow, brush); - palette.setBrush(QPalette::Inactive, QPalette::AlternateBase, brush3); - palette.setBrush(QPalette::Inactive, QPalette::ToolTipBase, brush6); - palette.setBrush(QPalette::Inactive, QPalette::ToolTipText, brush); - palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush4); - palette.setBrush(QPalette::Disabled, QPalette::Button, brush1); - palette.setBrush(QPalette::Disabled, QPalette::Light, brush2); - palette.setBrush(QPalette::Disabled, QPalette::Midlight, brush3); - palette.setBrush(QPalette::Disabled, QPalette::Dark, brush4); - palette.setBrush(QPalette::Disabled, QPalette::Mid, brush5); - palette.setBrush(QPalette::Disabled, QPalette::Text, brush4); - palette.setBrush(QPalette::Disabled, QPalette::BrightText, brush2); - palette.setBrush(QPalette::Disabled, QPalette::ButtonText, brush4); - palette.setBrush(QPalette::Disabled, QPalette::Base, brush1); - palette.setBrush(QPalette::Disabled, QPalette::Window, brush1); - palette.setBrush(QPalette::Disabled, QPalette::Shadow, brush); - palette.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush1); - palette.setBrush(QPalette::Disabled, QPalette::ToolTipBase, brush6); - palette.setBrush(QPalette::Disabled, QPalette::ToolTipText, brush); - SendCoins_InsecurePaymentRequest->setPalette(palette); - SendCoins_InsecurePaymentRequest->setAutoFillBackground(true); - SendCoins_InsecurePaymentRequest->setFrameShape(QFrame::StyledPanel); - SendCoins_InsecurePaymentRequest->setFrameShadow(QFrame::Sunken); - gridLayout_is = new QGridLayout(SendCoins_InsecurePaymentRequest); - gridLayout_is->setSpacing(12); - gridLayout_is->setObjectName(QStringLiteral("gridLayout_is")); - payToLabel_is = new QLabel(SendCoins_InsecurePaymentRequest); - payToLabel_is->setObjectName(QStringLiteral("payToLabel_is")); - payToLabel_is->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout_is->addWidget(payToLabel_is, 0, 0, 1, 1); - - payToLayout_is = new QHBoxLayout(); - payToLayout_is->setSpacing(0); - payToLayout_is->setObjectName(QStringLiteral("payToLayout_is")); - payTo_is = new QLabel(SendCoins_InsecurePaymentRequest); - payTo_is->setObjectName(QStringLiteral("payTo_is")); - - payToLayout_is->addWidget(payTo_is); - - deleteButton_is = new QToolButton(SendCoins_InsecurePaymentRequest); - deleteButton_is->setObjectName(QStringLiteral("deleteButton_is")); - deleteButton_is->setIcon(icon2); - - payToLayout_is->addWidget(deleteButton_is); - - - gridLayout_is->addLayout(payToLayout_is, 0, 1, 1, 1); - - memoLabel_is = new QLabel(SendCoins_InsecurePaymentRequest); - memoLabel_is->setObjectName(QStringLiteral("memoLabel_is")); - memoLabel_is->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout_is->addWidget(memoLabel_is, 1, 0, 1, 1); - - memoTextLabel_is = new QLabel(SendCoins_InsecurePaymentRequest); - memoTextLabel_is->setObjectName(QStringLiteral("memoTextLabel_is")); - memoTextLabel_is->setTextFormat(Qt::PlainText); - - gridLayout_is->addWidget(memoTextLabel_is, 1, 1, 1, 1); - - amountLabel_is = new QLabel(SendCoins_InsecurePaymentRequest); - amountLabel_is->setObjectName(QStringLiteral("amountLabel_is")); - amountLabel_is->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout_is->addWidget(amountLabel_is, 2, 0, 1, 1); - - payAmount_is = new BitcoinAmountField(SendCoins_InsecurePaymentRequest); - payAmount_is->setObjectName(QStringLiteral("payAmount_is")); - payAmount_is->setAcceptDrops(false); - - gridLayout_is->addWidget(payAmount_is, 2, 1, 1, 1); - - SendCoinsEntry->addWidget(SendCoins_InsecurePaymentRequest); - SendCoins_SecurePaymentRequest = new QFrame(); - SendCoins_SecurePaymentRequest->setObjectName(QStringLiteral("SendCoins_SecurePaymentRequest")); - QPalette palette1; - palette1.setBrush(QPalette::Active, QPalette::WindowText, brush); - QBrush brush7(QColor(140, 232, 119, 255)); - brush7.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Button, brush7); - QBrush brush8(QColor(230, 255, 224, 255)); - brush8.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Light, brush8); - QBrush brush9(QColor(185, 243, 171, 255)); - brush9.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Midlight, brush9); - QBrush brush10(QColor(70, 116, 59, 255)); - brush10.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Dark, brush10); - QBrush brush11(QColor(93, 155, 79, 255)); - brush11.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Mid, brush11); - palette1.setBrush(QPalette::Active, QPalette::Text, brush); - QBrush brush12(QColor(155, 255, 147, 255)); - brush12.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::BrightText, brush12); - palette1.setBrush(QPalette::Active, QPalette::ButtonText, brush); - QBrush brush13(QColor(119, 255, 233, 255)); - brush13.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::Base, brush13); - palette1.setBrush(QPalette::Active, QPalette::Window, brush7); - palette1.setBrush(QPalette::Active, QPalette::Shadow, brush); - QBrush brush14(QColor(197, 243, 187, 255)); - brush14.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::AlternateBase, brush14); - QBrush brush15(QColor(125, 194, 122, 255)); - brush15.setStyle(Qt::SolidPattern); - palette1.setBrush(QPalette::Active, QPalette::NoRole, brush15); - palette1.setBrush(QPalette::Active, QPalette::ToolTipBase, brush6); - palette1.setBrush(QPalette::Active, QPalette::ToolTipText, brush); - palette1.setBrush(QPalette::Inactive, QPalette::WindowText, brush); - palette1.setBrush(QPalette::Inactive, QPalette::Button, brush7); - palette1.setBrush(QPalette::Inactive, QPalette::Light, brush8); - palette1.setBrush(QPalette::Inactive, QPalette::Midlight, brush9); - palette1.setBrush(QPalette::Inactive, QPalette::Dark, brush10); - palette1.setBrush(QPalette::Inactive, QPalette::Mid, brush11); - palette1.setBrush(QPalette::Inactive, QPalette::Text, brush); - palette1.setBrush(QPalette::Inactive, QPalette::BrightText, brush12); - palette1.setBrush(QPalette::Inactive, QPalette::ButtonText, brush); - palette1.setBrush(QPalette::Inactive, QPalette::Base, brush13); - palette1.setBrush(QPalette::Inactive, QPalette::Window, brush7); - palette1.setBrush(QPalette::Inactive, QPalette::Shadow, brush); - palette1.setBrush(QPalette::Inactive, QPalette::AlternateBase, brush14); - palette1.setBrush(QPalette::Inactive, QPalette::NoRole, brush15); - palette1.setBrush(QPalette::Inactive, QPalette::ToolTipBase, brush6); - palette1.setBrush(QPalette::Inactive, QPalette::ToolTipText, brush); - palette1.setBrush(QPalette::Disabled, QPalette::WindowText, brush10); - palette1.setBrush(QPalette::Disabled, QPalette::Button, brush7); - palette1.setBrush(QPalette::Disabled, QPalette::Light, brush8); - palette1.setBrush(QPalette::Disabled, QPalette::Midlight, brush9); - palette1.setBrush(QPalette::Disabled, QPalette::Dark, brush10); - palette1.setBrush(QPalette::Disabled, QPalette::Mid, brush11); - palette1.setBrush(QPalette::Disabled, QPalette::Text, brush10); - palette1.setBrush(QPalette::Disabled, QPalette::BrightText, brush12); - palette1.setBrush(QPalette::Disabled, QPalette::ButtonText, brush10); - palette1.setBrush(QPalette::Disabled, QPalette::Base, brush7); - palette1.setBrush(QPalette::Disabled, QPalette::Window, brush7); - palette1.setBrush(QPalette::Disabled, QPalette::Shadow, brush); - palette1.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush7); - palette1.setBrush(QPalette::Disabled, QPalette::NoRole, brush15); - palette1.setBrush(QPalette::Disabled, QPalette::ToolTipBase, brush6); - palette1.setBrush(QPalette::Disabled, QPalette::ToolTipText, brush); - SendCoins_SecurePaymentRequest->setPalette(palette1); - SendCoins_SecurePaymentRequest->setAutoFillBackground(true); - SendCoins_SecurePaymentRequest->setFrameShape(QFrame::StyledPanel); - SendCoins_SecurePaymentRequest->setFrameShadow(QFrame::Sunken); - gridLayout_s = new QGridLayout(SendCoins_SecurePaymentRequest); - gridLayout_s->setSpacing(12); - gridLayout_s->setObjectName(QStringLiteral("gridLayout_s")); - payToLabel_s = new QLabel(SendCoins_SecurePaymentRequest); - payToLabel_s->setObjectName(QStringLiteral("payToLabel_s")); - payToLabel_s->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout_s->addWidget(payToLabel_s, 0, 0, 1, 1); - - payToLayout_s = new QHBoxLayout(); - payToLayout_s->setSpacing(0); - payToLayout_s->setObjectName(QStringLiteral("payToLayout_s")); - payTo_s = new QLabel(SendCoins_SecurePaymentRequest); - payTo_s->setObjectName(QStringLiteral("payTo_s")); - payTo_s->setTextFormat(Qt::PlainText); - - payToLayout_s->addWidget(payTo_s); - - deleteButton_s = new QToolButton(SendCoins_SecurePaymentRequest); - deleteButton_s->setObjectName(QStringLiteral("deleteButton_s")); - deleteButton_s->setIcon(icon2); - - payToLayout_s->addWidget(deleteButton_s); - - - gridLayout_s->addLayout(payToLayout_s, 0, 1, 1, 1); - - memoLabel_s = new QLabel(SendCoins_SecurePaymentRequest); - memoLabel_s->setObjectName(QStringLiteral("memoLabel_s")); - memoLabel_s->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout_s->addWidget(memoLabel_s, 1, 0, 1, 1); - - memoTextLabel_s = new QLabel(SendCoins_SecurePaymentRequest); - memoTextLabel_s->setObjectName(QStringLiteral("memoTextLabel_s")); - memoTextLabel_s->setTextFormat(Qt::PlainText); - - gridLayout_s->addWidget(memoTextLabel_s, 1, 1, 1, 1); - - amountLabel_s = new QLabel(SendCoins_SecurePaymentRequest); - amountLabel_s->setObjectName(QStringLiteral("amountLabel_s")); - amountLabel_s->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - gridLayout_s->addWidget(amountLabel_s, 2, 0, 1, 1); - - payAmount_s = new BitcoinAmountField(SendCoins_SecurePaymentRequest); - payAmount_s->setObjectName(QStringLiteral("payAmount_s")); - payAmount_s->setAcceptDrops(false); - - gridLayout_s->addWidget(payAmount_s, 2, 1, 1, 1); - - SendCoinsEntry->addWidget(SendCoins_SecurePaymentRequest); -#ifndef QT_NO_SHORTCUT - payToLabel->setBuddy(payTo); - labellLabel->setBuddy(addAsLabel); - amountLabel->setBuddy(payAmount); - amountLabel_is->setBuddy(payAmount_is); - amountLabel_s->setBuddy(payAmount_s); -#endif // QT_NO_SHORTCUT - QWidget::setTabOrder(payTo, addressBookButton); - QWidget::setTabOrder(addressBookButton, pasteButton); - QWidget::setTabOrder(pasteButton, deleteButton); - QWidget::setTabOrder(deleteButton, addAsLabel); - QWidget::setTabOrder(addAsLabel, payAmount); - QWidget::setTabOrder(payAmount, payAmount_is); - QWidget::setTabOrder(payAmount_is, deleteButton_is); - QWidget::setTabOrder(deleteButton_is, payAmount_s); - QWidget::setTabOrder(payAmount_s, deleteButton_s); - - retranslateUi(SendCoinsEntry); - - QMetaObject::connectSlotsByName(SendCoinsEntry); - } // setupUi - - void retranslateUi(QStackedWidget *SendCoinsEntry) - { -#ifndef QT_NO_TOOLTIP - SendCoins->setToolTip(QApplication::translate("SendCoinsEntry", "This is a normal payment.", 0)); -#endif // QT_NO_TOOLTIP - payToLabel->setText(QApplication::translate("SendCoinsEntry", "Pay &To:", 0)); -#ifndef QT_NO_TOOLTIP - payTo->setToolTip(QApplication::translate("SendCoinsEntry", "The address to send the payment to (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - addressBookButton->setToolTip(QApplication::translate("SendCoinsEntry", "Choose previously used address", 0)); -#endif // QT_NO_TOOLTIP - addressBookButton->setText(QString()); - addressBookButton->setShortcut(QApplication::translate("SendCoinsEntry", "Alt+A", 0)); -#ifndef QT_NO_TOOLTIP - pasteButton->setToolTip(QApplication::translate("SendCoinsEntry", "Paste address from clipboard", 0)); -#endif // QT_NO_TOOLTIP - pasteButton->setText(QString()); - pasteButton->setShortcut(QApplication::translate("SendCoinsEntry", "Alt+P", 0)); -#ifndef QT_NO_TOOLTIP - deleteButton->setToolTip(QApplication::translate("SendCoinsEntry", "Remove this entry", 0)); -#endif // QT_NO_TOOLTIP - deleteButton->setText(QString()); - labellLabel->setText(QApplication::translate("SendCoinsEntry", "&Label:", 0)); -#ifndef QT_NO_TOOLTIP - addAsLabel->setToolTip(QApplication::translate("SendCoinsEntry", "Enter a label for this address to add it to the list of used addresses", 0)); -#endif // QT_NO_TOOLTIP - amountLabel->setText(QApplication::translate("SendCoinsEntry", "A&mount:", 0)); - messageLabel->setText(QApplication::translate("SendCoinsEntry", "Message:", 0)); -#ifndef QT_NO_TOOLTIP - messageTextLabel->setToolTip(QApplication::translate("SendCoinsEntry", "A message that was attached to the interzone: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Interzone network.", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - SendCoins_InsecurePaymentRequest->setToolTip(QApplication::translate("SendCoinsEntry", "This is an unverified payment request.", 0)); -#endif // QT_NO_TOOLTIP - payToLabel_is->setText(QApplication::translate("SendCoinsEntry", "Pay To:", 0)); -#ifndef QT_NO_TOOLTIP - deleteButton_is->setToolTip(QApplication::translate("SendCoinsEntry", "Remove this entry", 0)); -#endif // QT_NO_TOOLTIP - deleteButton_is->setText(QString()); - memoLabel_is->setText(QApplication::translate("SendCoinsEntry", "Memo:", 0)); - amountLabel_is->setText(QApplication::translate("SendCoinsEntry", "A&mount:", 0)); -#ifndef QT_NO_TOOLTIP - SendCoins_SecurePaymentRequest->setToolTip(QApplication::translate("SendCoinsEntry", "This is a verified payment request.", 0)); -#endif // QT_NO_TOOLTIP - payToLabel_s->setText(QApplication::translate("SendCoinsEntry", "Pay To:", 0)); -#ifndef QT_NO_TOOLTIP - deleteButton_s->setToolTip(QApplication::translate("SendCoinsEntry", "Remove this entry", 0)); -#endif // QT_NO_TOOLTIP - deleteButton_s->setText(QString()); - memoLabel_s->setText(QApplication::translate("SendCoinsEntry", "Memo:", 0)); - amountLabel_s->setText(QApplication::translate("SendCoinsEntry", "A&mount:", 0)); - Q_UNUSED(SendCoinsEntry); - } // retranslateUi - -}; - -namespace Ui { - class SendCoinsEntry: public Ui_SendCoinsEntry {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_SENDCOINSENTRY_H diff --git a/contrib/ui_signverifymessagedialog.h b/contrib/ui_signverifymessagedialog.h deleted file mode 100644 index 5828c1f37..000000000 --- a/contrib/ui_signverifymessagedialog.h +++ /dev/null @@ -1,346 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'signverifymessagedialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_SIGNVERIFYMESSAGEDIALOG_H -#define UI_SIGNVERIFYMESSAGEDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "qvalidatedlineedit.h" - -QT_BEGIN_NAMESPACE - -class Ui_SignVerifyMessageDialog -{ -public: - QVBoxLayout *verticalLayout; - QTabWidget *tabWidget; - QWidget *tabSignMessage; - QVBoxLayout *verticalLayout_SM; - QLabel *infoLabel_SM; - QHBoxLayout *horizontalLayout_1_SM; - QValidatedLineEdit *addressIn_SM; - QPushButton *addressBookButton_SM; - QPushButton *pasteButton_SM; - QPlainTextEdit *messageIn_SM; - QLabel *signatureLabel_SM; - QHBoxLayout *horizontalLayout_2_SM; - QLineEdit *signatureOut_SM; - QPushButton *copySignatureButton_SM; - QHBoxLayout *horizontalLayout_3_SM; - QPushButton *signMessageButton_SM; - QPushButton *clearButton_SM; - QSpacerItem *horizontalSpacer_1_SM; - QLabel *statusLabel_SM; - QSpacerItem *horizontalSpacer_2_SM; - QWidget *tabVerifyMessage; - QVBoxLayout *verticalLayout_VM; - QLabel *infoLabel_VM; - QHBoxLayout *horizontalLayout_1_VM; - QValidatedLineEdit *addressIn_VM; - QPushButton *addressBookButton_VM; - QPlainTextEdit *messageIn_VM; - QValidatedLineEdit *signatureIn_VM; - QHBoxLayout *horizontalLayout_2_VM; - QPushButton *verifyMessageButton_VM; - QPushButton *clearButton_VM; - QSpacerItem *horizontalSpacer_1_VM; - QLabel *statusLabel_VM; - QSpacerItem *horizontalSpacer_2_VM; - - void setupUi(QDialog *SignVerifyMessageDialog) - { - if (SignVerifyMessageDialog->objectName().isEmpty()) - SignVerifyMessageDialog->setObjectName(QStringLiteral("SignVerifyMessageDialog")); - SignVerifyMessageDialog->resize(700, 380); - SignVerifyMessageDialog->setModal(true); - verticalLayout = new QVBoxLayout(SignVerifyMessageDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - tabWidget = new QTabWidget(SignVerifyMessageDialog); - tabWidget->setObjectName(QStringLiteral("tabWidget")); - tabSignMessage = new QWidget(); - tabSignMessage->setObjectName(QStringLiteral("tabSignMessage")); - verticalLayout_SM = new QVBoxLayout(tabSignMessage); - verticalLayout_SM->setObjectName(QStringLiteral("verticalLayout_SM")); - infoLabel_SM = new QLabel(tabSignMessage); - infoLabel_SM->setObjectName(QStringLiteral("infoLabel_SM")); - infoLabel_SM->setTextFormat(Qt::PlainText); - infoLabel_SM->setWordWrap(true); - - verticalLayout_SM->addWidget(infoLabel_SM); - - horizontalLayout_1_SM = new QHBoxLayout(); - horizontalLayout_1_SM->setSpacing(0); - horizontalLayout_1_SM->setObjectName(QStringLiteral("horizontalLayout_1_SM")); - addressIn_SM = new QValidatedLineEdit(tabSignMessage); - addressIn_SM->setObjectName(QStringLiteral("addressIn_SM")); - - horizontalLayout_1_SM->addWidget(addressIn_SM); - - addressBookButton_SM = new QPushButton(tabSignMessage); - addressBookButton_SM->setObjectName(QStringLiteral("addressBookButton_SM")); - QIcon icon; - icon.addFile(QStringLiteral(":/icons/address-book"), QSize(), QIcon::Normal, QIcon::Off); - addressBookButton_SM->setIcon(icon); - addressBookButton_SM->setAutoDefault(false); - - horizontalLayout_1_SM->addWidget(addressBookButton_SM); - - pasteButton_SM = new QPushButton(tabSignMessage); - pasteButton_SM->setObjectName(QStringLiteral("pasteButton_SM")); - QIcon icon1; - icon1.addFile(QStringLiteral(":/icons/editpaste"), QSize(), QIcon::Normal, QIcon::Off); - pasteButton_SM->setIcon(icon1); - pasteButton_SM->setAutoDefault(false); - - horizontalLayout_1_SM->addWidget(pasteButton_SM); - - - verticalLayout_SM->addLayout(horizontalLayout_1_SM); - - messageIn_SM = new QPlainTextEdit(tabSignMessage); - messageIn_SM->setObjectName(QStringLiteral("messageIn_SM")); - - verticalLayout_SM->addWidget(messageIn_SM); - - signatureLabel_SM = new QLabel(tabSignMessage); - signatureLabel_SM->setObjectName(QStringLiteral("signatureLabel_SM")); - signatureLabel_SM->setTextFormat(Qt::PlainText); - - verticalLayout_SM->addWidget(signatureLabel_SM); - - horizontalLayout_2_SM = new QHBoxLayout(); - horizontalLayout_2_SM->setSpacing(0); - horizontalLayout_2_SM->setObjectName(QStringLiteral("horizontalLayout_2_SM")); - signatureOut_SM = new QLineEdit(tabSignMessage); - signatureOut_SM->setObjectName(QStringLiteral("signatureOut_SM")); - QFont font; - font.setItalic(true); - signatureOut_SM->setFont(font); - signatureOut_SM->setReadOnly(true); - - horizontalLayout_2_SM->addWidget(signatureOut_SM); - - copySignatureButton_SM = new QPushButton(tabSignMessage); - copySignatureButton_SM->setObjectName(QStringLiteral("copySignatureButton_SM")); - QIcon icon2; - icon2.addFile(QStringLiteral(":/icons/editcopy"), QSize(), QIcon::Normal, QIcon::Off); - copySignatureButton_SM->setIcon(icon2); - copySignatureButton_SM->setAutoDefault(false); - - horizontalLayout_2_SM->addWidget(copySignatureButton_SM); - - - verticalLayout_SM->addLayout(horizontalLayout_2_SM); - - horizontalLayout_3_SM = new QHBoxLayout(); - horizontalLayout_3_SM->setObjectName(QStringLiteral("horizontalLayout_3_SM")); - signMessageButton_SM = new QPushButton(tabSignMessage); - signMessageButton_SM->setObjectName(QStringLiteral("signMessageButton_SM")); - QIcon icon3; - icon3.addFile(QStringLiteral(":/icons/edit"), QSize(), QIcon::Normal, QIcon::Off); - signMessageButton_SM->setIcon(icon3); - signMessageButton_SM->setAutoDefault(false); - - horizontalLayout_3_SM->addWidget(signMessageButton_SM); - - clearButton_SM = new QPushButton(tabSignMessage); - clearButton_SM->setObjectName(QStringLiteral("clearButton_SM")); - QIcon icon4; - icon4.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off); - clearButton_SM->setIcon(icon4); - clearButton_SM->setAutoDefault(false); - - horizontalLayout_3_SM->addWidget(clearButton_SM); - - horizontalSpacer_1_SM = new QSpacerItem(40, 48, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_3_SM->addItem(horizontalSpacer_1_SM); - - statusLabel_SM = new QLabel(tabSignMessage); - statusLabel_SM->setObjectName(QStringLiteral("statusLabel_SM")); - QFont font1; - font1.setBold(true); - font1.setWeight(75); - statusLabel_SM->setFont(font1); - statusLabel_SM->setWordWrap(true); - - horizontalLayout_3_SM->addWidget(statusLabel_SM); - - horizontalSpacer_2_SM = new QSpacerItem(40, 48, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_3_SM->addItem(horizontalSpacer_2_SM); - - - verticalLayout_SM->addLayout(horizontalLayout_3_SM); - - tabWidget->addTab(tabSignMessage, QString()); - tabVerifyMessage = new QWidget(); - tabVerifyMessage->setObjectName(QStringLiteral("tabVerifyMessage")); - verticalLayout_VM = new QVBoxLayout(tabVerifyMessage); - verticalLayout_VM->setObjectName(QStringLiteral("verticalLayout_VM")); - infoLabel_VM = new QLabel(tabVerifyMessage); - infoLabel_VM->setObjectName(QStringLiteral("infoLabel_VM")); - infoLabel_VM->setTextFormat(Qt::PlainText); - infoLabel_VM->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); - infoLabel_VM->setWordWrap(true); - - verticalLayout_VM->addWidget(infoLabel_VM); - - horizontalLayout_1_VM = new QHBoxLayout(); - horizontalLayout_1_VM->setSpacing(0); - horizontalLayout_1_VM->setObjectName(QStringLiteral("horizontalLayout_1_VM")); - addressIn_VM = new QValidatedLineEdit(tabVerifyMessage); - addressIn_VM->setObjectName(QStringLiteral("addressIn_VM")); - - horizontalLayout_1_VM->addWidget(addressIn_VM); - - addressBookButton_VM = new QPushButton(tabVerifyMessage); - addressBookButton_VM->setObjectName(QStringLiteral("addressBookButton_VM")); - addressBookButton_VM->setIcon(icon); - addressBookButton_VM->setAutoDefault(false); - - horizontalLayout_1_VM->addWidget(addressBookButton_VM); - - - verticalLayout_VM->addLayout(horizontalLayout_1_VM); - - messageIn_VM = new QPlainTextEdit(tabVerifyMessage); - messageIn_VM->setObjectName(QStringLiteral("messageIn_VM")); - - verticalLayout_VM->addWidget(messageIn_VM); - - signatureIn_VM = new QValidatedLineEdit(tabVerifyMessage); - signatureIn_VM->setObjectName(QStringLiteral("signatureIn_VM")); - - verticalLayout_VM->addWidget(signatureIn_VM); - - horizontalLayout_2_VM = new QHBoxLayout(); - horizontalLayout_2_VM->setObjectName(QStringLiteral("horizontalLayout_2_VM")); - verifyMessageButton_VM = new QPushButton(tabVerifyMessage); - verifyMessageButton_VM->setObjectName(QStringLiteral("verifyMessageButton_VM")); - QIcon icon5; - icon5.addFile(QStringLiteral(":/icons/transaction_0"), QSize(), QIcon::Normal, QIcon::Off); - verifyMessageButton_VM->setIcon(icon5); - verifyMessageButton_VM->setAutoDefault(false); - - horizontalLayout_2_VM->addWidget(verifyMessageButton_VM); - - clearButton_VM = new QPushButton(tabVerifyMessage); - clearButton_VM->setObjectName(QStringLiteral("clearButton_VM")); - clearButton_VM->setIcon(icon4); - clearButton_VM->setAutoDefault(false); - - horizontalLayout_2_VM->addWidget(clearButton_VM); - - horizontalSpacer_1_VM = new QSpacerItem(40, 48, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_2_VM->addItem(horizontalSpacer_1_VM); - - statusLabel_VM = new QLabel(tabVerifyMessage); - statusLabel_VM->setObjectName(QStringLiteral("statusLabel_VM")); - statusLabel_VM->setFont(font1); - statusLabel_VM->setWordWrap(true); - - horizontalLayout_2_VM->addWidget(statusLabel_VM); - - horizontalSpacer_2_VM = new QSpacerItem(40, 48, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_2_VM->addItem(horizontalSpacer_2_VM); - - - verticalLayout_VM->addLayout(horizontalLayout_2_VM); - - tabWidget->addTab(tabVerifyMessage, QString()); - - verticalLayout->addWidget(tabWidget); - - - retranslateUi(SignVerifyMessageDialog); - - QMetaObject::connectSlotsByName(SignVerifyMessageDialog); - } // setupUi - - void retranslateUi(QDialog *SignVerifyMessageDialog) - { - SignVerifyMessageDialog->setWindowTitle(QApplication::translate("SignVerifyMessageDialog", "Signatures - Sign / Verify a Message", 0)); - infoLabel_SM->setText(QApplication::translate("SignVerifyMessageDialog", "You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.", 0)); -#ifndef QT_NO_TOOLTIP - addressIn_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "The address to sign the message with (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - addressBookButton_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Choose previously used address", 0)); -#endif // QT_NO_TOOLTIP - addressBookButton_SM->setText(QString()); - addressBookButton_SM->setShortcut(QApplication::translate("SignVerifyMessageDialog", "Alt+A", 0)); -#ifndef QT_NO_TOOLTIP - pasteButton_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Paste address from clipboard", 0)); -#endif // QT_NO_TOOLTIP - pasteButton_SM->setText(QString()); - pasteButton_SM->setShortcut(QApplication::translate("SignVerifyMessageDialog", "Alt+P", 0)); -#ifndef QT_NO_TOOLTIP - messageIn_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Enter the message you want to sign here", 0)); -#endif // QT_NO_TOOLTIP - signatureLabel_SM->setText(QApplication::translate("SignVerifyMessageDialog", "Signature", 0)); -#ifndef QT_NO_TOOLTIP - copySignatureButton_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Copy the current signature to the system clipboard", 0)); -#endif // QT_NO_TOOLTIP - copySignatureButton_SM->setText(QString()); -#ifndef QT_NO_TOOLTIP - signMessageButton_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Sign the message to prove you own this Interzone address", 0)); -#endif // QT_NO_TOOLTIP - signMessageButton_SM->setText(QApplication::translate("SignVerifyMessageDialog", "Sign &Message", 0)); -#ifndef QT_NO_TOOLTIP - clearButton_SM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Reset all sign message fields", 0)); -#endif // QT_NO_TOOLTIP - clearButton_SM->setText(QApplication::translate("SignVerifyMessageDialog", "Clear &All", 0)); - statusLabel_SM->setText(QString()); - tabWidget->setTabText(tabWidget->indexOf(tabSignMessage), QApplication::translate("SignVerifyMessageDialog", "&Sign Message", 0)); - infoLabel_VM->setText(QApplication::translate("SignVerifyMessageDialog", "Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.", 0)); -#ifndef QT_NO_TOOLTIP - addressIn_VM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "The address the message was signed with (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)", 0)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - addressBookButton_VM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Choose previously used address", 0)); -#endif // QT_NO_TOOLTIP - addressBookButton_VM->setText(QString()); - addressBookButton_VM->setShortcut(QApplication::translate("SignVerifyMessageDialog", "Alt+A", 0)); -#ifndef QT_NO_TOOLTIP - verifyMessageButton_VM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Verify the message to ensure it was signed with the specified Interzone address", 0)); -#endif // QT_NO_TOOLTIP - verifyMessageButton_VM->setText(QApplication::translate("SignVerifyMessageDialog", "Verify &Message", 0)); -#ifndef QT_NO_TOOLTIP - clearButton_VM->setToolTip(QApplication::translate("SignVerifyMessageDialog", "Reset all verify message fields", 0)); -#endif // QT_NO_TOOLTIP - clearButton_VM->setText(QApplication::translate("SignVerifyMessageDialog", "Clear &All", 0)); - statusLabel_VM->setText(QString()); - tabWidget->setTabText(tabWidget->indexOf(tabVerifyMessage), QApplication::translate("SignVerifyMessageDialog", "&Verify Message", 0)); - } // retranslateUi - -}; - -namespace Ui { - class SignVerifyMessageDialog: public Ui_SignVerifyMessageDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_SIGNVERIFYMESSAGEDIALOG_H diff --git a/contrib/ui_transactiondescdialog.h b/contrib/ui_transactiondescdialog.h deleted file mode 100644 index 4adbcda39..000000000 --- a/contrib/ui_transactiondescdialog.h +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'transactiondescdialog.ui' -** -** Created by: Qt User Interface Compiler version 5.2.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_TRANSACTIONDESCDIALOG_H -#define UI_TRANSACTIONDESCDIALOG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_TransactionDescDialog -{ -public: - QVBoxLayout *verticalLayout; - QTextEdit *detailText; - QDialogButtonBox *buttonBox; - - void setupUi(QDialog *TransactionDescDialog) - { - if (TransactionDescDialog->objectName().isEmpty()) - TransactionDescDialog->setObjectName(QStringLiteral("TransactionDescDialog")); - TransactionDescDialog->resize(620, 250); - verticalLayout = new QVBoxLayout(TransactionDescDialog); - verticalLayout->setObjectName(QStringLiteral("verticalLayout")); - detailText = new QTextEdit(TransactionDescDialog); - detailText->setObjectName(QStringLiteral("detailText")); - detailText->setReadOnly(true); - - verticalLayout->addWidget(detailText); - - buttonBox = new QDialogButtonBox(TransactionDescDialog); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Close); - - verticalLayout->addWidget(buttonBox); - - - retranslateUi(TransactionDescDialog); - QObject::connect(buttonBox, SIGNAL(accepted()), TransactionDescDialog, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), TransactionDescDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(TransactionDescDialog); - } // setupUi - - void retranslateUi(QDialog *TransactionDescDialog) - { - TransactionDescDialog->setWindowTitle(QApplication::translate("TransactionDescDialog", "Transaction details", 0)); -#ifndef QT_NO_TOOLTIP - detailText->setToolTip(QApplication::translate("TransactionDescDialog", "This pane shows a detailed description of the transaction", 0)); -#endif // QT_NO_TOOLTIP - } // retranslateUi - -}; - -namespace Ui { - class TransactionDescDialog: public Ui_TransactionDescDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_TRANSACTIONDESCDIALOG_H diff --git a/contrib/verifysfbinaries/README.md b/contrib/verifysfbinaries/README.md old mode 100644 new mode 100755 diff --git a/depends/.gitignore b/depends/.gitignore old mode 100644 new mode 100755 diff --git a/depends/README b/depends/README old mode 100644 new mode 100755 diff --git a/depends/README.packages b/depends/README.packages old mode 100644 new mode 100755 diff --git a/depends/README.usage b/depends/README.usage old mode 100644 new mode 100755 diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk old mode 100644 new mode 100755 diff --git a/depends/builders/default.mk b/depends/builders/default.mk old mode 100644 new mode 100755 diff --git a/depends/builders/linux.mk b/depends/builders/linux.mk old mode 100644 new mode 100755 diff --git a/depends/config.site.in b/depends/config.site.in old mode 100644 new mode 100755 diff --git a/depends/funcs.mk b/depends/funcs.mk old mode 100644 new mode 100755 diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk old mode 100644 new mode 100755 diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk old mode 100644 new mode 100755 diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk old mode 100644 new mode 100755 diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk old mode 100644 new mode 100755 diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk old mode 100644 new mode 100755 diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk old mode 100644 new mode 100755 diff --git a/depends/packages/dbus.mk b/depends/packages/dbus.mk old mode 100644 new mode 100755 diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk old mode 100644 new mode 100755 diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk old mode 100644 new mode 100755 diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk old mode 100644 new mode 100755 diff --git a/depends/packages/libICE.mk b/depends/packages/libICE.mk old mode 100644 new mode 100755 diff --git a/depends/packages/libSM.mk b/depends/packages/libSM.mk old mode 100644 new mode 100755 diff --git a/depends/packages/libX11.mk b/depends/packages/libX11.mk old mode 100644 new mode 100755 diff --git a/depends/packages/libXau.mk b/depends/packages/libXau.mk old mode 100644 new mode 100755 diff --git a/depends/packages/libXext.mk b/depends/packages/libXext.mk old mode 100644 new mode 100755 diff --git a/depends/packages/libxcb.mk b/depends/packages/libxcb.mk old mode 100644 new mode 100755 diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_ccache.mk b/depends/packages/native_ccache.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_cdrkit.mk b/depends/packages/native_cdrkit.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_comparisontool.mk b/depends/packages/native_comparisontool.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_libdmg-hfsplus.mk b/depends/packages/native_libdmg-hfsplus.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_libuuid.mk b/depends/packages/native_libuuid.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_openssl.mk b/depends/packages/native_openssl.mk old mode 100644 new mode 100755 diff --git a/depends/packages/native_protobuf.mk b/depends/packages/native_protobuf.mk old mode 100644 new mode 100755 diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk old mode 100644 new mode 100755 diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk old mode 100644 new mode 100755 diff --git a/depends/packages/protobuf.mk b/depends/packages/protobuf.mk old mode 100644 new mode 100755 diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk old mode 100644 new mode 100755 diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk old mode 100644 new mode 100755 diff --git a/depends/packages/qt46.mk b/depends/packages/qt46.mk old mode 100644 new mode 100755 diff --git a/depends/packages/xcb_proto.mk b/depends/packages/xcb_proto.mk old mode 100644 new mode 100755 diff --git a/depends/packages/xextproto.mk b/depends/packages/xextproto.mk old mode 100644 new mode 100755 diff --git a/depends/packages/xproto.mk b/depends/packages/xproto.mk old mode 100644 new mode 100755 diff --git a/depends/packages/xtrans.mk b/depends/packages/xtrans.mk old mode 100644 new mode 100755 diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf old mode 100644 new mode 100755 diff --git a/pkg.m4 b/pkg.m4 old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/.gitignore b/qa/rpc-tests/.gitignore old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/README.md b/qa/rpc-tests/README.md old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore b/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py b/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py b/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/python-bitcoinrpc/setup.py b/qa/rpc-tests/python-bitcoinrpc/setup.py old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py old mode 100644 new mode 100755 diff --git a/qa/rpc-tests/util.sh b/qa/rpc-tests/util.sh old mode 100644 new mode 100755 diff --git a/share/certs/BitcoinFoundation_Apple_Cert.pem b/share/certs/BitcoinFoundation_Apple_Cert.pem old mode 100644 new mode 100755 diff --git a/share/certs/BitcoinFoundation_Comodo_Cert.pem b/share/certs/BitcoinFoundation_Comodo_Cert.pem old mode 100644 new mode 100755 diff --git a/share/certs/PrivateKeyNotes.md b/share/certs/PrivateKeyNotes.md old mode 100644 new mode 100755 diff --git a/share/pixmaps/addressbook16.bmp b/share/pixmaps/addressbook16.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/addressbook16mask.bmp b/share/pixmaps/addressbook16mask.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/addressbook20.bmp b/share/pixmaps/addressbook20.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/addressbook20mask.bmp b/share/pixmaps/addressbook20mask.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin-bc.ico b/share/pixmaps/bitcoin-bc.ico old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin.ico b/share/pixmaps/bitcoin.ico old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin128.png b/share/pixmaps/bitcoin128.png old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin16.png b/share/pixmaps/bitcoin16.png old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin256.png b/share/pixmaps/bitcoin256.png old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin32.png b/share/pixmaps/bitcoin32.png old mode 100644 new mode 100755 diff --git a/share/pixmaps/bitcoin64.png b/share/pixmaps/bitcoin64.png old mode 100644 new mode 100755 diff --git a/share/pixmaps/check.ico b/share/pixmaps/check.ico old mode 100644 new mode 100755 diff --git a/share/pixmaps/dash128.png b/share/pixmaps/dash128.png old mode 100644 new mode 100755 diff --git a/share/pixmaps/favicon.ico b/share/pixmaps/favicon.ico old mode 100644 new mode 100755 diff --git a/share/pixmaps/nsis-header.bmp b/share/pixmaps/nsis-header.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/nsis-wizard.bmp b/share/pixmaps/nsis-wizard.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/send16.bmp b/share/pixmaps/send16.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/send16mask.bmp b/share/pixmaps/send16mask.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/send16masknoshadow.bmp b/share/pixmaps/send16masknoshadow.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/send20.bmp b/share/pixmaps/send20.bmp old mode 100644 new mode 100755 diff --git a/share/pixmaps/send20mask.bmp b/share/pixmaps/send20mask.bmp old mode 100644 new mode 100755 diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in old mode 100644 new mode 100755 diff --git a/share/qt/img/reload.png b/share/qt/img/reload.png old mode 100644 new mode 100755 diff --git a/share/qt/img/reload.xcf b/share/qt/img/reload.xcf old mode 100644 new mode 100755 diff --git a/share/qt/protobuf.pri b/share/qt/protobuf.pri old mode 100644 new mode 100755 diff --git a/share/setup.nsi.in b/share/setup.nsi.in old mode 100644 new mode 100755 diff --git a/share/ui.rc b/share/ui.rc old mode 100644 new mode 100755 diff --git a/src/COPYING b/src/COPYING old mode 100644 new mode 100755 diff --git a/src/INSTALL b/src/INSTALL old mode 100644 new mode 100755 diff --git a/src/Makefile.am b/src/Makefile.am old mode 100644 new mode 100755 index a2c1eabd9..f88299c81 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -83,12 +83,6 @@ BITCOIN_CORE_H = \ sync.h \ threadsafety.h \ tinyformat.h \ - compat/byteswap.h \ - compat/endian.h \ - torcontrol.h \ - hmac_sha256.h \ - sha256.h \ - common.h \ txdb.h \ txmempool.h \ ui_interface.h \ @@ -164,9 +158,6 @@ libinterzone_common_a_SOURCES = \ masternode-pos.cpp \ masternodeman.cpp \ masternodeconfig.cpp \ - torcontrol.cpp \ - hmac_sha256.cpp \ - sha256.cpp \ instantx.cpp \ hash.cpp \ key.cpp \ @@ -176,7 +167,6 @@ libinterzone_common_a_SOURCES = \ script.cpp \ sync.cpp \ util.cpp \ - random.cpp \ version.cpp \ aes_helper.c \ luffa.c \ @@ -223,7 +213,7 @@ interzoned_SOURCES += interzoned-res.rc endif AM_CPPFLAGS += $(BDB_CPPFLAGS) -interzoned_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) +interzoned_LDADD += $(BOOST_LIBS) $(BDB_LIBS) # interzone-cli binary # interzone_cli_LDADD = \ diff --git a/src/Makefile.include b/src/Makefile.include old mode 100644 new mode 100755 diff --git a/src/README.md b/src/README.md old mode 100644 new mode 100755 index c2d6a25e1..8a563e601 --- a/src/README.md +++ b/src/README.md @@ -1,7 +1,7 @@ Interzone Core staging tree 0.9 =============================== -http://www.interzone.space +http://www.interzone.org Copyright (c) 2009-2015 Bitcoin Core Developers @@ -21,7 +21,7 @@ are carried out collectively by the network. Interzone Core is the name of open source software which enables the use of this currency. For more information, as well as an immediately useable, binary version of -the Interzone Core software, see http://www.interzone.space/ +the Interzone Core software, see http://www.interzone.org/ License diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp old mode 100644 new mode 100755 index d19bc7be5..b52b77e91 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -42,22 +42,21 @@ void CActiveMasternode::ManageStatus() LogPrintf("CActiveMasternode::ManageStatus() - Checking inbound connection to '%s'\n", service.ToString().c_str()); - /*if (chainActive.Height() >= Params().MasternodePortForkHeight()) - { - if(Params().NetworkID() == CChainParams::MAIN){ - if(service.GetPort() != 11994) { - notCapableReason = "Invalid port: " + boost::lexical_cast(service.GetPort()) + " - only 11994 is supported on mainnet."; - status = MASTERNODE_NOT_CAPABLE; - LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str()); - return; - } - } else if(service.GetPort() == 11994) { - notCapableReason = "Invalid port: " + boost::lexical_cast(service.GetPort()) + " - 11994 is only supported on mainnet."; + /* + if(Params().NetworkID() == CChainParams::MAIN){ + if(service.GetPort() != 9999) { + notCapableReason = "Invalid port: " + boost::lexical_cast(service.GetPort()) + " - only 9999 is supported on mainnet."; status = MASTERNODE_NOT_CAPABLE; LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str()); return; } - }*/ + } else if(service.GetPort() == 9999) { + notCapableReason = "Invalid port: " + boost::lexical_cast(service.GetPort()) + " - 9999 is only supported on mainnet."; + status = MASTERNODE_NOT_CAPABLE; + LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str()); + return; + } + */ if(!ConnectNode((CAddress)service, service.ToString().c_str())){ notCapableReason = "Could not connect to " + service.ToString(); diff --git a/src/activemasternode.h b/src/activemasternode.h old mode 100644 new mode 100755 diff --git a/src/addrman.cpp b/src/addrman.cpp old mode 100644 new mode 100755 diff --git a/src/addrman.h b/src/addrman.h old mode 100644 new mode 100755 diff --git a/src/aes_helper.c b/src/aes_helper.c old mode 100644 new mode 100755 diff --git a/src/alert.cpp b/src/alert.cpp old mode 100644 new mode 100755 diff --git a/src/alert.h b/src/alert.h old mode 100644 new mode 100755 diff --git a/src/allocators.cpp b/src/allocators.cpp old mode 100644 new mode 100755 diff --git a/src/allocators.h b/src/allocators.h old mode 100644 new mode 100755 diff --git a/src/base58.cpp b/src/base58.cpp old mode 100644 new mode 100755 index 544ccaa89..1bd64684e --- a/src/base58.cpp +++ b/src/base58.cpp @@ -24,14 +24,12 @@ bool DecodeBase58(const char *psz, std::vector& vch) { psz++; // Skip and count leading '1's. int zeroes = 0; - int length = 0; while (*psz == '1') { zeroes++; psz++; } // Allocate enough space in big-endian base256 representation. - int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up. - std::vector b256(size); + std::vector b256(strlen(psz) * 733 / 1000 + 1); // log(58) / log(256), rounded up. // Process the characters. while (*psz && !isspace(*psz)) { // Decode base58 character @@ -40,14 +38,12 @@ bool DecodeBase58(const char *psz, std::vector& vch) { return false; // Apply "b256 = b256 * 58 + ch". int carry = ch - pszBase58; - int i = 0; - for (std::vector::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) { + for (std::vector::reverse_iterator it = b256.rbegin(); it != b256.rend(); it++) { carry += 58 * (*it); *it = carry % 256; carry /= 256; } assert(carry == 0); - length = i; psz++; } // Skip trailing spaces. @@ -56,7 +52,7 @@ bool DecodeBase58(const char *psz, std::vector& vch) { if (*psz != 0) return false; // Skip leading zeroes in b256. - std::vector::iterator it = b256.begin() + (size - length); + std::vector::iterator it = b256.begin(); while (it != b256.end() && *it == 0) it++; // Copy result into output vector. diff --git a/src/base58.h b/src/base58.h old mode 100644 new mode 100755 diff --git a/src/bignum.h b/src/bignum.h old mode 100644 new mode 100755 diff --git a/src/blake.c b/src/blake.c old mode 100644 new mode 100755 diff --git a/src/bloom.cpp b/src/bloom.cpp old mode 100644 new mode 100755 diff --git a/src/bloom.h b/src/bloom.h old mode 100644 new mode 100755 diff --git a/src/bmw.c b/src/bmw.c old mode 100644 new mode 100755 diff --git a/src/build-aux/compile b/src/build-aux/compile deleted file mode 100755 index a85b723c7..000000000 --- a/src/build-aux/compile +++ /dev/null @@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/build-aux/config.guess b/src/build-aux/config.guess deleted file mode 100755 index 6c32c8645..000000000 --- a/src/build-aux/config.guess +++ /dev/null @@ -1,1421 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. - -timestamp='2014-11-04' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/src/build-aux/config.sub b/src/build-aux/config.sub deleted file mode 100755 index 7ffe37378..000000000 --- a/src/build-aux/config.sub +++ /dev/null @@ -1,1807 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. - -timestamp='2014-12-03' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2014 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/src/build-aux/depcomp b/src/build-aux/depcomp deleted file mode 100755 index fc98710e2..000000000 --- a/src/build-aux/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/build-aux/install-sh b/src/build-aux/install-sh deleted file mode 100755 index 0b0fdcbba..000000000 --- a/src/build-aux/install-sh +++ /dev/null @@ -1,501 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2013-12-25.23; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/build-aux/missing b/src/build-aux/missing deleted file mode 100755 index f62bbae30..000000000 --- a/src/build-aux/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/build-aux/test-driver b/src/build-aux/test-driver deleted file mode 100755 index 8e575b017..000000000 --- a/src/build-aux/test-driver +++ /dev/null @@ -1,148 +0,0 @@ -#! /bin/sh -# test-driver - basic testsuite driver script. - -scriptversion=2013-07-13.22; # UTC - -# Copyright (C) 2011-2014 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -# Make unconditional expansion of undefined variables an error. This -# helps a lot in preventing typo-related bugs. -set -u - -usage_error () -{ - echo "$0: $*" >&2 - print_usage >&2 - exit 2 -} - -print_usage () -{ - cat <$log_file 2>&1 -estatus=$? - -if test $enable_hard_errors = no && test $estatus -eq 99; then - tweaked_estatus=1 -else - tweaked_estatus=$estatus -fi - -case $tweaked_estatus:$expect_failure in - 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; - 0:*) col=$grn res=PASS recheck=no gcopy=no;; - 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; - 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; - *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; - *:*) col=$red res=FAIL recheck=yes gcopy=yes;; -esac - -# Report the test outcome and exit status in the logs, so that one can -# know whether the test passed or failed simply by looking at the '.log' -# file, without the need of also peaking into the corresponding '.trs' -# file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file - -# Report outcome to console. -echo "${col}${res}${std}: $test_name" - -# Register the test result, and other relevant metadata. -echo ":test-result: $res" > $trs_file -echo ":global-test-result: $res" >> $trs_file -echo ":recheck: $recheck" >> $trs_file -echo ":copy-in-global-log: $gcopy" >> $trs_file - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/chainparams.cpp b/src/chainparams.cpp old mode 100644 new mode 100755 index 9393fdf75..6ee8212b3 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -34,14 +34,12 @@ class CMainParams : public CChainParams { pchMessageStart[1] = 0x02; pchMessageStart[2] = 0x01; pchMessageStart[3] = 0x17; - vAlertPubKey = ParseHex(""); + vAlertPubKey = ParseHex("04c5788ca1e268a7474763fa965210b6fa6b04a45f52d21056c62fb19a2de991aa15aa1d1c516f34d2a0016f51a87959c89f51a148db30c839f71bc525dde8c480"); nDefaultPort = 55675; nRPCPort = 55680; bnProofOfWorkLimit = CBigNum(~uint256(0) >> 20); - nSubsidyHalvingInterval = 500000; - nMasternodePortForkHeight = 100; - nRewardForkHeight1 = 10000; - nRewardForkHeight2 = 250000; + nSubsidyHalvingInterval = 500000; + nSubsidyHalvingInterval = 700800; // 2 years // Genesis block const char* pszTimestamp = "The rulers of this most insecure of all worlds are rulers by accident."; @@ -72,9 +70,10 @@ class CMainParams : public CChainParams { base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,0); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,5); - base58Prefixes[SECRET_KEY] = std::vector(1,28 + 128); - base58Prefixes[EXT_PUBLIC_KEY] = {0x02, 0xFE, 0x52, 0xF8}; - base58Prefixes[EXT_SECRET_KEY] = {0x02, 0xFE, 0x52, 0xCC}; + base58Prefixes[SECRET_KEY] = std::vector(1,28 + 128); // Interzone private keys start with '7' or 'X' + base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x02)(0xFE)(0x52)(0xF8); // Interzone BIP32 pubkeys start with 'drkv' + base58Prefixes[EXT_SECRET_KEY] = list_of(0x02)(0xFE)(0x52)(0xCC); // Interzone BIP32 prvkeys start with 'drkp' + base58Prefixes[EXT_COIN_TYPE] = list_of(0x80000005); // Interzone BIP44 coin type is '5' // Convert the pnSeeds array into usable address objects. for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++) @@ -123,11 +122,7 @@ class CTestNetParams : public CMainParams { nDefaultPort = 21817; nRPCPort = 21818; - strDataDir = "secretnetwork"; - - nMasternodePortForkHeight = 100; - nRewardForkHeight1 = 250; - nRewardForkHeight2 =500; + strDataDir = "testnet"; // Modify the testnet genesis block so the timestamp is valid for a later start. genesis.nTime = 1503324223; @@ -144,8 +139,7 @@ class CTestNetParams : public CMainParams { base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,102); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,44); base58Prefixes[SECRET_KEY] = std::vector(1,88 + 128); - base58Prefixes[EXT_PUBLIC_KEY] = {0x3a, 0x80, 0x61, 0xa0}; - base58Prefixes[EXT_SECRET_KEY] = {0x3a, 0x80, 0x58, 0x37}; + } virtual Network NetworkID() const { return CChainParams::TESTNET; } }; @@ -163,27 +157,15 @@ class CRegTestParams : public CTestNetParams { pchMessageStart[2] = 0xc3; pchMessageStart[3] = 0x56; nSubsidyHalvingInterval = 150; - bnProofOfWorkLimit = CBigNum(~uint256(0) >> 1); - genesis.nTime = 1503324223; + bnProofOfWorkLimit = CBigNum(~uint256(0) >> 20); + genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; - genesis.nNonce = 1; - nDefaultPort = 21819; - strDataDir = "regression"; + genesis.nNonce = 3; + nDefaultPort = 18444; + strDataDir = "regtest"; hashGenesisBlock = genesis.GetHash(); - - /*while (hashGenesisBlock > bnProofOfWorkLimit.getuint256()){ - if (++genesis.nNonce==0) break; - hashGenesisBlock = genesis.GetHash(); - } - - printf("%s\n", hashGenesisBlock.ToString().c_str()); - printf("%s\n", genesis.hashMerkleRoot.ToString().c_str()); - printf("genesis.nNonce = %u \n", genesis.nNonce); - printf("%x\n", bnProofOfWorkLimit.GetCompact()); - genesis.print();*/ - - assert(hashGenesisBlock == uint256("0x52feedd3478a1a013a565d1598798343c97431da5df9f95cf4b67d9a9779aba0")); + // assert(hashGenesisBlock == uint256("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e")); vSeeds.clear(); // Regtest mode doesn't have any DNS seeds. } diff --git a/src/chainparams.h b/src/chainparams.h old mode 100644 new mode 100755 index b3e462e52..04a473ea6 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -48,7 +48,7 @@ class CChainParams SECRET_KEY, // BIP16 EXT_PUBLIC_KEY, // BIP32 EXT_SECRET_KEY, // BIP32 - // EXT_COIN_TYPE, // BIP44 + EXT_COIN_TYPE, // BIP44 MAX_BASE58_TYPES }; @@ -67,9 +67,6 @@ class CChainParams const std::vector &Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } virtual const vector& FixedSeeds() const = 0; int RPCPort() const { return nRPCPort; } - int MasternodePortForkHeight() const { return nMasternodePortForkHeight; } - int RewardForkHeight1() const { return nRewardForkHeight1; } - int RewardForkHeight2() const { return nRewardForkHeight2; } protected: CChainParams() {} @@ -84,9 +81,6 @@ class CChainParams string strDataDir; vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; - int nMasternodePortForkHeight; - int nRewardForkHeight1; - int nRewardForkHeight2; }; /** diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp old mode 100644 new mode 100755 index a784b3378..2d8dbb20f --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -42,7 +42,6 @@ namespace Checkpoints boost::assign::map_list_of ( 1, uint256("0x00000b7ff05d5ef83c0b524732ab2c01b0505d3381d7505169d90f061fd47866")) ( 3, uint256("0x000000c5823bdc4409c6882b39a8be7c113af492fb297818d37ddcf2d4d1e0c8")) - ; static const CCheckpointData data = { &mapCheckpoints, @@ -54,24 +53,24 @@ namespace Checkpoints static MapCheckpoints mapCheckpointsTestnet = boost::assign::map_list_of - ( 1, uint256("0x00000c8b09569f01c13c877bf349617f0b49ac5a9af53a2dbe7b1a899f457d47")) + ( 0, uint256("0x0000082f5939c2154dbcba35f784530d12e9d72472fcfaf29674ea312cdf4c83")) ; static const CCheckpointData dataTestnet = { &mapCheckpointsTestnet, - 1504585337, + 1388868139, 0, 960 }; static MapCheckpoints mapCheckpointsRegtest = boost::assign::map_list_of - ( 0, uint256("0x66e44fbe79e0cf2889b86fb7a24f6774349b6e808311ad54bca4d073a6319c6e")) + ( 0, uint256("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e")) ; static const CCheckpointData dataRegtest = { &mapCheckpointsRegtest, - 1503324223, 0, - 480 + 0, + 0 }; const CCheckpointData &Checkpoints() { diff --git a/src/checkpoints.h b/src/checkpoints.h old mode 100644 new mode 100755 diff --git a/src/checkqueue.h b/src/checkqueue.h old mode 100644 new mode 100755 diff --git a/src/clientversion.h b/src/clientversion.h old mode 100644 new mode 100755 index f97da237b..040a28f9a --- a/src/clientversion.h +++ b/src/clientversion.h @@ -10,9 +10,9 @@ // These need to be macros, as version.cpp's and interzone-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 -#define CLIENT_VERSION_MINOR 13 -#define CLIENT_VERSION_REVISION 0 -#define CLIENT_VERSION_BUILD 0 +#define CLIENT_VERSION_MINOR 9 +#define CLIENT_VERSION_REVISION 2 +#define CLIENT_VERSION_BUILD 5 @@ -21,7 +21,7 @@ // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source -#define COPYRIGHT_YEAR 2018 +#define COPYRIGHT_YEAR 2017 #endif //HAVE_CONFIG_H diff --git a/src/coincontrol.h b/src/coincontrol.h old mode 100644 new mode 100755 diff --git a/src/coins.cpp b/src/coins.cpp old mode 100644 new mode 100755 diff --git a/src/coins.h b/src/coins.h old mode 100644 new mode 100755 diff --git a/src/common.h b/src/common.h deleted file mode 100644 index 9dca82de7..000000000 --- a/src/common.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_COMMON_H -#define BITCOIN_CRYPTO_COMMON_H - -#if defined(HAVE_CONFIG_H) -#include "interzone-config.h" -#endif - -#include -#include - -#include "compat/endian.h" - -uint16_t static inline ReadLE16(const unsigned char* ptr) -{ - uint16_t x; - memcpy((char*)&x, ptr, 2); - return le16toh(x); -} - -uint32_t static inline ReadLE32(const unsigned char* ptr) -{ - uint32_t x; - memcpy((char*)&x, ptr, 4); - return le32toh(x); -} - -uint64_t static inline ReadLE64(const unsigned char* ptr) -{ - uint64_t x; - memcpy((char*)&x, ptr, 8); - return le64toh(x); -} - -void static inline WriteLE16(unsigned char* ptr, uint16_t x) -{ - uint16_t v = htole16(x); - memcpy(ptr, (char*)&v, 2); -} - -void static inline WriteLE32(unsigned char* ptr, uint32_t x) -{ - uint32_t v = htole32(x); - memcpy(ptr, (char*)&v, 4); -} - -void static inline WriteLE64(unsigned char* ptr, uint64_t x) -{ - uint64_t v = htole64(x); - memcpy(ptr, (char*)&v, 8); -} - -uint32_t static inline ReadBE32(const unsigned char* ptr) -{ - uint32_t x; - memcpy((char*)&x, ptr, 4); - return be32toh(x); -} - -uint64_t static inline ReadBE64(const unsigned char* ptr) -{ - uint64_t x; - memcpy((char*)&x, ptr, 8); - return be64toh(x); -} - -void static inline WriteBE32(unsigned char* ptr, uint32_t x) -{ - uint32_t v = htobe32(x); - memcpy(ptr, (char*)&v, 4); -} - -void static inline WriteBE64(unsigned char* ptr, uint64_t x) -{ - uint64_t v = htobe64(x); - memcpy(ptr, (char*)&v, 8); -} - -/** Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. */ -uint64_t static inline CountBits(uint64_t x) -{ -#ifdef HAVE_DECL___BUILTIN_CLZL - if (sizeof(unsigned long) >= sizeof(uint64_t)) { - return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0; - } -#endif -#ifdef HAVE_DECL___BUILTIN_CLZLL - if (sizeof(unsigned long long) >= sizeof(uint64_t)) { - return x ? 8 * sizeof(unsigned long long) - __builtin_clzll(x) : 0; - } -#endif - int ret = 0; - while (x) { - x >>= 1; - ++ret; - } - return ret; -} - -#endif // BITCOIN_CRYPTO_COMMON_H diff --git a/src/compat.h b/src/compat.h old mode 100644 new mode 100755 diff --git a/src/compat/byteswap.h b/src/compat/byteswap.h deleted file mode 100644 index 80f8b0361..000000000 --- a/src/compat/byteswap.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2014-2016 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_COMPAT_BYTESWAP_H -#define BITCOIN_COMPAT_BYTESWAP_H - -#if defined(HAVE_CONFIG_H) -#include "interzone-config.h" -#endif - -#include - -#if defined(HAVE_BYTESWAP_H) -#include -#endif - -#if defined(__APPLE__) - -#if !defined(bswap_16) - -// Mac OS X / Darwin features; we include a check for bswap_16 because if it is already defined, protobuf has -// defined these macros for us already; if it isn't, we do it ourselves. In either case, we get the exact same -// result regardless which path was taken -#include -#define bswap_16(x) OSSwapInt16(x) -#define bswap_32(x) OSSwapInt32(x) -#define bswap_64(x) OSSwapInt64(x) - -#endif // !defined(bswap_16) - -#else -// Non-Mac OS X / non-Darwin - -#if HAVE_DECL_BSWAP_16 == 0 -inline uint16_t bswap_16(uint16_t x) -{ - return (x >> 8) | ((x & 0x00ff) << 8); -} -#endif // HAVE_DECL_BSWAP16 - -#if HAVE_DECL_BSWAP_32 == 0 -inline uint32_t bswap_32(uint32_t x) -{ - return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >> 8) | - ((x & 0x0000ff00U) << 8) | ((x & 0x000000ffU) << 24)); -} -#endif // HAVE_DECL_BSWAP32 - -#if HAVE_DECL_BSWAP_64 == 0 -inline uint64_t bswap_64(uint64_t x) -{ - return (((x & 0xff00000000000000ull) >> 56) - | ((x & 0x00ff000000000000ull) >> 40) - | ((x & 0x0000ff0000000000ull) >> 24) - | ((x & 0x000000ff00000000ull) >> 8) - | ((x & 0x00000000ff000000ull) << 8) - | ((x & 0x0000000000ff0000ull) << 24) - | ((x & 0x000000000000ff00ull) << 40) - | ((x & 0x00000000000000ffull) << 56)); -} -#endif // HAVE_DECL_BSWAP64 - -#endif // defined(__APPLE__) - -#endif // BITCOIN_COMPAT_BYTESWAP_H diff --git a/src/compat/endian.h b/src/compat/endian.h deleted file mode 100644 index 3c8fce82e..000000000 --- a/src/compat/endian.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) 2014-2016 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_COMPAT_ENDIAN_H -#define BITCOIN_COMPAT_ENDIAN_H - -#if defined(HAVE_CONFIG_H) -#include "interzone-config.h" -#endif - -#include - -#include "compat/byteswap.h" - -#if defined(HAVE_ENDIAN_H) -#include -#elif defined(HAVE_SYS_ENDIAN_H) -#include -#endif - -#if defined(WORDS_BIGENDIAN) - -#if HAVE_DECL_HTOBE16 == 0 -inline uint16_t htobe16(uint16_t host_16bits) -{ - return host_16bits; -} -#endif // HAVE_DECL_HTOBE16 - -#if HAVE_DECL_HTOLE16 == 0 -inline uint16_t htole16(uint16_t host_16bits) -{ - return bswap_16(host_16bits); -} -#endif // HAVE_DECL_HTOLE16 - -#if HAVE_DECL_BE16TOH == 0 -inline uint16_t be16toh(uint16_t big_endian_16bits) -{ - return big_endian_16bits; -} -#endif // HAVE_DECL_BE16TOH - -#if HAVE_DECL_LE16TOH == 0 -inline uint16_t le16toh(uint16_t little_endian_16bits) -{ - return bswap_16(little_endian_16bits); -} -#endif // HAVE_DECL_LE16TOH - -#if HAVE_DECL_HTOBE32 == 0 -inline uint32_t htobe32(uint32_t host_32bits) -{ - return host_32bits; -} -#endif // HAVE_DECL_HTOBE32 - -#if HAVE_DECL_HTOLE32 == 0 -inline uint32_t htole32(uint32_t host_32bits) -{ - return bswap_32(host_32bits); -} -#endif // HAVE_DECL_HTOLE32 - -#if HAVE_DECL_BE32TOH == 0 -inline uint32_t be32toh(uint32_t big_endian_32bits) -{ - return big_endian_32bits; -} -#endif // HAVE_DECL_BE32TOH - -#if HAVE_DECL_LE32TOH == 0 -inline uint32_t le32toh(uint32_t little_endian_32bits) -{ - return bswap_32(little_endian_32bits); -} -#endif // HAVE_DECL_LE32TOH - -#if HAVE_DECL_HTOBE64 == 0 -inline uint64_t htobe64(uint64_t host_64bits) -{ - return host_64bits; -} -#endif // HAVE_DECL_HTOBE64 - -#if HAVE_DECL_HTOLE64 == 0 -inline uint64_t htole64(uint64_t host_64bits) -{ - return bswap_64(host_64bits); -} -#endif // HAVE_DECL_HTOLE64 - -#if HAVE_DECL_BE64TOH == 0 -inline uint64_t be64toh(uint64_t big_endian_64bits) -{ - return big_endian_64bits; -} -#endif // HAVE_DECL_BE64TOH - -#if HAVE_DECL_LE64TOH == 0 -inline uint64_t le64toh(uint64_t little_endian_64bits) -{ - return bswap_64(little_endian_64bits); -} -#endif // HAVE_DECL_LE64TOH - -#else // WORDS_BIGENDIAN - -#if HAVE_DECL_HTOBE16 == 0 -inline uint16_t htobe16(uint16_t host_16bits) -{ - return bswap_16(host_16bits); -} -#endif // HAVE_DECL_HTOBE16 - -#if HAVE_DECL_HTOLE16 == 0 -inline uint16_t htole16(uint16_t host_16bits) -{ - return host_16bits; -} -#endif // HAVE_DECL_HTOLE16 - -#if HAVE_DECL_BE16TOH == 0 -inline uint16_t be16toh(uint16_t big_endian_16bits) -{ - return bswap_16(big_endian_16bits); -} -#endif // HAVE_DECL_BE16TOH - -#if HAVE_DECL_LE16TOH == 0 -inline uint16_t le16toh(uint16_t little_endian_16bits) -{ - return little_endian_16bits; -} -#endif // HAVE_DECL_LE16TOH - -#if HAVE_DECL_HTOBE32 == 0 -inline uint32_t htobe32(uint32_t host_32bits) -{ - return bswap_32(host_32bits); -} -#endif // HAVE_DECL_HTOBE32 - -#if HAVE_DECL_HTOLE32 == 0 -inline uint32_t htole32(uint32_t host_32bits) -{ - return host_32bits; -} -#endif // HAVE_DECL_HTOLE32 - -#if HAVE_DECL_BE32TOH == 0 -inline uint32_t be32toh(uint32_t big_endian_32bits) -{ - return bswap_32(big_endian_32bits); -} -#endif // HAVE_DECL_BE32TOH - -#if HAVE_DECL_LE32TOH == 0 -inline uint32_t le32toh(uint32_t little_endian_32bits) -{ - return little_endian_32bits; -} -#endif // HAVE_DECL_LE32TOH - -#if HAVE_DECL_HTOBE64 == 0 -inline uint64_t htobe64(uint64_t host_64bits) -{ - return bswap_64(host_64bits); -} -#endif // HAVE_DECL_HTOBE64 - -#if HAVE_DECL_HTOLE64 == 0 -inline uint64_t htole64(uint64_t host_64bits) -{ - return host_64bits; -} -#endif // HAVE_DECL_HTOLE64 - -#if HAVE_DECL_BE64TOH == 0 -inline uint64_t be64toh(uint64_t big_endian_64bits) -{ - return bswap_64(big_endian_64bits); -} -#endif // HAVE_DECL_BE64TOH - -#if HAVE_DECL_LE64TOH == 0 -inline uint64_t le64toh(uint64_t little_endian_64bits) -{ - return little_endian_64bits; -} -#endif // HAVE_DECL_LE64TOH - -#endif // WORDS_BIGENDIAN - -#endif // BITCOIN_COMPAT_ENDIAN_H diff --git a/src/compat/glibc_compat.cpp b/src/compat/glibc_compat.cpp old mode 100644 new mode 100755 diff --git a/src/compat/glibcxx_compat.cpp b/src/compat/glibcxx_compat.cpp old mode 100644 new mode 100755 diff --git a/src/configure.ac b/src/configure.ac old mode 100644 new mode 100755 index ae33a195c..a76670403 --- a/src/configure.ac +++ b/src/configure.ac @@ -6,13 +6,13 @@ define(_CLIENT_VERSION_REVISION, 1) define(_CLIENT_VERSION_BUILD, 1) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) -AC_INIT([Interzone Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@interzone.space],[interzone]) +AC_INIT([Interzone Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@interzone.org],[interzone]) AC_CONFIG_AUX_DIR([src/build-aux]) AC_CONFIG_MACRO_DIR([src/m4]) AC_CANONICAL_HOST -AH_TOP([#ifndef CHAINCOIN_CONFIG_H]) -AH_TOP([#define CHAINCOIN_CONFIG_H]) -AH_BOTTOM([#endif //CHAINCOIN_CONFIG_H]) +AH_TOP([#ifndef INTERZONE_CONFIG_H]) +AH_TOP([#define INTERZONE_CONFIG_H]) +AH_BOTTOM([#endif //INTERZONE_CONFIG_H]) # This m4 will only be used if a system copy cannot be found. This is helpful # on systems where autotools are installed but the pkg-config macros are not in diff --git a/src/contrib/README.md b/src/contrib/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/bitcoind.bash-completion b/src/contrib/bitcoind.bash-completion old mode 100644 new mode 100755 diff --git a/src/contrib/bitrpc/README.md b/src/contrib/bitrpc/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/bitrpc/bitrpc.py b/src/contrib/bitrpc/bitrpc.py old mode 100644 new mode 100755 diff --git a/src/contrib/dash-qt.pro b/src/contrib/dash-qt.pro old mode 100644 new mode 100755 diff --git a/src/contrib/debian/README.md b/src/contrib/debian/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/debian/changelog b/src/contrib/debian/changelog old mode 100644 new mode 100755 diff --git a/src/contrib/debian/compat b/src/contrib/debian/compat old mode 100644 new mode 100755 diff --git a/src/contrib/debian/control b/src/contrib/debian/control old mode 100644 new mode 100755 diff --git a/src/contrib/debian/copyright b/src/contrib/debian/copyright old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dash-qt.desktop b/src/contrib/debian/dash-qt.desktop old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dash-qt.install b/src/contrib/debian/dash-qt.install old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dash-qt.lintian-overrides b/src/contrib/debian/dash-qt.lintian-overrides old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dash-qt.protocol b/src/contrib/debian/dash-qt.protocol old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dashd.bash-completion b/src/contrib/debian/dashd.bash-completion old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dashd.examples b/src/contrib/debian/dashd.examples old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dashd.install b/src/contrib/debian/dashd.install old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dashd.lintian-overrides b/src/contrib/debian/dashd.lintian-overrides old mode 100644 new mode 100755 diff --git a/src/contrib/debian/dashd.manpages b/src/contrib/debian/dashd.manpages old mode 100644 new mode 100755 diff --git a/src/contrib/debian/examples/dash.conf b/src/contrib/debian/examples/dash.conf old mode 100644 new mode 100755 diff --git a/src/contrib/debian/gbp.conf b/src/contrib/debian/gbp.conf old mode 100644 new mode 100755 diff --git a/src/contrib/debian/manpages/dash-qt.1 b/src/contrib/debian/manpages/dash-qt.1 old mode 100644 new mode 100755 diff --git a/src/contrib/debian/manpages/dash.conf.5 b/src/contrib/debian/manpages/dash.conf.5 old mode 100644 new mode 100755 diff --git a/src/contrib/debian/manpages/dashd.1 b/src/contrib/debian/manpages/dashd.1 old mode 100644 new mode 100755 diff --git a/src/contrib/debian/patches/README b/src/contrib/debian/patches/README old mode 100644 new mode 100755 diff --git a/src/contrib/debian/patches/series b/src/contrib/debian/patches/series old mode 100644 new mode 100755 diff --git a/src/contrib/debian/source/format b/src/contrib/debian/source/format old mode 100644 new mode 100755 diff --git a/src/contrib/debian/watch b/src/contrib/debian/watch old mode 100644 new mode 100755 diff --git a/src/contrib/devtools/README.md b/src/contrib/devtools/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/README.md b/src/contrib/gitian-descriptors/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/boost-linux.yml b/src/contrib/gitian-descriptors/boost-linux.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/boost-win.yml b/src/contrib/gitian-descriptors/boost-win.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/deps-linux.yml b/src/contrib/gitian-descriptors/deps-linux.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/deps-win.yml b/src/contrib/gitian-descriptors/deps-win.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/gitian-osx-depends.yml b/src/contrib/gitian-descriptors/gitian-osx-depends.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/gitian-osx-native.yml b/src/contrib/gitian-descriptors/gitian-osx-native.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/gitian-osx-qt.yml b/src/contrib/gitian-descriptors/gitian-osx-qt.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/protobuf-win.yml b/src/contrib/gitian-descriptors/protobuf-win.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/qt-linux.yml b/src/contrib/gitian-descriptors/qt-linux.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-descriptors/qt-win.yml b/src/contrib/gitian-descriptors/qt-win.yml old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/aschildbach-key.pgp b/src/contrib/gitian-downloader/aschildbach-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/bluematt-key.pgp b/src/contrib/gitian-downloader/bluematt-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/devrandom-key.pgp b/src/contrib/gitian-downloader/devrandom-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/gavinandresen-key.pgp b/src/contrib/gitian-downloader/gavinandresen-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/laanwj-key.pgp b/src/contrib/gitian-downloader/laanwj-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/linux-download-config b/src/contrib/gitian-downloader/linux-download-config old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/luke-jr-key.pgp b/src/contrib/gitian-downloader/luke-jr-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/michagogo-key.pgp b/src/contrib/gitian-downloader/michagogo-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/sipa-key.pgp b/src/contrib/gitian-downloader/sipa-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/tcatm-key.pgp b/src/contrib/gitian-downloader/tcatm-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/win32-download-config b/src/contrib/gitian-downloader/win32-download-config old mode 100644 new mode 100755 diff --git a/src/contrib/gitian-downloader/wtogami-key.pgp b/src/contrib/gitian-downloader/wtogami-key.pgp old mode 100644 new mode 100755 diff --git a/src/contrib/linearize/README.md b/src/contrib/linearize/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/linearize/example-linearize.cfg b/src/contrib/linearize/example-linearize.cfg old mode 100644 new mode 100755 diff --git a/src/contrib/linearize/linearize.py b/src/contrib/linearize/linearize.py old mode 100644 new mode 100755 diff --git a/src/contrib/macdeploy/DS_Store b/src/contrib/macdeploy/DS_Store old mode 100644 new mode 100755 diff --git a/src/contrib/macdeploy/LICENSE b/src/contrib/macdeploy/LICENSE old mode 100644 new mode 100755 diff --git a/src/contrib/macdeploy/README.md b/src/contrib/macdeploy/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/macdeploy/background.png b/src/contrib/macdeploy/background.png old mode 100644 new mode 100755 diff --git a/src/contrib/macdeploy/background.psd b/src/contrib/macdeploy/background.psd old mode 100644 new mode 100755 diff --git a/src/contrib/macdeploy/fancy.plist b/src/contrib/macdeploy/fancy.plist old mode 100644 new mode 100755 diff --git a/src/contrib/pyminer/README.md b/src/contrib/pyminer/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/pyminer/example-config.cfg b/src/contrib/pyminer/example-config.cfg old mode 100644 new mode 100755 diff --git a/src/contrib/qos/README.md b/src/contrib/qos/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/qos/tc.sh b/src/contrib/qos/tc.sh old mode 100644 new mode 100755 diff --git a/src/contrib/seeds/README.md b/src/contrib/seeds/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/spendfrom/README.md b/src/contrib/spendfrom/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/spendfrom/setup.py b/src/contrib/spendfrom/setup.py old mode 100644 new mode 100755 diff --git a/src/contrib/test-patches/README.md b/src/contrib/test-patches/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/testgen/README.md b/src/contrib/testgen/README.md old mode 100644 new mode 100755 diff --git a/src/contrib/testgen/base58.py b/src/contrib/testgen/base58.py old mode 100644 new mode 100755 diff --git a/src/contrib/verifysfbinaries/README.md b/src/contrib/verifysfbinaries/README.md old mode 100644 new mode 100755 diff --git a/src/core.cpp b/src/core.cpp old mode 100644 new mode 100755 diff --git a/src/core.h b/src/core.h old mode 100644 new mode 100755 index 8c3695c1d..ab04bfd11 --- a/src/core.h +++ b/src/core.h @@ -50,7 +50,7 @@ static const int MIN_POOL_PEER_PROTO_VERSION = 70002; // minimum peer version ac class CTransaction; /** No amount larger than this (in satoshi) is valid */ -static const int64_t MAX_MONEY = 23000000 * COIN; +static const int64_t MAX_MONEY = 30000000 * COIN; inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } /** An outpoint - a combination of a transaction hash and an index n into its vout */ diff --git a/src/crypter.cpp b/src/crypter.cpp old mode 100644 new mode 100755 diff --git a/src/crypter.h b/src/crypter.h old mode 100644 new mode 100755 diff --git a/src/crypto/aes_helper.c b/src/crypto/aes_helper.c deleted file mode 100644 index 75b7cc69d..000000000 --- a/src/crypto/aes_helper.c +++ /dev/null @@ -1,392 +0,0 @@ -/* $Id: aes_helper.c 220 2010-06-09 09:21:50Z tp $ */ -/* - * AES tables. This file is not meant to be compiled by itself; it - * is included by some hash function implementations. It contains - * the precomputed tables and helper macros for evaluating an AES - * round, optionally with a final XOR with a subkey. - * - * By default, this file defines the tables and macros for little-endian - * processing (i.e. it is assumed that the input bytes have been read - * from memory and assembled with the little-endian convention). If - * the 'AES_BIG_ENDIAN' macro is defined (to a non-zero integer value) - * when this file is included, then the tables and macros for big-endian - * processing are defined instead. The big-endian tables and macros have - * names distinct from the little-endian tables and macros, hence it is - * possible to have both simultaneously, by including this file twice - * (with and without the AES_BIG_ENDIAN macro). - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include "sph_types.h" -#ifdef __cplusplus -extern "C"{ -#endif -#if AES_BIG_ENDIAN - -#define AESx(x) ( ((SPH_C32(x) >> 24) & SPH_C32(0x000000FF)) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) - -#define AES0 AES0_BE -#define AES1 AES1_BE -#define AES2 AES2_BE -#define AES3 AES3_BE - -#define AES_ROUND_BE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3) do { \ - (Y0) = AES0[((X0) >> 24) & 0xFF] \ - ^ AES1[((X1) >> 16) & 0xFF] \ - ^ AES2[((X2) >> 8) & 0xFF] \ - ^ AES3[(X3) & 0xFF] ^ (K0); \ - (Y1) = AES0[((X1) >> 24) & 0xFF] \ - ^ AES1[((X2) >> 16) & 0xFF] \ - ^ AES2[((X3) >> 8) & 0xFF] \ - ^ AES3[(X0) & 0xFF] ^ (K1); \ - (Y2) = AES0[((X2) >> 24) & 0xFF] \ - ^ AES1[((X3) >> 16) & 0xFF] \ - ^ AES2[((X0) >> 8) & 0xFF] \ - ^ AES3[(X1) & 0xFF] ^ (K2); \ - (Y3) = AES0[((X3) >> 24) & 0xFF] \ - ^ AES1[((X0) >> 16) & 0xFF] \ - ^ AES2[((X1) >> 8) & 0xFF] \ - ^ AES3[(X2) & 0xFF] ^ (K3); \ - } while (0) - -#define AES_ROUND_NOKEY_BE(X0, X1, X2, X3, Y0, Y1, Y2, Y3) \ - AES_ROUND_BE(X0, X1, X2, X3, 0, 0, 0, 0, Y0, Y1, Y2, Y3) - -#else - -#define AESx(x) SPH_C32(x) -#define AES0 AES0_LE -#define AES1 AES1_LE -#define AES2 AES2_LE -#define AES3 AES3_LE - -#define AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3) do { \ - (Y0) = AES0[(X0) & 0xFF] \ - ^ AES1[((X1) >> 8) & 0xFF] \ - ^ AES2[((X2) >> 16) & 0xFF] \ - ^ AES3[((X3) >> 24) & 0xFF] ^ (K0); \ - (Y1) = AES0[(X1) & 0xFF] \ - ^ AES1[((X2) >> 8) & 0xFF] \ - ^ AES2[((X3) >> 16) & 0xFF] \ - ^ AES3[((X0) >> 24) & 0xFF] ^ (K1); \ - (Y2) = AES0[(X2) & 0xFF] \ - ^ AES1[((X3) >> 8) & 0xFF] \ - ^ AES2[((X0) >> 16) & 0xFF] \ - ^ AES3[((X1) >> 24) & 0xFF] ^ (K2); \ - (Y3) = AES0[(X3) & 0xFF] \ - ^ AES1[((X0) >> 8) & 0xFF] \ - ^ AES2[((X1) >> 16) & 0xFF] \ - ^ AES3[((X2) >> 24) & 0xFF] ^ (K3); \ - } while (0) - -#define AES_ROUND_NOKEY_LE(X0, X1, X2, X3, Y0, Y1, Y2, Y3) \ - AES_ROUND_LE(X0, X1, X2, X3, 0, 0, 0, 0, Y0, Y1, Y2, Y3) - -#endif - -/* - * The AES*[] tables allow us to perform a fast evaluation of an AES - * round; table AESi[] combines SubBytes for a byte at row i, and - * MixColumns for the column where that byte goes after ShiftRows. - */ - -static const sph_u32 AES0[256] = { - AESx(0xA56363C6), AESx(0x847C7CF8), AESx(0x997777EE), AESx(0x8D7B7BF6), - AESx(0x0DF2F2FF), AESx(0xBD6B6BD6), AESx(0xB16F6FDE), AESx(0x54C5C591), - AESx(0x50303060), AESx(0x03010102), AESx(0xA96767CE), AESx(0x7D2B2B56), - AESx(0x19FEFEE7), AESx(0x62D7D7B5), AESx(0xE6ABAB4D), AESx(0x9A7676EC), - AESx(0x45CACA8F), AESx(0x9D82821F), AESx(0x40C9C989), AESx(0x877D7DFA), - AESx(0x15FAFAEF), AESx(0xEB5959B2), AESx(0xC947478E), AESx(0x0BF0F0FB), - AESx(0xECADAD41), AESx(0x67D4D4B3), AESx(0xFDA2A25F), AESx(0xEAAFAF45), - AESx(0xBF9C9C23), AESx(0xF7A4A453), AESx(0x967272E4), AESx(0x5BC0C09B), - AESx(0xC2B7B775), AESx(0x1CFDFDE1), AESx(0xAE93933D), AESx(0x6A26264C), - AESx(0x5A36366C), AESx(0x413F3F7E), AESx(0x02F7F7F5), AESx(0x4FCCCC83), - AESx(0x5C343468), AESx(0xF4A5A551), AESx(0x34E5E5D1), AESx(0x08F1F1F9), - AESx(0x937171E2), AESx(0x73D8D8AB), AESx(0x53313162), AESx(0x3F15152A), - AESx(0x0C040408), AESx(0x52C7C795), AESx(0x65232346), AESx(0x5EC3C39D), - AESx(0x28181830), AESx(0xA1969637), AESx(0x0F05050A), AESx(0xB59A9A2F), - AESx(0x0907070E), AESx(0x36121224), AESx(0x9B80801B), AESx(0x3DE2E2DF), - AESx(0x26EBEBCD), AESx(0x6927274E), AESx(0xCDB2B27F), AESx(0x9F7575EA), - AESx(0x1B090912), AESx(0x9E83831D), AESx(0x742C2C58), AESx(0x2E1A1A34), - AESx(0x2D1B1B36), AESx(0xB26E6EDC), AESx(0xEE5A5AB4), AESx(0xFBA0A05B), - AESx(0xF65252A4), AESx(0x4D3B3B76), AESx(0x61D6D6B7), AESx(0xCEB3B37D), - AESx(0x7B292952), AESx(0x3EE3E3DD), AESx(0x712F2F5E), AESx(0x97848413), - AESx(0xF55353A6), AESx(0x68D1D1B9), AESx(0x00000000), AESx(0x2CEDEDC1), - AESx(0x60202040), AESx(0x1FFCFCE3), AESx(0xC8B1B179), AESx(0xED5B5BB6), - AESx(0xBE6A6AD4), AESx(0x46CBCB8D), AESx(0xD9BEBE67), AESx(0x4B393972), - AESx(0xDE4A4A94), AESx(0xD44C4C98), AESx(0xE85858B0), AESx(0x4ACFCF85), - AESx(0x6BD0D0BB), AESx(0x2AEFEFC5), AESx(0xE5AAAA4F), AESx(0x16FBFBED), - AESx(0xC5434386), AESx(0xD74D4D9A), AESx(0x55333366), AESx(0x94858511), - AESx(0xCF45458A), AESx(0x10F9F9E9), AESx(0x06020204), AESx(0x817F7FFE), - AESx(0xF05050A0), AESx(0x443C3C78), AESx(0xBA9F9F25), AESx(0xE3A8A84B), - AESx(0xF35151A2), AESx(0xFEA3A35D), AESx(0xC0404080), AESx(0x8A8F8F05), - AESx(0xAD92923F), AESx(0xBC9D9D21), AESx(0x48383870), AESx(0x04F5F5F1), - AESx(0xDFBCBC63), AESx(0xC1B6B677), AESx(0x75DADAAF), AESx(0x63212142), - AESx(0x30101020), AESx(0x1AFFFFE5), AESx(0x0EF3F3FD), AESx(0x6DD2D2BF), - AESx(0x4CCDCD81), AESx(0x140C0C18), AESx(0x35131326), AESx(0x2FECECC3), - AESx(0xE15F5FBE), AESx(0xA2979735), AESx(0xCC444488), AESx(0x3917172E), - AESx(0x57C4C493), AESx(0xF2A7A755), AESx(0x827E7EFC), AESx(0x473D3D7A), - AESx(0xAC6464C8), AESx(0xE75D5DBA), AESx(0x2B191932), AESx(0x957373E6), - AESx(0xA06060C0), AESx(0x98818119), AESx(0xD14F4F9E), AESx(0x7FDCDCA3), - AESx(0x66222244), AESx(0x7E2A2A54), AESx(0xAB90903B), AESx(0x8388880B), - AESx(0xCA46468C), AESx(0x29EEEEC7), AESx(0xD3B8B86B), AESx(0x3C141428), - AESx(0x79DEDEA7), AESx(0xE25E5EBC), AESx(0x1D0B0B16), AESx(0x76DBDBAD), - AESx(0x3BE0E0DB), AESx(0x56323264), AESx(0x4E3A3A74), AESx(0x1E0A0A14), - AESx(0xDB494992), AESx(0x0A06060C), AESx(0x6C242448), AESx(0xE45C5CB8), - AESx(0x5DC2C29F), AESx(0x6ED3D3BD), AESx(0xEFACAC43), AESx(0xA66262C4), - AESx(0xA8919139), AESx(0xA4959531), AESx(0x37E4E4D3), AESx(0x8B7979F2), - AESx(0x32E7E7D5), AESx(0x43C8C88B), AESx(0x5937376E), AESx(0xB76D6DDA), - AESx(0x8C8D8D01), AESx(0x64D5D5B1), AESx(0xD24E4E9C), AESx(0xE0A9A949), - AESx(0xB46C6CD8), AESx(0xFA5656AC), AESx(0x07F4F4F3), AESx(0x25EAEACF), - AESx(0xAF6565CA), AESx(0x8E7A7AF4), AESx(0xE9AEAE47), AESx(0x18080810), - AESx(0xD5BABA6F), AESx(0x887878F0), AESx(0x6F25254A), AESx(0x722E2E5C), - AESx(0x241C1C38), AESx(0xF1A6A657), AESx(0xC7B4B473), AESx(0x51C6C697), - AESx(0x23E8E8CB), AESx(0x7CDDDDA1), AESx(0x9C7474E8), AESx(0x211F1F3E), - AESx(0xDD4B4B96), AESx(0xDCBDBD61), AESx(0x868B8B0D), AESx(0x858A8A0F), - AESx(0x907070E0), AESx(0x423E3E7C), AESx(0xC4B5B571), AESx(0xAA6666CC), - AESx(0xD8484890), AESx(0x05030306), AESx(0x01F6F6F7), AESx(0x120E0E1C), - AESx(0xA36161C2), AESx(0x5F35356A), AESx(0xF95757AE), AESx(0xD0B9B969), - AESx(0x91868617), AESx(0x58C1C199), AESx(0x271D1D3A), AESx(0xB99E9E27), - AESx(0x38E1E1D9), AESx(0x13F8F8EB), AESx(0xB398982B), AESx(0x33111122), - AESx(0xBB6969D2), AESx(0x70D9D9A9), AESx(0x898E8E07), AESx(0xA7949433), - AESx(0xB69B9B2D), AESx(0x221E1E3C), AESx(0x92878715), AESx(0x20E9E9C9), - AESx(0x49CECE87), AESx(0xFF5555AA), AESx(0x78282850), AESx(0x7ADFDFA5), - AESx(0x8F8C8C03), AESx(0xF8A1A159), AESx(0x80898909), AESx(0x170D0D1A), - AESx(0xDABFBF65), AESx(0x31E6E6D7), AESx(0xC6424284), AESx(0xB86868D0), - AESx(0xC3414182), AESx(0xB0999929), AESx(0x772D2D5A), AESx(0x110F0F1E), - AESx(0xCBB0B07B), AESx(0xFC5454A8), AESx(0xD6BBBB6D), AESx(0x3A16162C) -}; - -static const sph_u32 AES1[256] = { - AESx(0x6363C6A5), AESx(0x7C7CF884), AESx(0x7777EE99), AESx(0x7B7BF68D), - AESx(0xF2F2FF0D), AESx(0x6B6BD6BD), AESx(0x6F6FDEB1), AESx(0xC5C59154), - AESx(0x30306050), AESx(0x01010203), AESx(0x6767CEA9), AESx(0x2B2B567D), - AESx(0xFEFEE719), AESx(0xD7D7B562), AESx(0xABAB4DE6), AESx(0x7676EC9A), - AESx(0xCACA8F45), AESx(0x82821F9D), AESx(0xC9C98940), AESx(0x7D7DFA87), - AESx(0xFAFAEF15), AESx(0x5959B2EB), AESx(0x47478EC9), AESx(0xF0F0FB0B), - AESx(0xADAD41EC), AESx(0xD4D4B367), AESx(0xA2A25FFD), AESx(0xAFAF45EA), - AESx(0x9C9C23BF), AESx(0xA4A453F7), AESx(0x7272E496), AESx(0xC0C09B5B), - AESx(0xB7B775C2), AESx(0xFDFDE11C), AESx(0x93933DAE), AESx(0x26264C6A), - AESx(0x36366C5A), AESx(0x3F3F7E41), AESx(0xF7F7F502), AESx(0xCCCC834F), - AESx(0x3434685C), AESx(0xA5A551F4), AESx(0xE5E5D134), AESx(0xF1F1F908), - AESx(0x7171E293), AESx(0xD8D8AB73), AESx(0x31316253), AESx(0x15152A3F), - AESx(0x0404080C), AESx(0xC7C79552), AESx(0x23234665), AESx(0xC3C39D5E), - AESx(0x18183028), AESx(0x969637A1), AESx(0x05050A0F), AESx(0x9A9A2FB5), - AESx(0x07070E09), AESx(0x12122436), AESx(0x80801B9B), AESx(0xE2E2DF3D), - AESx(0xEBEBCD26), AESx(0x27274E69), AESx(0xB2B27FCD), AESx(0x7575EA9F), - AESx(0x0909121B), AESx(0x83831D9E), AESx(0x2C2C5874), AESx(0x1A1A342E), - AESx(0x1B1B362D), AESx(0x6E6EDCB2), AESx(0x5A5AB4EE), AESx(0xA0A05BFB), - AESx(0x5252A4F6), AESx(0x3B3B764D), AESx(0xD6D6B761), AESx(0xB3B37DCE), - AESx(0x2929527B), AESx(0xE3E3DD3E), AESx(0x2F2F5E71), AESx(0x84841397), - AESx(0x5353A6F5), AESx(0xD1D1B968), AESx(0x00000000), AESx(0xEDEDC12C), - AESx(0x20204060), AESx(0xFCFCE31F), AESx(0xB1B179C8), AESx(0x5B5BB6ED), - AESx(0x6A6AD4BE), AESx(0xCBCB8D46), AESx(0xBEBE67D9), AESx(0x3939724B), - AESx(0x4A4A94DE), AESx(0x4C4C98D4), AESx(0x5858B0E8), AESx(0xCFCF854A), - AESx(0xD0D0BB6B), AESx(0xEFEFC52A), AESx(0xAAAA4FE5), AESx(0xFBFBED16), - AESx(0x434386C5), AESx(0x4D4D9AD7), AESx(0x33336655), AESx(0x85851194), - AESx(0x45458ACF), AESx(0xF9F9E910), AESx(0x02020406), AESx(0x7F7FFE81), - AESx(0x5050A0F0), AESx(0x3C3C7844), AESx(0x9F9F25BA), AESx(0xA8A84BE3), - AESx(0x5151A2F3), AESx(0xA3A35DFE), AESx(0x404080C0), AESx(0x8F8F058A), - AESx(0x92923FAD), AESx(0x9D9D21BC), AESx(0x38387048), AESx(0xF5F5F104), - AESx(0xBCBC63DF), AESx(0xB6B677C1), AESx(0xDADAAF75), AESx(0x21214263), - AESx(0x10102030), AESx(0xFFFFE51A), AESx(0xF3F3FD0E), AESx(0xD2D2BF6D), - AESx(0xCDCD814C), AESx(0x0C0C1814), AESx(0x13132635), AESx(0xECECC32F), - AESx(0x5F5FBEE1), AESx(0x979735A2), AESx(0x444488CC), AESx(0x17172E39), - AESx(0xC4C49357), AESx(0xA7A755F2), AESx(0x7E7EFC82), AESx(0x3D3D7A47), - AESx(0x6464C8AC), AESx(0x5D5DBAE7), AESx(0x1919322B), AESx(0x7373E695), - AESx(0x6060C0A0), AESx(0x81811998), AESx(0x4F4F9ED1), AESx(0xDCDCA37F), - AESx(0x22224466), AESx(0x2A2A547E), AESx(0x90903BAB), AESx(0x88880B83), - AESx(0x46468CCA), AESx(0xEEEEC729), AESx(0xB8B86BD3), AESx(0x1414283C), - AESx(0xDEDEA779), AESx(0x5E5EBCE2), AESx(0x0B0B161D), AESx(0xDBDBAD76), - AESx(0xE0E0DB3B), AESx(0x32326456), AESx(0x3A3A744E), AESx(0x0A0A141E), - AESx(0x494992DB), AESx(0x06060C0A), AESx(0x2424486C), AESx(0x5C5CB8E4), - AESx(0xC2C29F5D), AESx(0xD3D3BD6E), AESx(0xACAC43EF), AESx(0x6262C4A6), - AESx(0x919139A8), AESx(0x959531A4), AESx(0xE4E4D337), AESx(0x7979F28B), - AESx(0xE7E7D532), AESx(0xC8C88B43), AESx(0x37376E59), AESx(0x6D6DDAB7), - AESx(0x8D8D018C), AESx(0xD5D5B164), AESx(0x4E4E9CD2), AESx(0xA9A949E0), - AESx(0x6C6CD8B4), AESx(0x5656ACFA), AESx(0xF4F4F307), AESx(0xEAEACF25), - AESx(0x6565CAAF), AESx(0x7A7AF48E), AESx(0xAEAE47E9), AESx(0x08081018), - AESx(0xBABA6FD5), AESx(0x7878F088), AESx(0x25254A6F), AESx(0x2E2E5C72), - AESx(0x1C1C3824), AESx(0xA6A657F1), AESx(0xB4B473C7), AESx(0xC6C69751), - AESx(0xE8E8CB23), AESx(0xDDDDA17C), AESx(0x7474E89C), AESx(0x1F1F3E21), - AESx(0x4B4B96DD), AESx(0xBDBD61DC), AESx(0x8B8B0D86), AESx(0x8A8A0F85), - AESx(0x7070E090), AESx(0x3E3E7C42), AESx(0xB5B571C4), AESx(0x6666CCAA), - AESx(0x484890D8), AESx(0x03030605), AESx(0xF6F6F701), AESx(0x0E0E1C12), - AESx(0x6161C2A3), AESx(0x35356A5F), AESx(0x5757AEF9), AESx(0xB9B969D0), - AESx(0x86861791), AESx(0xC1C19958), AESx(0x1D1D3A27), AESx(0x9E9E27B9), - AESx(0xE1E1D938), AESx(0xF8F8EB13), AESx(0x98982BB3), AESx(0x11112233), - AESx(0x6969D2BB), AESx(0xD9D9A970), AESx(0x8E8E0789), AESx(0x949433A7), - AESx(0x9B9B2DB6), AESx(0x1E1E3C22), AESx(0x87871592), AESx(0xE9E9C920), - AESx(0xCECE8749), AESx(0x5555AAFF), AESx(0x28285078), AESx(0xDFDFA57A), - AESx(0x8C8C038F), AESx(0xA1A159F8), AESx(0x89890980), AESx(0x0D0D1A17), - AESx(0xBFBF65DA), AESx(0xE6E6D731), AESx(0x424284C6), AESx(0x6868D0B8), - AESx(0x414182C3), AESx(0x999929B0), AESx(0x2D2D5A77), AESx(0x0F0F1E11), - AESx(0xB0B07BCB), AESx(0x5454A8FC), AESx(0xBBBB6DD6), AESx(0x16162C3A) -}; - -static const sph_u32 AES2[256] = { - AESx(0x63C6A563), AESx(0x7CF8847C), AESx(0x77EE9977), AESx(0x7BF68D7B), - AESx(0xF2FF0DF2), AESx(0x6BD6BD6B), AESx(0x6FDEB16F), AESx(0xC59154C5), - AESx(0x30605030), AESx(0x01020301), AESx(0x67CEA967), AESx(0x2B567D2B), - AESx(0xFEE719FE), AESx(0xD7B562D7), AESx(0xAB4DE6AB), AESx(0x76EC9A76), - AESx(0xCA8F45CA), AESx(0x821F9D82), AESx(0xC98940C9), AESx(0x7DFA877D), - AESx(0xFAEF15FA), AESx(0x59B2EB59), AESx(0x478EC947), AESx(0xF0FB0BF0), - AESx(0xAD41ECAD), AESx(0xD4B367D4), AESx(0xA25FFDA2), AESx(0xAF45EAAF), - AESx(0x9C23BF9C), AESx(0xA453F7A4), AESx(0x72E49672), AESx(0xC09B5BC0), - AESx(0xB775C2B7), AESx(0xFDE11CFD), AESx(0x933DAE93), AESx(0x264C6A26), - AESx(0x366C5A36), AESx(0x3F7E413F), AESx(0xF7F502F7), AESx(0xCC834FCC), - AESx(0x34685C34), AESx(0xA551F4A5), AESx(0xE5D134E5), AESx(0xF1F908F1), - AESx(0x71E29371), AESx(0xD8AB73D8), AESx(0x31625331), AESx(0x152A3F15), - AESx(0x04080C04), AESx(0xC79552C7), AESx(0x23466523), AESx(0xC39D5EC3), - AESx(0x18302818), AESx(0x9637A196), AESx(0x050A0F05), AESx(0x9A2FB59A), - AESx(0x070E0907), AESx(0x12243612), AESx(0x801B9B80), AESx(0xE2DF3DE2), - AESx(0xEBCD26EB), AESx(0x274E6927), AESx(0xB27FCDB2), AESx(0x75EA9F75), - AESx(0x09121B09), AESx(0x831D9E83), AESx(0x2C58742C), AESx(0x1A342E1A), - AESx(0x1B362D1B), AESx(0x6EDCB26E), AESx(0x5AB4EE5A), AESx(0xA05BFBA0), - AESx(0x52A4F652), AESx(0x3B764D3B), AESx(0xD6B761D6), AESx(0xB37DCEB3), - AESx(0x29527B29), AESx(0xE3DD3EE3), AESx(0x2F5E712F), AESx(0x84139784), - AESx(0x53A6F553), AESx(0xD1B968D1), AESx(0x00000000), AESx(0xEDC12CED), - AESx(0x20406020), AESx(0xFCE31FFC), AESx(0xB179C8B1), AESx(0x5BB6ED5B), - AESx(0x6AD4BE6A), AESx(0xCB8D46CB), AESx(0xBE67D9BE), AESx(0x39724B39), - AESx(0x4A94DE4A), AESx(0x4C98D44C), AESx(0x58B0E858), AESx(0xCF854ACF), - AESx(0xD0BB6BD0), AESx(0xEFC52AEF), AESx(0xAA4FE5AA), AESx(0xFBED16FB), - AESx(0x4386C543), AESx(0x4D9AD74D), AESx(0x33665533), AESx(0x85119485), - AESx(0x458ACF45), AESx(0xF9E910F9), AESx(0x02040602), AESx(0x7FFE817F), - AESx(0x50A0F050), AESx(0x3C78443C), AESx(0x9F25BA9F), AESx(0xA84BE3A8), - AESx(0x51A2F351), AESx(0xA35DFEA3), AESx(0x4080C040), AESx(0x8F058A8F), - AESx(0x923FAD92), AESx(0x9D21BC9D), AESx(0x38704838), AESx(0xF5F104F5), - AESx(0xBC63DFBC), AESx(0xB677C1B6), AESx(0xDAAF75DA), AESx(0x21426321), - AESx(0x10203010), AESx(0xFFE51AFF), AESx(0xF3FD0EF3), AESx(0xD2BF6DD2), - AESx(0xCD814CCD), AESx(0x0C18140C), AESx(0x13263513), AESx(0xECC32FEC), - AESx(0x5FBEE15F), AESx(0x9735A297), AESx(0x4488CC44), AESx(0x172E3917), - AESx(0xC49357C4), AESx(0xA755F2A7), AESx(0x7EFC827E), AESx(0x3D7A473D), - AESx(0x64C8AC64), AESx(0x5DBAE75D), AESx(0x19322B19), AESx(0x73E69573), - AESx(0x60C0A060), AESx(0x81199881), AESx(0x4F9ED14F), AESx(0xDCA37FDC), - AESx(0x22446622), AESx(0x2A547E2A), AESx(0x903BAB90), AESx(0x880B8388), - AESx(0x468CCA46), AESx(0xEEC729EE), AESx(0xB86BD3B8), AESx(0x14283C14), - AESx(0xDEA779DE), AESx(0x5EBCE25E), AESx(0x0B161D0B), AESx(0xDBAD76DB), - AESx(0xE0DB3BE0), AESx(0x32645632), AESx(0x3A744E3A), AESx(0x0A141E0A), - AESx(0x4992DB49), AESx(0x060C0A06), AESx(0x24486C24), AESx(0x5CB8E45C), - AESx(0xC29F5DC2), AESx(0xD3BD6ED3), AESx(0xAC43EFAC), AESx(0x62C4A662), - AESx(0x9139A891), AESx(0x9531A495), AESx(0xE4D337E4), AESx(0x79F28B79), - AESx(0xE7D532E7), AESx(0xC88B43C8), AESx(0x376E5937), AESx(0x6DDAB76D), - AESx(0x8D018C8D), AESx(0xD5B164D5), AESx(0x4E9CD24E), AESx(0xA949E0A9), - AESx(0x6CD8B46C), AESx(0x56ACFA56), AESx(0xF4F307F4), AESx(0xEACF25EA), - AESx(0x65CAAF65), AESx(0x7AF48E7A), AESx(0xAE47E9AE), AESx(0x08101808), - AESx(0xBA6FD5BA), AESx(0x78F08878), AESx(0x254A6F25), AESx(0x2E5C722E), - AESx(0x1C38241C), AESx(0xA657F1A6), AESx(0xB473C7B4), AESx(0xC69751C6), - AESx(0xE8CB23E8), AESx(0xDDA17CDD), AESx(0x74E89C74), AESx(0x1F3E211F), - AESx(0x4B96DD4B), AESx(0xBD61DCBD), AESx(0x8B0D868B), AESx(0x8A0F858A), - AESx(0x70E09070), AESx(0x3E7C423E), AESx(0xB571C4B5), AESx(0x66CCAA66), - AESx(0x4890D848), AESx(0x03060503), AESx(0xF6F701F6), AESx(0x0E1C120E), - AESx(0x61C2A361), AESx(0x356A5F35), AESx(0x57AEF957), AESx(0xB969D0B9), - AESx(0x86179186), AESx(0xC19958C1), AESx(0x1D3A271D), AESx(0x9E27B99E), - AESx(0xE1D938E1), AESx(0xF8EB13F8), AESx(0x982BB398), AESx(0x11223311), - AESx(0x69D2BB69), AESx(0xD9A970D9), AESx(0x8E07898E), AESx(0x9433A794), - AESx(0x9B2DB69B), AESx(0x1E3C221E), AESx(0x87159287), AESx(0xE9C920E9), - AESx(0xCE8749CE), AESx(0x55AAFF55), AESx(0x28507828), AESx(0xDFA57ADF), - AESx(0x8C038F8C), AESx(0xA159F8A1), AESx(0x89098089), AESx(0x0D1A170D), - AESx(0xBF65DABF), AESx(0xE6D731E6), AESx(0x4284C642), AESx(0x68D0B868), - AESx(0x4182C341), AESx(0x9929B099), AESx(0x2D5A772D), AESx(0x0F1E110F), - AESx(0xB07BCBB0), AESx(0x54A8FC54), AESx(0xBB6DD6BB), AESx(0x162C3A16) -}; - -static const sph_u32 AES3[256] = { - AESx(0xC6A56363), AESx(0xF8847C7C), AESx(0xEE997777), AESx(0xF68D7B7B), - AESx(0xFF0DF2F2), AESx(0xD6BD6B6B), AESx(0xDEB16F6F), AESx(0x9154C5C5), - AESx(0x60503030), AESx(0x02030101), AESx(0xCEA96767), AESx(0x567D2B2B), - AESx(0xE719FEFE), AESx(0xB562D7D7), AESx(0x4DE6ABAB), AESx(0xEC9A7676), - AESx(0x8F45CACA), AESx(0x1F9D8282), AESx(0x8940C9C9), AESx(0xFA877D7D), - AESx(0xEF15FAFA), AESx(0xB2EB5959), AESx(0x8EC94747), AESx(0xFB0BF0F0), - AESx(0x41ECADAD), AESx(0xB367D4D4), AESx(0x5FFDA2A2), AESx(0x45EAAFAF), - AESx(0x23BF9C9C), AESx(0x53F7A4A4), AESx(0xE4967272), AESx(0x9B5BC0C0), - AESx(0x75C2B7B7), AESx(0xE11CFDFD), AESx(0x3DAE9393), AESx(0x4C6A2626), - AESx(0x6C5A3636), AESx(0x7E413F3F), AESx(0xF502F7F7), AESx(0x834FCCCC), - AESx(0x685C3434), AESx(0x51F4A5A5), AESx(0xD134E5E5), AESx(0xF908F1F1), - AESx(0xE2937171), AESx(0xAB73D8D8), AESx(0x62533131), AESx(0x2A3F1515), - AESx(0x080C0404), AESx(0x9552C7C7), AESx(0x46652323), AESx(0x9D5EC3C3), - AESx(0x30281818), AESx(0x37A19696), AESx(0x0A0F0505), AESx(0x2FB59A9A), - AESx(0x0E090707), AESx(0x24361212), AESx(0x1B9B8080), AESx(0xDF3DE2E2), - AESx(0xCD26EBEB), AESx(0x4E692727), AESx(0x7FCDB2B2), AESx(0xEA9F7575), - AESx(0x121B0909), AESx(0x1D9E8383), AESx(0x58742C2C), AESx(0x342E1A1A), - AESx(0x362D1B1B), AESx(0xDCB26E6E), AESx(0xB4EE5A5A), AESx(0x5BFBA0A0), - AESx(0xA4F65252), AESx(0x764D3B3B), AESx(0xB761D6D6), AESx(0x7DCEB3B3), - AESx(0x527B2929), AESx(0xDD3EE3E3), AESx(0x5E712F2F), AESx(0x13978484), - AESx(0xA6F55353), AESx(0xB968D1D1), AESx(0x00000000), AESx(0xC12CEDED), - AESx(0x40602020), AESx(0xE31FFCFC), AESx(0x79C8B1B1), AESx(0xB6ED5B5B), - AESx(0xD4BE6A6A), AESx(0x8D46CBCB), AESx(0x67D9BEBE), AESx(0x724B3939), - AESx(0x94DE4A4A), AESx(0x98D44C4C), AESx(0xB0E85858), AESx(0x854ACFCF), - AESx(0xBB6BD0D0), AESx(0xC52AEFEF), AESx(0x4FE5AAAA), AESx(0xED16FBFB), - AESx(0x86C54343), AESx(0x9AD74D4D), AESx(0x66553333), AESx(0x11948585), - AESx(0x8ACF4545), AESx(0xE910F9F9), AESx(0x04060202), AESx(0xFE817F7F), - AESx(0xA0F05050), AESx(0x78443C3C), AESx(0x25BA9F9F), AESx(0x4BE3A8A8), - AESx(0xA2F35151), AESx(0x5DFEA3A3), AESx(0x80C04040), AESx(0x058A8F8F), - AESx(0x3FAD9292), AESx(0x21BC9D9D), AESx(0x70483838), AESx(0xF104F5F5), - AESx(0x63DFBCBC), AESx(0x77C1B6B6), AESx(0xAF75DADA), AESx(0x42632121), - AESx(0x20301010), AESx(0xE51AFFFF), AESx(0xFD0EF3F3), AESx(0xBF6DD2D2), - AESx(0x814CCDCD), AESx(0x18140C0C), AESx(0x26351313), AESx(0xC32FECEC), - AESx(0xBEE15F5F), AESx(0x35A29797), AESx(0x88CC4444), AESx(0x2E391717), - AESx(0x9357C4C4), AESx(0x55F2A7A7), AESx(0xFC827E7E), AESx(0x7A473D3D), - AESx(0xC8AC6464), AESx(0xBAE75D5D), AESx(0x322B1919), AESx(0xE6957373), - AESx(0xC0A06060), AESx(0x19988181), AESx(0x9ED14F4F), AESx(0xA37FDCDC), - AESx(0x44662222), AESx(0x547E2A2A), AESx(0x3BAB9090), AESx(0x0B838888), - AESx(0x8CCA4646), AESx(0xC729EEEE), AESx(0x6BD3B8B8), AESx(0x283C1414), - AESx(0xA779DEDE), AESx(0xBCE25E5E), AESx(0x161D0B0B), AESx(0xAD76DBDB), - AESx(0xDB3BE0E0), AESx(0x64563232), AESx(0x744E3A3A), AESx(0x141E0A0A), - AESx(0x92DB4949), AESx(0x0C0A0606), AESx(0x486C2424), AESx(0xB8E45C5C), - AESx(0x9F5DC2C2), AESx(0xBD6ED3D3), AESx(0x43EFACAC), AESx(0xC4A66262), - AESx(0x39A89191), AESx(0x31A49595), AESx(0xD337E4E4), AESx(0xF28B7979), - AESx(0xD532E7E7), AESx(0x8B43C8C8), AESx(0x6E593737), AESx(0xDAB76D6D), - AESx(0x018C8D8D), AESx(0xB164D5D5), AESx(0x9CD24E4E), AESx(0x49E0A9A9), - AESx(0xD8B46C6C), AESx(0xACFA5656), AESx(0xF307F4F4), AESx(0xCF25EAEA), - AESx(0xCAAF6565), AESx(0xF48E7A7A), AESx(0x47E9AEAE), AESx(0x10180808), - AESx(0x6FD5BABA), AESx(0xF0887878), AESx(0x4A6F2525), AESx(0x5C722E2E), - AESx(0x38241C1C), AESx(0x57F1A6A6), AESx(0x73C7B4B4), AESx(0x9751C6C6), - AESx(0xCB23E8E8), AESx(0xA17CDDDD), AESx(0xE89C7474), AESx(0x3E211F1F), - AESx(0x96DD4B4B), AESx(0x61DCBDBD), AESx(0x0D868B8B), AESx(0x0F858A8A), - AESx(0xE0907070), AESx(0x7C423E3E), AESx(0x71C4B5B5), AESx(0xCCAA6666), - AESx(0x90D84848), AESx(0x06050303), AESx(0xF701F6F6), AESx(0x1C120E0E), - AESx(0xC2A36161), AESx(0x6A5F3535), AESx(0xAEF95757), AESx(0x69D0B9B9), - AESx(0x17918686), AESx(0x9958C1C1), AESx(0x3A271D1D), AESx(0x27B99E9E), - AESx(0xD938E1E1), AESx(0xEB13F8F8), AESx(0x2BB39898), AESx(0x22331111), - AESx(0xD2BB6969), AESx(0xA970D9D9), AESx(0x07898E8E), AESx(0x33A79494), - AESx(0x2DB69B9B), AESx(0x3C221E1E), AESx(0x15928787), AESx(0xC920E9E9), - AESx(0x8749CECE), AESx(0xAAFF5555), AESx(0x50782828), AESx(0xA57ADFDF), - AESx(0x038F8C8C), AESx(0x59F8A1A1), AESx(0x09808989), AESx(0x1A170D0D), - AESx(0x65DABFBF), AESx(0xD731E6E6), AESx(0x84C64242), AESx(0xD0B86868), - AESx(0x82C34141), AESx(0x29B09999), AESx(0x5A772D2D), AESx(0x1E110F0F), - AESx(0x7BCBB0B0), AESx(0xA8FC5454), AESx(0x6DD6BBBB), AESx(0x2C3A1616) -}; - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/blake.c b/src/crypto/blake.c deleted file mode 100644 index 0650b9cf2..000000000 --- a/src/crypto/blake.c +++ /dev/null @@ -1,1120 +0,0 @@ -/* $Id: blake.c 252 2011-06-07 17:55:14Z tp $ */ -/* - * BLAKE implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_blake.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_BLAKE -#define SPH_SMALL_FOOTPRINT_BLAKE 1 -#endif - -#if SPH_SMALL_FOOTPRINT_BLAKE -#define SPH_COMPACT_BLAKE_32 1 -#endif - -#if SPH_64 && (SPH_SMALL_FOOTPRINT_BLAKE || !SPH_64_TRUE) -#define SPH_COMPACT_BLAKE_64 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[8] = { - SPH_C32(0xC1059ED8), SPH_C32(0x367CD507), - SPH_C32(0x3070DD17), SPH_C32(0xF70E5939), - SPH_C32(0xFFC00B31), SPH_C32(0x68581511), - SPH_C32(0x64F98FA7), SPH_C32(0xBEFA4FA4) -}; - -static const sph_u32 IV256[8] = { - SPH_C32(0x6A09E667), SPH_C32(0xBB67AE85), - SPH_C32(0x3C6EF372), SPH_C32(0xA54FF53A), - SPH_C32(0x510E527F), SPH_C32(0x9B05688C), - SPH_C32(0x1F83D9AB), SPH_C32(0x5BE0CD19) -}; - -#if SPH_64 - -static const sph_u64 IV384[8] = { - SPH_C64(0xCBBB9D5DC1059ED8), SPH_C64(0x629A292A367CD507), - SPH_C64(0x9159015A3070DD17), SPH_C64(0x152FECD8F70E5939), - SPH_C64(0x67332667FFC00B31), SPH_C64(0x8EB44A8768581511), - SPH_C64(0xDB0C2E0D64F98FA7), SPH_C64(0x47B5481DBEFA4FA4) -}; - -static const sph_u64 IV512[8] = { - SPH_C64(0x6A09E667F3BCC908), SPH_C64(0xBB67AE8584CAA73B), - SPH_C64(0x3C6EF372FE94F82B), SPH_C64(0xA54FF53A5F1D36F1), - SPH_C64(0x510E527FADE682D1), SPH_C64(0x9B05688C2B3E6C1F), - SPH_C64(0x1F83D9ABFB41BD6B), SPH_C64(0x5BE0CD19137E2179) -}; - -#endif - -#if SPH_COMPACT_BLAKE_32 || SPH_COMPACT_BLAKE_64 - -static const unsigned sigma[16][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } -}; - -/* - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 14 10 4 8 9 15 13 6 1 12 0 2 11 7 5 3 - 11 8 12 0 5 2 15 13 10 14 3 6 7 1 9 4 - 7 9 3 1 13 12 11 14 2 6 5 10 4 0 15 8 - 9 0 5 7 2 4 10 15 14 1 11 12 6 8 3 13 - 2 12 6 10 0 11 8 3 4 13 7 5 15 14 1 9 - 12 5 1 15 14 13 4 10 0 7 6 3 9 2 8 11 - 13 11 7 14 12 1 3 9 5 0 15 4 8 6 2 10 - 6 15 14 9 11 3 0 8 12 2 13 7 1 4 10 5 - 10 2 8 4 7 6 1 5 15 11 9 14 3 12 13 0 -*/ -#endif - -#define Z00 0 -#define Z01 1 -#define Z02 2 -#define Z03 3 -#define Z04 4 -#define Z05 5 -#define Z06 6 -#define Z07 7 -#define Z08 8 -#define Z09 9 -#define Z0A A -#define Z0B B -#define Z0C C -#define Z0D D -#define Z0E E -#define Z0F F - -#define Z10 E -#define Z11 A -#define Z12 4 -#define Z13 8 -#define Z14 9 -#define Z15 F -#define Z16 D -#define Z17 6 -#define Z18 1 -#define Z19 C -#define Z1A 0 -#define Z1B 2 -#define Z1C B -#define Z1D 7 -#define Z1E 5 -#define Z1F 3 - -#define Z20 B -#define Z21 8 -#define Z22 C -#define Z23 0 -#define Z24 5 -#define Z25 2 -#define Z26 F -#define Z27 D -#define Z28 A -#define Z29 E -#define Z2A 3 -#define Z2B 6 -#define Z2C 7 -#define Z2D 1 -#define Z2E 9 -#define Z2F 4 - -#define Z30 7 -#define Z31 9 -#define Z32 3 -#define Z33 1 -#define Z34 D -#define Z35 C -#define Z36 B -#define Z37 E -#define Z38 2 -#define Z39 6 -#define Z3A 5 -#define Z3B A -#define Z3C 4 -#define Z3D 0 -#define Z3E F -#define Z3F 8 - -#define Z40 9 -#define Z41 0 -#define Z42 5 -#define Z43 7 -#define Z44 2 -#define Z45 4 -#define Z46 A -#define Z47 F -#define Z48 E -#define Z49 1 -#define Z4A B -#define Z4B C -#define Z4C 6 -#define Z4D 8 -#define Z4E 3 -#define Z4F D - -#define Z50 2 -#define Z51 C -#define Z52 6 -#define Z53 A -#define Z54 0 -#define Z55 B -#define Z56 8 -#define Z57 3 -#define Z58 4 -#define Z59 D -#define Z5A 7 -#define Z5B 5 -#define Z5C F -#define Z5D E -#define Z5E 1 -#define Z5F 9 - -#define Z60 C -#define Z61 5 -#define Z62 1 -#define Z63 F -#define Z64 E -#define Z65 D -#define Z66 4 -#define Z67 A -#define Z68 0 -#define Z69 7 -#define Z6A 6 -#define Z6B 3 -#define Z6C 9 -#define Z6D 2 -#define Z6E 8 -#define Z6F B - -#define Z70 D -#define Z71 B -#define Z72 7 -#define Z73 E -#define Z74 C -#define Z75 1 -#define Z76 3 -#define Z77 9 -#define Z78 5 -#define Z79 0 -#define Z7A F -#define Z7B 4 -#define Z7C 8 -#define Z7D 6 -#define Z7E 2 -#define Z7F A - -#define Z80 6 -#define Z81 F -#define Z82 E -#define Z83 9 -#define Z84 B -#define Z85 3 -#define Z86 0 -#define Z87 8 -#define Z88 C -#define Z89 2 -#define Z8A D -#define Z8B 7 -#define Z8C 1 -#define Z8D 4 -#define Z8E A -#define Z8F 5 - -#define Z90 A -#define Z91 2 -#define Z92 8 -#define Z93 4 -#define Z94 7 -#define Z95 6 -#define Z96 1 -#define Z97 5 -#define Z98 F -#define Z99 B -#define Z9A 9 -#define Z9B E -#define Z9C 3 -#define Z9D C -#define Z9E D -#define Z9F 0 - -#define Mx(r, i) Mx_(Z ## r ## i) -#define Mx_(n) Mx__(n) -#define Mx__(n) M ## n - -#define CSx(r, i) CSx_(Z ## r ## i) -#define CSx_(n) CSx__(n) -#define CSx__(n) CS ## n - -#define CS0 SPH_C32(0x243F6A88) -#define CS1 SPH_C32(0x85A308D3) -#define CS2 SPH_C32(0x13198A2E) -#define CS3 SPH_C32(0x03707344) -#define CS4 SPH_C32(0xA4093822) -#define CS5 SPH_C32(0x299F31D0) -#define CS6 SPH_C32(0x082EFA98) -#define CS7 SPH_C32(0xEC4E6C89) -#define CS8 SPH_C32(0x452821E6) -#define CS9 SPH_C32(0x38D01377) -#define CSA SPH_C32(0xBE5466CF) -#define CSB SPH_C32(0x34E90C6C) -#define CSC SPH_C32(0xC0AC29B7) -#define CSD SPH_C32(0xC97C50DD) -#define CSE SPH_C32(0x3F84D5B5) -#define CSF SPH_C32(0xB5470917) - -#if SPH_COMPACT_BLAKE_32 - -static const sph_u32 CS[16] = { - SPH_C32(0x243F6A88), SPH_C32(0x85A308D3), - SPH_C32(0x13198A2E), SPH_C32(0x03707344), - SPH_C32(0xA4093822), SPH_C32(0x299F31D0), - SPH_C32(0x082EFA98), SPH_C32(0xEC4E6C89), - SPH_C32(0x452821E6), SPH_C32(0x38D01377), - SPH_C32(0xBE5466CF), SPH_C32(0x34E90C6C), - SPH_C32(0xC0AC29B7), SPH_C32(0xC97C50DD), - SPH_C32(0x3F84D5B5), SPH_C32(0xB5470917) -}; - -#endif - -#if SPH_64 - -#define CBx(r, i) CBx_(Z ## r ## i) -#define CBx_(n) CBx__(n) -#define CBx__(n) CB ## n - -#define CB0 SPH_C64(0x243F6A8885A308D3) -#define CB1 SPH_C64(0x13198A2E03707344) -#define CB2 SPH_C64(0xA4093822299F31D0) -#define CB3 SPH_C64(0x082EFA98EC4E6C89) -#define CB4 SPH_C64(0x452821E638D01377) -#define CB5 SPH_C64(0xBE5466CF34E90C6C) -#define CB6 SPH_C64(0xC0AC29B7C97C50DD) -#define CB7 SPH_C64(0x3F84D5B5B5470917) -#define CB8 SPH_C64(0x9216D5D98979FB1B) -#define CB9 SPH_C64(0xD1310BA698DFB5AC) -#define CBA SPH_C64(0x2FFD72DBD01ADFB7) -#define CBB SPH_C64(0xB8E1AFED6A267E96) -#define CBC SPH_C64(0xBA7C9045F12C7F99) -#define CBD SPH_C64(0x24A19947B3916CF7) -#define CBE SPH_C64(0x0801F2E2858EFC16) -#define CBF SPH_C64(0x636920D871574E69) - -#if SPH_COMPACT_BLAKE_64 - -static const sph_u64 CB[16] = { - SPH_C64(0x243F6A8885A308D3), SPH_C64(0x13198A2E03707344), - SPH_C64(0xA4093822299F31D0), SPH_C64(0x082EFA98EC4E6C89), - SPH_C64(0x452821E638D01377), SPH_C64(0xBE5466CF34E90C6C), - SPH_C64(0xC0AC29B7C97C50DD), SPH_C64(0x3F84D5B5B5470917), - SPH_C64(0x9216D5D98979FB1B), SPH_C64(0xD1310BA698DFB5AC), - SPH_C64(0x2FFD72DBD01ADFB7), SPH_C64(0xB8E1AFED6A267E96), - SPH_C64(0xBA7C9045F12C7F99), SPH_C64(0x24A19947B3916CF7), - SPH_C64(0x0801F2E2858EFC16), SPH_C64(0x636920D871574E69) -}; - -#endif - -#endif - -#define GS(m0, m1, c0, c1, a, b, c, d) do { \ - a = SPH_T32(a + b + (m0 ^ c1)); \ - d = SPH_ROTR32(d ^ a, 16); \ - c = SPH_T32(c + d); \ - b = SPH_ROTR32(b ^ c, 12); \ - a = SPH_T32(a + b + (m1 ^ c0)); \ - d = SPH_ROTR32(d ^ a, 8); \ - c = SPH_T32(c + d); \ - b = SPH_ROTR32(b ^ c, 7); \ - } while (0) - -#if SPH_COMPACT_BLAKE_32 - -#define ROUND_S(r) do { \ - GS(M[sigma[r][0x0]], M[sigma[r][0x1]], \ - CS[sigma[r][0x0]], CS[sigma[r][0x1]], V0, V4, V8, VC); \ - GS(M[sigma[r][0x2]], M[sigma[r][0x3]], \ - CS[sigma[r][0x2]], CS[sigma[r][0x3]], V1, V5, V9, VD); \ - GS(M[sigma[r][0x4]], M[sigma[r][0x5]], \ - CS[sigma[r][0x4]], CS[sigma[r][0x5]], V2, V6, VA, VE); \ - GS(M[sigma[r][0x6]], M[sigma[r][0x7]], \ - CS[sigma[r][0x6]], CS[sigma[r][0x7]], V3, V7, VB, VF); \ - GS(M[sigma[r][0x8]], M[sigma[r][0x9]], \ - CS[sigma[r][0x8]], CS[sigma[r][0x9]], V0, V5, VA, VF); \ - GS(M[sigma[r][0xA]], M[sigma[r][0xB]], \ - CS[sigma[r][0xA]], CS[sigma[r][0xB]], V1, V6, VB, VC); \ - GS(M[sigma[r][0xC]], M[sigma[r][0xD]], \ - CS[sigma[r][0xC]], CS[sigma[r][0xD]], V2, V7, V8, VD); \ - GS(M[sigma[r][0xE]], M[sigma[r][0xF]], \ - CS[sigma[r][0xE]], CS[sigma[r][0xF]], V3, V4, V9, VE); \ - } while (0) - -#else - -#define ROUND_S(r) do { \ - GS(Mx(r, 0), Mx(r, 1), CSx(r, 0), CSx(r, 1), V0, V4, V8, VC); \ - GS(Mx(r, 2), Mx(r, 3), CSx(r, 2), CSx(r, 3), V1, V5, V9, VD); \ - GS(Mx(r, 4), Mx(r, 5), CSx(r, 4), CSx(r, 5), V2, V6, VA, VE); \ - GS(Mx(r, 6), Mx(r, 7), CSx(r, 6), CSx(r, 7), V3, V7, VB, VF); \ - GS(Mx(r, 8), Mx(r, 9), CSx(r, 8), CSx(r, 9), V0, V5, VA, VF); \ - GS(Mx(r, A), Mx(r, B), CSx(r, A), CSx(r, B), V1, V6, VB, VC); \ - GS(Mx(r, C), Mx(r, D), CSx(r, C), CSx(r, D), V2, V7, V8, VD); \ - GS(Mx(r, E), Mx(r, F), CSx(r, E), CSx(r, F), V3, V4, V9, VE); \ - } while (0) - -#endif - -#if SPH_64 - -#define GB(m0, m1, c0, c1, a, b, c, d) do { \ - a = SPH_T64(a + b + (m0 ^ c1)); \ - d = SPH_ROTR64(d ^ a, 32); \ - c = SPH_T64(c + d); \ - b = SPH_ROTR64(b ^ c, 25); \ - a = SPH_T64(a + b + (m1 ^ c0)); \ - d = SPH_ROTR64(d ^ a, 16); \ - c = SPH_T64(c + d); \ - b = SPH_ROTR64(b ^ c, 11); \ - } while (0) - -#if SPH_COMPACT_BLAKE_64 - -#define ROUND_B(r) do { \ - GB(M[sigma[r][0x0]], M[sigma[r][0x1]], \ - CB[sigma[r][0x0]], CB[sigma[r][0x1]], V0, V4, V8, VC); \ - GB(M[sigma[r][0x2]], M[sigma[r][0x3]], \ - CB[sigma[r][0x2]], CB[sigma[r][0x3]], V1, V5, V9, VD); \ - GB(M[sigma[r][0x4]], M[sigma[r][0x5]], \ - CB[sigma[r][0x4]], CB[sigma[r][0x5]], V2, V6, VA, VE); \ - GB(M[sigma[r][0x6]], M[sigma[r][0x7]], \ - CB[sigma[r][0x6]], CB[sigma[r][0x7]], V3, V7, VB, VF); \ - GB(M[sigma[r][0x8]], M[sigma[r][0x9]], \ - CB[sigma[r][0x8]], CB[sigma[r][0x9]], V0, V5, VA, VF); \ - GB(M[sigma[r][0xA]], M[sigma[r][0xB]], \ - CB[sigma[r][0xA]], CB[sigma[r][0xB]], V1, V6, VB, VC); \ - GB(M[sigma[r][0xC]], M[sigma[r][0xD]], \ - CB[sigma[r][0xC]], CB[sigma[r][0xD]], V2, V7, V8, VD); \ - GB(M[sigma[r][0xE]], M[sigma[r][0xF]], \ - CB[sigma[r][0xE]], CB[sigma[r][0xF]], V3, V4, V9, VE); \ - } while (0) - -#else - -#define ROUND_B(r) do { \ - GB(Mx(r, 0), Mx(r, 1), CBx(r, 0), CBx(r, 1), V0, V4, V8, VC); \ - GB(Mx(r, 2), Mx(r, 3), CBx(r, 2), CBx(r, 3), V1, V5, V9, VD); \ - GB(Mx(r, 4), Mx(r, 5), CBx(r, 4), CBx(r, 5), V2, V6, VA, VE); \ - GB(Mx(r, 6), Mx(r, 7), CBx(r, 6), CBx(r, 7), V3, V7, VB, VF); \ - GB(Mx(r, 8), Mx(r, 9), CBx(r, 8), CBx(r, 9), V0, V5, VA, VF); \ - GB(Mx(r, A), Mx(r, B), CBx(r, A), CBx(r, B), V1, V6, VB, VC); \ - GB(Mx(r, C), Mx(r, D), CBx(r, C), CBx(r, D), V2, V7, V8, VD); \ - GB(Mx(r, E), Mx(r, F), CBx(r, E), CBx(r, F), V3, V4, V9, VE); \ - } while (0) - -#endif - -#endif - -#define DECL_STATE32 \ - sph_u32 H0, H1, H2, H3, H4, H5, H6, H7; \ - sph_u32 S0, S1, S2, S3, T0, T1; - -#define READ_STATE32(state) do { \ - H0 = (state)->H[0]; \ - H1 = (state)->H[1]; \ - H2 = (state)->H[2]; \ - H3 = (state)->H[3]; \ - H4 = (state)->H[4]; \ - H5 = (state)->H[5]; \ - H6 = (state)->H[6]; \ - H7 = (state)->H[7]; \ - S0 = (state)->S[0]; \ - S1 = (state)->S[1]; \ - S2 = (state)->S[2]; \ - S3 = (state)->S[3]; \ - T0 = (state)->T0; \ - T1 = (state)->T1; \ - } while (0) - -#define WRITE_STATE32(state) do { \ - (state)->H[0] = H0; \ - (state)->H[1] = H1; \ - (state)->H[2] = H2; \ - (state)->H[3] = H3; \ - (state)->H[4] = H4; \ - (state)->H[5] = H5; \ - (state)->H[6] = H6; \ - (state)->H[7] = H7; \ - (state)->S[0] = S0; \ - (state)->S[1] = S1; \ - (state)->S[2] = S2; \ - (state)->S[3] = S3; \ - (state)->T0 = T0; \ - (state)->T1 = T1; \ - } while (0) - -#if SPH_COMPACT_BLAKE_32 - -#define COMPRESS32 do { \ - sph_u32 M[16]; \ - sph_u32 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u32 V8, V9, VA, VB, VC, VD, VE, VF; \ - unsigned r; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CS0; \ - V9 = S1 ^ CS1; \ - VA = S2 ^ CS2; \ - VB = S3 ^ CS3; \ - VC = T0 ^ CS4; \ - VD = T0 ^ CS5; \ - VE = T1 ^ CS6; \ - VF = T1 ^ CS7; \ - M[0x0] = sph_dec32be_aligned(buf + 0); \ - M[0x1] = sph_dec32be_aligned(buf + 4); \ - M[0x2] = sph_dec32be_aligned(buf + 8); \ - M[0x3] = sph_dec32be_aligned(buf + 12); \ - M[0x4] = sph_dec32be_aligned(buf + 16); \ - M[0x5] = sph_dec32be_aligned(buf + 20); \ - M[0x6] = sph_dec32be_aligned(buf + 24); \ - M[0x7] = sph_dec32be_aligned(buf + 28); \ - M[0x8] = sph_dec32be_aligned(buf + 32); \ - M[0x9] = sph_dec32be_aligned(buf + 36); \ - M[0xA] = sph_dec32be_aligned(buf + 40); \ - M[0xB] = sph_dec32be_aligned(buf + 44); \ - M[0xC] = sph_dec32be_aligned(buf + 48); \ - M[0xD] = sph_dec32be_aligned(buf + 52); \ - M[0xE] = sph_dec32be_aligned(buf + 56); \ - M[0xF] = sph_dec32be_aligned(buf + 60); \ - for (r = 0; r < 14; r ++) \ - ROUND_S(r); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#else - -#define COMPRESS32 do { \ - sph_u32 M0, M1, M2, M3, M4, M5, M6, M7; \ - sph_u32 M8, M9, MA, MB, MC, MD, ME, MF; \ - sph_u32 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u32 V8, V9, VA, VB, VC, VD, VE, VF; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CS0; \ - V9 = S1 ^ CS1; \ - VA = S2 ^ CS2; \ - VB = S3 ^ CS3; \ - VC = T0 ^ CS4; \ - VD = T0 ^ CS5; \ - VE = T1 ^ CS6; \ - VF = T1 ^ CS7; \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - M8 = sph_dec32be_aligned(buf + 32); \ - M9 = sph_dec32be_aligned(buf + 36); \ - MA = sph_dec32be_aligned(buf + 40); \ - MB = sph_dec32be_aligned(buf + 44); \ - MC = sph_dec32be_aligned(buf + 48); \ - MD = sph_dec32be_aligned(buf + 52); \ - ME = sph_dec32be_aligned(buf + 56); \ - MF = sph_dec32be_aligned(buf + 60); \ - ROUND_S(0); \ - ROUND_S(1); \ - ROUND_S(2); \ - ROUND_S(3); \ - ROUND_S(4); \ - ROUND_S(5); \ - ROUND_S(6); \ - ROUND_S(7); \ - ROUND_S(8); \ - ROUND_S(9); \ - ROUND_S(0); \ - ROUND_S(1); \ - ROUND_S(2); \ - ROUND_S(3); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#endif - -#if SPH_64 - -#define DECL_STATE64 \ - sph_u64 H0, H1, H2, H3, H4, H5, H6, H7; \ - sph_u64 S0, S1, S2, S3, T0, T1; - -#define READ_STATE64(state) do { \ - H0 = (state)->H[0]; \ - H1 = (state)->H[1]; \ - H2 = (state)->H[2]; \ - H3 = (state)->H[3]; \ - H4 = (state)->H[4]; \ - H5 = (state)->H[5]; \ - H6 = (state)->H[6]; \ - H7 = (state)->H[7]; \ - S0 = (state)->S[0]; \ - S1 = (state)->S[1]; \ - S2 = (state)->S[2]; \ - S3 = (state)->S[3]; \ - T0 = (state)->T0; \ - T1 = (state)->T1; \ - } while (0) - -#define WRITE_STATE64(state) do { \ - (state)->H[0] = H0; \ - (state)->H[1] = H1; \ - (state)->H[2] = H2; \ - (state)->H[3] = H3; \ - (state)->H[4] = H4; \ - (state)->H[5] = H5; \ - (state)->H[6] = H6; \ - (state)->H[7] = H7; \ - (state)->S[0] = S0; \ - (state)->S[1] = S1; \ - (state)->S[2] = S2; \ - (state)->S[3] = S3; \ - (state)->T0 = T0; \ - (state)->T1 = T1; \ - } while (0) - -#if SPH_COMPACT_BLAKE_64 - -#define COMPRESS64 do { \ - sph_u64 M[16]; \ - sph_u64 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u64 V8, V9, VA, VB, VC, VD, VE, VF; \ - unsigned r; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CB0; \ - V9 = S1 ^ CB1; \ - VA = S2 ^ CB2; \ - VB = S3 ^ CB3; \ - VC = T0 ^ CB4; \ - VD = T0 ^ CB5; \ - VE = T1 ^ CB6; \ - VF = T1 ^ CB7; \ - M[0x0] = sph_dec64be_aligned(buf + 0); \ - M[0x1] = sph_dec64be_aligned(buf + 8); \ - M[0x2] = sph_dec64be_aligned(buf + 16); \ - M[0x3] = sph_dec64be_aligned(buf + 24); \ - M[0x4] = sph_dec64be_aligned(buf + 32); \ - M[0x5] = sph_dec64be_aligned(buf + 40); \ - M[0x6] = sph_dec64be_aligned(buf + 48); \ - M[0x7] = sph_dec64be_aligned(buf + 56); \ - M[0x8] = sph_dec64be_aligned(buf + 64); \ - M[0x9] = sph_dec64be_aligned(buf + 72); \ - M[0xA] = sph_dec64be_aligned(buf + 80); \ - M[0xB] = sph_dec64be_aligned(buf + 88); \ - M[0xC] = sph_dec64be_aligned(buf + 96); \ - M[0xD] = sph_dec64be_aligned(buf + 104); \ - M[0xE] = sph_dec64be_aligned(buf + 112); \ - M[0xF] = sph_dec64be_aligned(buf + 120); \ - for (r = 0; r < 16; r ++) \ - ROUND_B(r); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#else - -#define COMPRESS64 do { \ - sph_u64 M0, M1, M2, M3, M4, M5, M6, M7; \ - sph_u64 M8, M9, MA, MB, MC, MD, ME, MF; \ - sph_u64 V0, V1, V2, V3, V4, V5, V6, V7; \ - sph_u64 V8, V9, VA, VB, VC, VD, VE, VF; \ - V0 = H0; \ - V1 = H1; \ - V2 = H2; \ - V3 = H3; \ - V4 = H4; \ - V5 = H5; \ - V6 = H6; \ - V7 = H7; \ - V8 = S0 ^ CB0; \ - V9 = S1 ^ CB1; \ - VA = S2 ^ CB2; \ - VB = S3 ^ CB3; \ - VC = T0 ^ CB4; \ - VD = T0 ^ CB5; \ - VE = T1 ^ CB6; \ - VF = T1 ^ CB7; \ - M0 = sph_dec64be_aligned(buf + 0); \ - M1 = sph_dec64be_aligned(buf + 8); \ - M2 = sph_dec64be_aligned(buf + 16); \ - M3 = sph_dec64be_aligned(buf + 24); \ - M4 = sph_dec64be_aligned(buf + 32); \ - M5 = sph_dec64be_aligned(buf + 40); \ - M6 = sph_dec64be_aligned(buf + 48); \ - M7 = sph_dec64be_aligned(buf + 56); \ - M8 = sph_dec64be_aligned(buf + 64); \ - M9 = sph_dec64be_aligned(buf + 72); \ - MA = sph_dec64be_aligned(buf + 80); \ - MB = sph_dec64be_aligned(buf + 88); \ - MC = sph_dec64be_aligned(buf + 96); \ - MD = sph_dec64be_aligned(buf + 104); \ - ME = sph_dec64be_aligned(buf + 112); \ - MF = sph_dec64be_aligned(buf + 120); \ - ROUND_B(0); \ - ROUND_B(1); \ - ROUND_B(2); \ - ROUND_B(3); \ - ROUND_B(4); \ - ROUND_B(5); \ - ROUND_B(6); \ - ROUND_B(7); \ - ROUND_B(8); \ - ROUND_B(9); \ - ROUND_B(0); \ - ROUND_B(1); \ - ROUND_B(2); \ - ROUND_B(3); \ - ROUND_B(4); \ - ROUND_B(5); \ - H0 ^= S0 ^ V0 ^ V8; \ - H1 ^= S1 ^ V1 ^ V9; \ - H2 ^= S2 ^ V2 ^ VA; \ - H3 ^= S3 ^ V3 ^ VB; \ - H4 ^= S0 ^ V4 ^ VC; \ - H5 ^= S1 ^ V5 ^ VD; \ - H6 ^= S2 ^ V6 ^ VE; \ - H7 ^= S3 ^ V7 ^ VF; \ - } while (0) - -#endif - -#endif - -static const sph_u32 salt_zero_small[4] = { 0, 0, 0, 0 }; - -static void -blake32_init(sph_blake_small_context *sc, - const sph_u32 *iv, const sph_u32 *salt) -{ - memcpy(sc->H, iv, 8 * sizeof(sph_u32)); - memcpy(sc->S, salt, 4 * sizeof(sph_u32)); - sc->T0 = sc->T1 = 0; - sc->ptr = 0; -} - -static void -blake32(sph_blake_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE32 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE32(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((T0 = SPH_T32(T0 + 512)) < 512) - T1 = SPH_T32(T1 + 1); - COMPRESS32; - ptr = 0; - } - } - WRITE_STATE32(sc); - sc->ptr = ptr; -} - -static void -blake32_close(sph_blake_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - union { - unsigned char buf[64]; - sph_u32 dummy; - } u; - size_t ptr, k; - unsigned bit_len; - unsigned z; - sph_u32 th, tl; - unsigned char *out; - - ptr = sc->ptr; - bit_len = ((unsigned)ptr << 3) + n; - z = 0x80 >> n; - u.buf[ptr] = ((ub & -z) | z) & 0xFF; - tl = sc->T0 + bit_len; - th = sc->T1; - if (ptr == 0 && n == 0) { - sc->T0 = SPH_C32(0xFFFFFE00); - sc->T1 = SPH_C32(0xFFFFFFFF); - } else if (sc->T0 == 0) { - sc->T0 = SPH_C32(0xFFFFFE00) + bit_len; - sc->T1 = SPH_T32(sc->T1 - 1); - } else { - sc->T0 -= 512 - bit_len; - } - if (bit_len <= 446) { - memset(u.buf + ptr + 1, 0, 55 - ptr); - if (out_size_w32 == 8) - u.buf[55] |= 1; - sph_enc32be_aligned(u.buf + 56, th); - sph_enc32be_aligned(u.buf + 60, tl); - blake32(sc, u.buf + ptr, 64 - ptr); - } else { - memset(u.buf + ptr + 1, 0, 63 - ptr); - blake32(sc, u.buf + ptr, 64 - ptr); - sc->T0 = SPH_C32(0xFFFFFE00); - sc->T1 = SPH_C32(0xFFFFFFFF); - memset(u.buf, 0, 56); - if (out_size_w32 == 8) - u.buf[55] = 1; - sph_enc32be_aligned(u.buf + 56, th); - sph_enc32be_aligned(u.buf + 60, tl); - blake32(sc, u.buf, 64); - } - out = dst; - for (k = 0; k < out_size_w32; k ++) - sph_enc32be(out + (k << 2), sc->H[k]); -} - -#if SPH_64 - -static const sph_u64 salt_zero_big[4] = { 0, 0, 0, 0 }; - -static void -blake64_init(sph_blake_big_context *sc, - const sph_u64 *iv, const sph_u64 *salt) -{ - memcpy(sc->H, iv, 8 * sizeof(sph_u64)); - memcpy(sc->S, salt, 4 * sizeof(sph_u64)); - sc->T0 = sc->T1 = 0; - sc->ptr = 0; -} - -static void -blake64(sph_blake_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE64 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE64(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((T0 = SPH_T64(T0 + 1024)) < 1024) - T1 = SPH_T64(T1 + 1); - COMPRESS64; - ptr = 0; - } - } - WRITE_STATE64(sc); - sc->ptr = ptr; -} - -static void -blake64_close(sph_blake_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w64) -{ - union { - unsigned char buf[128]; - sph_u64 dummy; - } u; - size_t ptr, k; - unsigned bit_len; - unsigned z; - sph_u64 th, tl; - unsigned char *out; - - ptr = sc->ptr; - bit_len = ((unsigned)ptr << 3) + n; - z = 0x80 >> n; - u.buf[ptr] = ((ub & -z) | z) & 0xFF; - tl = sc->T0 + bit_len; - th = sc->T1; - if (ptr == 0 && n == 0) { - sc->T0 = SPH_C64(0xFFFFFFFFFFFFFC00); - sc->T1 = SPH_C64(0xFFFFFFFFFFFFFFFF); - } else if (sc->T0 == 0) { - sc->T0 = SPH_C64(0xFFFFFFFFFFFFFC00) + bit_len; - sc->T1 = SPH_T64(sc->T1 - 1); - } else { - sc->T0 -= 1024 - bit_len; - } - if (bit_len <= 894) { - memset(u.buf + ptr + 1, 0, 111 - ptr); - if (out_size_w64 == 8) - u.buf[111] |= 1; - sph_enc64be_aligned(u.buf + 112, th); - sph_enc64be_aligned(u.buf + 120, tl); - blake64(sc, u.buf + ptr, 128 - ptr); - } else { - memset(u.buf + ptr + 1, 0, 127 - ptr); - blake64(sc, u.buf + ptr, 128 - ptr); - sc->T0 = SPH_C64(0xFFFFFFFFFFFFFC00); - sc->T1 = SPH_C64(0xFFFFFFFFFFFFFFFF); - memset(u.buf, 0, 112); - if (out_size_w64 == 8) - u.buf[111] = 1; - sph_enc64be_aligned(u.buf + 112, th); - sph_enc64be_aligned(u.buf + 120, tl); - blake64(sc, u.buf, 128); - } - out = dst; - for (k = 0; k < out_size_w64; k ++) - sph_enc64be(out + (k << 3), sc->H[k]); -} - -#endif - -/* see sph_blake.h */ -void -sph_blake224_init(void *cc) -{ - blake32_init(cc, IV224, salt_zero_small); -} - -/* see sph_blake.h */ -void -sph_blake224(void *cc, const void *data, size_t len) -{ - blake32(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake224_close(void *cc, void *dst) -{ - sph_blake224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake32_close(cc, ub, n, dst, 7); - sph_blake224_init(cc); -} - -/* see sph_blake.h */ -void -sph_blake256_init(void *cc) -{ - blake32_init(cc, IV256, salt_zero_small); -} - -/* see sph_blake.h */ -void -sph_blake256(void *cc, const void *data, size_t len) -{ - blake32(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake256_close(void *cc, void *dst) -{ - sph_blake256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake32_close(cc, ub, n, dst, 8); - sph_blake256_init(cc); -} - -#if SPH_64 - -/* see sph_blake.h */ -void -sph_blake384_init(void *cc) -{ - blake64_init(cc, IV384, salt_zero_big); -} - -/* see sph_blake.h */ -void -sph_blake384(void *cc, const void *data, size_t len) -{ - blake64(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake384_close(void *cc, void *dst) -{ - sph_blake384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake64_close(cc, ub, n, dst, 6); - sph_blake384_init(cc); -} - -/* see sph_blake.h */ -void -sph_blake512_init(void *cc) -{ - blake64_init(cc, IV512, salt_zero_big); -} - -/* see sph_blake.h */ -void -sph_blake512(void *cc, const void *data, size_t len) -{ - blake64(cc, data, len); -} - -/* see sph_blake.h */ -void -sph_blake512_close(void *cc, void *dst) -{ - sph_blake512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_blake.h */ -void -sph_blake512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - blake64_close(cc, ub, n, dst, 8); - sph_blake512_init(cc); -} - -#endif - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/bmw.c b/src/crypto/bmw.c deleted file mode 100644 index b89a881e8..000000000 --- a/src/crypto/bmw.c +++ /dev/null @@ -1,965 +0,0 @@ -/* $Id: bmw.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * BMW implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#ifdef __cplusplus -extern "C"{ -#endif - -#include "sph_bmw.h" - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_BMW -#define SPH_SMALL_FOOTPRINT_BMW 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[] = { - SPH_C32(0x00010203), SPH_C32(0x04050607), - SPH_C32(0x08090A0B), SPH_C32(0x0C0D0E0F), - SPH_C32(0x10111213), SPH_C32(0x14151617), - SPH_C32(0x18191A1B), SPH_C32(0x1C1D1E1F), - SPH_C32(0x20212223), SPH_C32(0x24252627), - SPH_C32(0x28292A2B), SPH_C32(0x2C2D2E2F), - SPH_C32(0x30313233), SPH_C32(0x34353637), - SPH_C32(0x38393A3B), SPH_C32(0x3C3D3E3F) -}; - -static const sph_u32 IV256[] = { - SPH_C32(0x40414243), SPH_C32(0x44454647), - SPH_C32(0x48494A4B), SPH_C32(0x4C4D4E4F), - SPH_C32(0x50515253), SPH_C32(0x54555657), - SPH_C32(0x58595A5B), SPH_C32(0x5C5D5E5F), - SPH_C32(0x60616263), SPH_C32(0x64656667), - SPH_C32(0x68696A6B), SPH_C32(0x6C6D6E6F), - SPH_C32(0x70717273), SPH_C32(0x74757677), - SPH_C32(0x78797A7B), SPH_C32(0x7C7D7E7F) -}; - -#if SPH_64 - -static const sph_u64 IV384[] = { - SPH_C64(0x0001020304050607), SPH_C64(0x08090A0B0C0D0E0F), - SPH_C64(0x1011121314151617), SPH_C64(0x18191A1B1C1D1E1F), - SPH_C64(0x2021222324252627), SPH_C64(0x28292A2B2C2D2E2F), - SPH_C64(0x3031323334353637), SPH_C64(0x38393A3B3C3D3E3F), - SPH_C64(0x4041424344454647), SPH_C64(0x48494A4B4C4D4E4F), - SPH_C64(0x5051525354555657), SPH_C64(0x58595A5B5C5D5E5F), - SPH_C64(0x6061626364656667), SPH_C64(0x68696A6B6C6D6E6F), - SPH_C64(0x7071727374757677), SPH_C64(0x78797A7B7C7D7E7F) -}; - -static const sph_u64 IV512[] = { - SPH_C64(0x8081828384858687), SPH_C64(0x88898A8B8C8D8E8F), - SPH_C64(0x9091929394959697), SPH_C64(0x98999A9B9C9D9E9F), - SPH_C64(0xA0A1A2A3A4A5A6A7), SPH_C64(0xA8A9AAABACADAEAF), - SPH_C64(0xB0B1B2B3B4B5B6B7), SPH_C64(0xB8B9BABBBCBDBEBF), - SPH_C64(0xC0C1C2C3C4C5C6C7), SPH_C64(0xC8C9CACBCCCDCECF), - SPH_C64(0xD0D1D2D3D4D5D6D7), SPH_C64(0xD8D9DADBDCDDDEDF), - SPH_C64(0xE0E1E2E3E4E5E6E7), SPH_C64(0xE8E9EAEBECEDEEEF), - SPH_C64(0xF0F1F2F3F4F5F6F7), SPH_C64(0xF8F9FAFBFCFDFEFF) -}; - -#endif - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define LPAR ( - -#define I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -#define I16_17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 -#define I16_18 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 -#define I16_19 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -#define I16_20 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 -#define I16_21 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 -#define I16_22 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 -#define I16_23 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 -#define I16_24 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 -#define I16_25 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 -#define I16_26 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 -#define I16_27 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -#define I16_28 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 -#define I16_29 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 -#define I16_30 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 -#define I16_31 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 - -#define M16_16 0, 1, 3, 4, 7, 10, 11 -#define M16_17 1, 2, 4, 5, 8, 11, 12 -#define M16_18 2, 3, 5, 6, 9, 12, 13 -#define M16_19 3, 4, 6, 7, 10, 13, 14 -#define M16_20 4, 5, 7, 8, 11, 14, 15 -#define M16_21 5, 6, 8, 9, 12, 15, 16 -#define M16_22 6, 7, 9, 10, 13, 0, 1 -#define M16_23 7, 8, 10, 11, 14, 1, 2 -#define M16_24 8, 9, 11, 12, 15, 2, 3 -#define M16_25 9, 10, 12, 13, 0, 3, 4 -#define M16_26 10, 11, 13, 14, 1, 4, 5 -#define M16_27 11, 12, 14, 15, 2, 5, 6 -#define M16_28 12, 13, 15, 16, 3, 6, 7 -#define M16_29 13, 14, 0, 1, 4, 7, 8 -#define M16_30 14, 15, 1, 2, 5, 8, 9 -#define M16_31 15, 16, 2, 3, 6, 9, 10 - -#define ss0(x) (((x) >> 1) ^ SPH_T32((x) << 3) \ - ^ SPH_ROTL32(x, 4) ^ SPH_ROTL32(x, 19)) -#define ss1(x) (((x) >> 1) ^ SPH_T32((x) << 2) \ - ^ SPH_ROTL32(x, 8) ^ SPH_ROTL32(x, 23)) -#define ss2(x) (((x) >> 2) ^ SPH_T32((x) << 1) \ - ^ SPH_ROTL32(x, 12) ^ SPH_ROTL32(x, 25)) -#define ss3(x) (((x) >> 2) ^ SPH_T32((x) << 2) \ - ^ SPH_ROTL32(x, 15) ^ SPH_ROTL32(x, 29)) -#define ss4(x) (((x) >> 1) ^ (x)) -#define ss5(x) (((x) >> 2) ^ (x)) -#define rs1(x) SPH_ROTL32(x, 3) -#define rs2(x) SPH_ROTL32(x, 7) -#define rs3(x) SPH_ROTL32(x, 13) -#define rs4(x) SPH_ROTL32(x, 16) -#define rs5(x) SPH_ROTL32(x, 19) -#define rs6(x) SPH_ROTL32(x, 23) -#define rs7(x) SPH_ROTL32(x, 27) - -#define Ks(j) SPH_T32((sph_u32)(j) * SPH_C32(0x05555555)) - -#define add_elt_s(mf, hf, j0m, j1m, j3m, j4m, j7m, j10m, j11m, j16) \ - (SPH_T32(SPH_ROTL32(mf(j0m), j1m) + SPH_ROTL32(mf(j3m), j4m) \ - - SPH_ROTL32(mf(j10m), j11m) + Ks(j16)) ^ hf(j7m)) - -#define expand1s_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T32(ss1(qf(i0)) + ss2(qf(i1)) + ss3(qf(i2)) + ss0(qf(i3)) \ - + ss1(qf(i4)) + ss2(qf(i5)) + ss3(qf(i6)) + ss0(qf(i7)) \ - + ss1(qf(i8)) + ss2(qf(i9)) + ss3(qf(i10)) + ss0(qf(i11)) \ - + ss1(qf(i12)) + ss2(qf(i13)) + ss3(qf(i14)) + ss0(qf(i15)) \ - + add_elt_s(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand1s(qf, mf, hf, i16) \ - expand1s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand1s_(qf, mf, hf, i16, ix, iy) \ - expand1s_inner LPAR qf, mf, hf, i16, ix, iy) - -#define expand2s_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T32(qf(i0) + rs1(qf(i1)) + qf(i2) + rs2(qf(i3)) \ - + qf(i4) + rs3(qf(i5)) + qf(i6) + rs4(qf(i7)) \ - + qf(i8) + rs5(qf(i9)) + qf(i10) + rs6(qf(i11)) \ - + qf(i12) + rs7(qf(i13)) + ss4(qf(i14)) + ss5(qf(i15)) \ - + add_elt_s(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand2s(qf, mf, hf, i16) \ - expand2s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand2s_(qf, mf, hf, i16, ix, iy) \ - expand2s_inner LPAR qf, mf, hf, i16, ix, iy) - -#if SPH_64 - -#define sb0(x) (((x) >> 1) ^ SPH_T64((x) << 3) \ - ^ SPH_ROTL64(x, 4) ^ SPH_ROTL64(x, 37)) -#define sb1(x) (((x) >> 1) ^ SPH_T64((x) << 2) \ - ^ SPH_ROTL64(x, 13) ^ SPH_ROTL64(x, 43)) -#define sb2(x) (((x) >> 2) ^ SPH_T64((x) << 1) \ - ^ SPH_ROTL64(x, 19) ^ SPH_ROTL64(x, 53)) -#define sb3(x) (((x) >> 2) ^ SPH_T64((x) << 2) \ - ^ SPH_ROTL64(x, 28) ^ SPH_ROTL64(x, 59)) -#define sb4(x) (((x) >> 1) ^ (x)) -#define sb5(x) (((x) >> 2) ^ (x)) -#define rb1(x) SPH_ROTL64(x, 5) -#define rb2(x) SPH_ROTL64(x, 11) -#define rb3(x) SPH_ROTL64(x, 27) -#define rb4(x) SPH_ROTL64(x, 32) -#define rb5(x) SPH_ROTL64(x, 37) -#define rb6(x) SPH_ROTL64(x, 43) -#define rb7(x) SPH_ROTL64(x, 53) - -#define Kb(j) SPH_T64((sph_u64)(j) * SPH_C64(0x0555555555555555)) - -#if SPH_SMALL_FOOTPRINT_BMW - -static const sph_u64 Kb_tab[] = { - Kb(16), Kb(17), Kb(18), Kb(19), Kb(20), Kb(21), Kb(22), Kb(23), - Kb(24), Kb(25), Kb(26), Kb(27), Kb(28), Kb(29), Kb(30), Kb(31) -}; - -#define rol_off(mf, j, off) \ - SPH_ROTL64(mf(((j) + (off)) & 15), (((j) + (off)) & 15) + 1) - -#define add_elt_b(mf, hf, j) \ - (SPH_T64(rol_off(mf, j, 0) + rol_off(mf, j, 3) \ - - rol_off(mf, j, 10) + Kb_tab[j]) ^ hf(((j) + 7) & 15)) - -#define expand1b(qf, mf, hf, i) \ - SPH_T64(sb1(qf((i) - 16)) + sb2(qf((i) - 15)) \ - + sb3(qf((i) - 14)) + sb0(qf((i) - 13)) \ - + sb1(qf((i) - 12)) + sb2(qf((i) - 11)) \ - + sb3(qf((i) - 10)) + sb0(qf((i) - 9)) \ - + sb1(qf((i) - 8)) + sb2(qf((i) - 7)) \ - + sb3(qf((i) - 6)) + sb0(qf((i) - 5)) \ - + sb1(qf((i) - 4)) + sb2(qf((i) - 3)) \ - + sb3(qf((i) - 2)) + sb0(qf((i) - 1)) \ - + add_elt_b(mf, hf, (i) - 16)) - -#define expand2b(qf, mf, hf, i) \ - SPH_T64(qf((i) - 16) + rb1(qf((i) - 15)) \ - + qf((i) - 14) + rb2(qf((i) - 13)) \ - + qf((i) - 12) + rb3(qf((i) - 11)) \ - + qf((i) - 10) + rb4(qf((i) - 9)) \ - + qf((i) - 8) + rb5(qf((i) - 7)) \ - + qf((i) - 6) + rb6(qf((i) - 5)) \ - + qf((i) - 4) + rb7(qf((i) - 3)) \ - + sb4(qf((i) - 2)) + sb5(qf((i) - 1)) \ - + add_elt_b(mf, hf, (i) - 16)) - -#else - -#define add_elt_b(mf, hf, j0m, j1m, j3m, j4m, j7m, j10m, j11m, j16) \ - (SPH_T64(SPH_ROTL64(mf(j0m), j1m) + SPH_ROTL64(mf(j3m), j4m) \ - - SPH_ROTL64(mf(j10m), j11m) + Kb(j16)) ^ hf(j7m)) - -#define expand1b_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T64(sb1(qf(i0)) + sb2(qf(i1)) + sb3(qf(i2)) + sb0(qf(i3)) \ - + sb1(qf(i4)) + sb2(qf(i5)) + sb3(qf(i6)) + sb0(qf(i7)) \ - + sb1(qf(i8)) + sb2(qf(i9)) + sb3(qf(i10)) + sb0(qf(i11)) \ - + sb1(qf(i12)) + sb2(qf(i13)) + sb3(qf(i14)) + sb0(qf(i15)) \ - + add_elt_b(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand1b(qf, mf, hf, i16) \ - expand1b_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand1b_(qf, mf, hf, i16, ix, iy) \ - expand1b_inner LPAR qf, mf, hf, i16, ix, iy) - -#define expand2b_inner(qf, mf, hf, i16, \ - i0, i1, i2, i3, i4, i5, i6, i7, i8, \ - i9, i10, i11, i12, i13, i14, i15, \ - i0m, i1m, i3m, i4m, i7m, i10m, i11m) \ - SPH_T64(qf(i0) + rb1(qf(i1)) + qf(i2) + rb2(qf(i3)) \ - + qf(i4) + rb3(qf(i5)) + qf(i6) + rb4(qf(i7)) \ - + qf(i8) + rb5(qf(i9)) + qf(i10) + rb6(qf(i11)) \ - + qf(i12) + rb7(qf(i13)) + sb4(qf(i14)) + sb5(qf(i15)) \ - + add_elt_b(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16)) - -#define expand2b(qf, mf, hf, i16) \ - expand2b_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16) -#define expand2b_(qf, mf, hf, i16, ix, iy) \ - expand2b_inner LPAR qf, mf, hf, i16, ix, iy) - -#endif - -#endif - -#define MAKE_W(tt, i0, op01, i1, op12, i2, op23, i3, op34, i4) \ - tt((M(i0) ^ H(i0)) op01 (M(i1) ^ H(i1)) op12 (M(i2) ^ H(i2)) \ - op23 (M(i3) ^ H(i3)) op34 (M(i4) ^ H(i4))) - -#define Ws0 MAKE_W(SPH_T32, 5, -, 7, +, 10, +, 13, +, 14) -#define Ws1 MAKE_W(SPH_T32, 6, -, 8, +, 11, +, 14, -, 15) -#define Ws2 MAKE_W(SPH_T32, 0, +, 7, +, 9, -, 12, +, 15) -#define Ws3 MAKE_W(SPH_T32, 0, -, 1, +, 8, -, 10, +, 13) -#define Ws4 MAKE_W(SPH_T32, 1, +, 2, +, 9, -, 11, -, 14) -#define Ws5 MAKE_W(SPH_T32, 3, -, 2, +, 10, -, 12, +, 15) -#define Ws6 MAKE_W(SPH_T32, 4, -, 0, -, 3, -, 11, +, 13) -#define Ws7 MAKE_W(SPH_T32, 1, -, 4, -, 5, -, 12, -, 14) -#define Ws8 MAKE_W(SPH_T32, 2, -, 5, -, 6, +, 13, -, 15) -#define Ws9 MAKE_W(SPH_T32, 0, -, 3, +, 6, -, 7, +, 14) -#define Ws10 MAKE_W(SPH_T32, 8, -, 1, -, 4, -, 7, +, 15) -#define Ws11 MAKE_W(SPH_T32, 8, -, 0, -, 2, -, 5, +, 9) -#define Ws12 MAKE_W(SPH_T32, 1, +, 3, -, 6, -, 9, +, 10) -#define Ws13 MAKE_W(SPH_T32, 2, +, 4, +, 7, +, 10, +, 11) -#define Ws14 MAKE_W(SPH_T32, 3, -, 5, +, 8, -, 11, -, 12) -#define Ws15 MAKE_W(SPH_T32, 12, -, 4, -, 6, -, 9, +, 13) - -#if SPH_SMALL_FOOTPRINT_BMW - -#define MAKE_Qas do { \ - unsigned u; \ - sph_u32 Ws[16]; \ - Ws[ 0] = Ws0; \ - Ws[ 1] = Ws1; \ - Ws[ 2] = Ws2; \ - Ws[ 3] = Ws3; \ - Ws[ 4] = Ws4; \ - Ws[ 5] = Ws5; \ - Ws[ 6] = Ws6; \ - Ws[ 7] = Ws7; \ - Ws[ 8] = Ws8; \ - Ws[ 9] = Ws9; \ - Ws[10] = Ws10; \ - Ws[11] = Ws11; \ - Ws[12] = Ws12; \ - Ws[13] = Ws13; \ - Ws[14] = Ws14; \ - Ws[15] = Ws15; \ - for (u = 0; u < 15; u += 5) { \ - qt[u + 0] = SPH_T32(ss0(Ws[u + 0]) + H(u + 1)); \ - qt[u + 1] = SPH_T32(ss1(Ws[u + 1]) + H(u + 2)); \ - qt[u + 2] = SPH_T32(ss2(Ws[u + 2]) + H(u + 3)); \ - qt[u + 3] = SPH_T32(ss3(Ws[u + 3]) + H(u + 4)); \ - qt[u + 4] = SPH_T32(ss4(Ws[u + 4]) + H(u + 5)); \ - } \ - qt[15] = SPH_T32(ss0(Ws[15]) + H(0)); \ - } while (0) - -#define MAKE_Qbs do { \ - qt[16] = expand1s(Qs, M, H, 16); \ - qt[17] = expand1s(Qs, M, H, 17); \ - qt[18] = expand2s(Qs, M, H, 18); \ - qt[19] = expand2s(Qs, M, H, 19); \ - qt[20] = expand2s(Qs, M, H, 20); \ - qt[21] = expand2s(Qs, M, H, 21); \ - qt[22] = expand2s(Qs, M, H, 22); \ - qt[23] = expand2s(Qs, M, H, 23); \ - qt[24] = expand2s(Qs, M, H, 24); \ - qt[25] = expand2s(Qs, M, H, 25); \ - qt[26] = expand2s(Qs, M, H, 26); \ - qt[27] = expand2s(Qs, M, H, 27); \ - qt[28] = expand2s(Qs, M, H, 28); \ - qt[29] = expand2s(Qs, M, H, 29); \ - qt[30] = expand2s(Qs, M, H, 30); \ - qt[31] = expand2s(Qs, M, H, 31); \ - } while (0) - -#else - -#define MAKE_Qas do { \ - qt[ 0] = SPH_T32(ss0(Ws0 ) + H( 1)); \ - qt[ 1] = SPH_T32(ss1(Ws1 ) + H( 2)); \ - qt[ 2] = SPH_T32(ss2(Ws2 ) + H( 3)); \ - qt[ 3] = SPH_T32(ss3(Ws3 ) + H( 4)); \ - qt[ 4] = SPH_T32(ss4(Ws4 ) + H( 5)); \ - qt[ 5] = SPH_T32(ss0(Ws5 ) + H( 6)); \ - qt[ 6] = SPH_T32(ss1(Ws6 ) + H( 7)); \ - qt[ 7] = SPH_T32(ss2(Ws7 ) + H( 8)); \ - qt[ 8] = SPH_T32(ss3(Ws8 ) + H( 9)); \ - qt[ 9] = SPH_T32(ss4(Ws9 ) + H(10)); \ - qt[10] = SPH_T32(ss0(Ws10) + H(11)); \ - qt[11] = SPH_T32(ss1(Ws11) + H(12)); \ - qt[12] = SPH_T32(ss2(Ws12) + H(13)); \ - qt[13] = SPH_T32(ss3(Ws13) + H(14)); \ - qt[14] = SPH_T32(ss4(Ws14) + H(15)); \ - qt[15] = SPH_T32(ss0(Ws15) + H( 0)); \ - } while (0) - -#define MAKE_Qbs do { \ - qt[16] = expand1s(Qs, M, H, 16); \ - qt[17] = expand1s(Qs, M, H, 17); \ - qt[18] = expand2s(Qs, M, H, 18); \ - qt[19] = expand2s(Qs, M, H, 19); \ - qt[20] = expand2s(Qs, M, H, 20); \ - qt[21] = expand2s(Qs, M, H, 21); \ - qt[22] = expand2s(Qs, M, H, 22); \ - qt[23] = expand2s(Qs, M, H, 23); \ - qt[24] = expand2s(Qs, M, H, 24); \ - qt[25] = expand2s(Qs, M, H, 25); \ - qt[26] = expand2s(Qs, M, H, 26); \ - qt[27] = expand2s(Qs, M, H, 27); \ - qt[28] = expand2s(Qs, M, H, 28); \ - qt[29] = expand2s(Qs, M, H, 29); \ - qt[30] = expand2s(Qs, M, H, 30); \ - qt[31] = expand2s(Qs, M, H, 31); \ - } while (0) - -#endif - -#define MAKE_Qs do { \ - MAKE_Qas; \ - MAKE_Qbs; \ - } while (0) - -#define Qs(j) (qt[j]) - -#if SPH_64 - -#define Wb0 MAKE_W(SPH_T64, 5, -, 7, +, 10, +, 13, +, 14) -#define Wb1 MAKE_W(SPH_T64, 6, -, 8, +, 11, +, 14, -, 15) -#define Wb2 MAKE_W(SPH_T64, 0, +, 7, +, 9, -, 12, +, 15) -#define Wb3 MAKE_W(SPH_T64, 0, -, 1, +, 8, -, 10, +, 13) -#define Wb4 MAKE_W(SPH_T64, 1, +, 2, +, 9, -, 11, -, 14) -#define Wb5 MAKE_W(SPH_T64, 3, -, 2, +, 10, -, 12, +, 15) -#define Wb6 MAKE_W(SPH_T64, 4, -, 0, -, 3, -, 11, +, 13) -#define Wb7 MAKE_W(SPH_T64, 1, -, 4, -, 5, -, 12, -, 14) -#define Wb8 MAKE_W(SPH_T64, 2, -, 5, -, 6, +, 13, -, 15) -#define Wb9 MAKE_W(SPH_T64, 0, -, 3, +, 6, -, 7, +, 14) -#define Wb10 MAKE_W(SPH_T64, 8, -, 1, -, 4, -, 7, +, 15) -#define Wb11 MAKE_W(SPH_T64, 8, -, 0, -, 2, -, 5, +, 9) -#define Wb12 MAKE_W(SPH_T64, 1, +, 3, -, 6, -, 9, +, 10) -#define Wb13 MAKE_W(SPH_T64, 2, +, 4, +, 7, +, 10, +, 11) -#define Wb14 MAKE_W(SPH_T64, 3, -, 5, +, 8, -, 11, -, 12) -#define Wb15 MAKE_W(SPH_T64, 12, -, 4, -, 6, -, 9, +, 13) - -#if SPH_SMALL_FOOTPRINT_BMW - -#define MAKE_Qab do { \ - unsigned u; \ - sph_u64 Wb[16]; \ - Wb[ 0] = Wb0; \ - Wb[ 1] = Wb1; \ - Wb[ 2] = Wb2; \ - Wb[ 3] = Wb3; \ - Wb[ 4] = Wb4; \ - Wb[ 5] = Wb5; \ - Wb[ 6] = Wb6; \ - Wb[ 7] = Wb7; \ - Wb[ 8] = Wb8; \ - Wb[ 9] = Wb9; \ - Wb[10] = Wb10; \ - Wb[11] = Wb11; \ - Wb[12] = Wb12; \ - Wb[13] = Wb13; \ - Wb[14] = Wb14; \ - Wb[15] = Wb15; \ - for (u = 0; u < 15; u += 5) { \ - qt[u + 0] = SPH_T64(sb0(Wb[u + 0]) + H(u + 1)); \ - qt[u + 1] = SPH_T64(sb1(Wb[u + 1]) + H(u + 2)); \ - qt[u + 2] = SPH_T64(sb2(Wb[u + 2]) + H(u + 3)); \ - qt[u + 3] = SPH_T64(sb3(Wb[u + 3]) + H(u + 4)); \ - qt[u + 4] = SPH_T64(sb4(Wb[u + 4]) + H(u + 5)); \ - } \ - qt[15] = SPH_T64(sb0(Wb[15]) + H(0)); \ - } while (0) - -#define MAKE_Qbb do { \ - unsigned u; \ - for (u = 16; u < 18; u ++) \ - qt[u] = expand1b(Qb, M, H, u); \ - for (u = 18; u < 32; u ++) \ - qt[u] = expand2b(Qb, M, H, u); \ - } while (0) - -#else - -#define MAKE_Qab do { \ - qt[ 0] = SPH_T64(sb0(Wb0 ) + H( 1)); \ - qt[ 1] = SPH_T64(sb1(Wb1 ) + H( 2)); \ - qt[ 2] = SPH_T64(sb2(Wb2 ) + H( 3)); \ - qt[ 3] = SPH_T64(sb3(Wb3 ) + H( 4)); \ - qt[ 4] = SPH_T64(sb4(Wb4 ) + H( 5)); \ - qt[ 5] = SPH_T64(sb0(Wb5 ) + H( 6)); \ - qt[ 6] = SPH_T64(sb1(Wb6 ) + H( 7)); \ - qt[ 7] = SPH_T64(sb2(Wb7 ) + H( 8)); \ - qt[ 8] = SPH_T64(sb3(Wb8 ) + H( 9)); \ - qt[ 9] = SPH_T64(sb4(Wb9 ) + H(10)); \ - qt[10] = SPH_T64(sb0(Wb10) + H(11)); \ - qt[11] = SPH_T64(sb1(Wb11) + H(12)); \ - qt[12] = SPH_T64(sb2(Wb12) + H(13)); \ - qt[13] = SPH_T64(sb3(Wb13) + H(14)); \ - qt[14] = SPH_T64(sb4(Wb14) + H(15)); \ - qt[15] = SPH_T64(sb0(Wb15) + H( 0)); \ - } while (0) - -#define MAKE_Qbb do { \ - qt[16] = expand1b(Qb, M, H, 16); \ - qt[17] = expand1b(Qb, M, H, 17); \ - qt[18] = expand2b(Qb, M, H, 18); \ - qt[19] = expand2b(Qb, M, H, 19); \ - qt[20] = expand2b(Qb, M, H, 20); \ - qt[21] = expand2b(Qb, M, H, 21); \ - qt[22] = expand2b(Qb, M, H, 22); \ - qt[23] = expand2b(Qb, M, H, 23); \ - qt[24] = expand2b(Qb, M, H, 24); \ - qt[25] = expand2b(Qb, M, H, 25); \ - qt[26] = expand2b(Qb, M, H, 26); \ - qt[27] = expand2b(Qb, M, H, 27); \ - qt[28] = expand2b(Qb, M, H, 28); \ - qt[29] = expand2b(Qb, M, H, 29); \ - qt[30] = expand2b(Qb, M, H, 30); \ - qt[31] = expand2b(Qb, M, H, 31); \ - } while (0) - -#endif - -#define MAKE_Qb do { \ - MAKE_Qab; \ - MAKE_Qbb; \ - } while (0) - -#define Qb(j) (qt[j]) - -#endif - -#define FOLD(type, mkQ, tt, rol, mf, qf, dhf) do { \ - type qt[32], xl, xh; \ - mkQ; \ - xl = qf(16) ^ qf(17) ^ qf(18) ^ qf(19) \ - ^ qf(20) ^ qf(21) ^ qf(22) ^ qf(23); \ - xh = xl ^ qf(24) ^ qf(25) ^ qf(26) ^ qf(27) \ - ^ qf(28) ^ qf(29) ^ qf(30) ^ qf(31); \ - dhf( 0) = tt(((xh << 5) ^ (qf(16) >> 5) ^ mf( 0)) \ - + (xl ^ qf(24) ^ qf( 0))); \ - dhf( 1) = tt(((xh >> 7) ^ (qf(17) << 8) ^ mf( 1)) \ - + (xl ^ qf(25) ^ qf( 1))); \ - dhf( 2) = tt(((xh >> 5) ^ (qf(18) << 5) ^ mf( 2)) \ - + (xl ^ qf(26) ^ qf( 2))); \ - dhf( 3) = tt(((xh >> 1) ^ (qf(19) << 5) ^ mf( 3)) \ - + (xl ^ qf(27) ^ qf( 3))); \ - dhf( 4) = tt(((xh >> 3) ^ (qf(20) << 0) ^ mf( 4)) \ - + (xl ^ qf(28) ^ qf( 4))); \ - dhf( 5) = tt(((xh << 6) ^ (qf(21) >> 6) ^ mf( 5)) \ - + (xl ^ qf(29) ^ qf( 5))); \ - dhf( 6) = tt(((xh >> 4) ^ (qf(22) << 6) ^ mf( 6)) \ - + (xl ^ qf(30) ^ qf( 6))); \ - dhf( 7) = tt(((xh >> 11) ^ (qf(23) << 2) ^ mf( 7)) \ - + (xl ^ qf(31) ^ qf( 7))); \ - dhf( 8) = tt(rol(dhf(4), 9) + (xh ^ qf(24) ^ mf( 8)) \ - + ((xl << 8) ^ qf(23) ^ qf( 8))); \ - dhf( 9) = tt(rol(dhf(5), 10) + (xh ^ qf(25) ^ mf( 9)) \ - + ((xl >> 6) ^ qf(16) ^ qf( 9))); \ - dhf(10) = tt(rol(dhf(6), 11) + (xh ^ qf(26) ^ mf(10)) \ - + ((xl << 6) ^ qf(17) ^ qf(10))); \ - dhf(11) = tt(rol(dhf(7), 12) + (xh ^ qf(27) ^ mf(11)) \ - + ((xl << 4) ^ qf(18) ^ qf(11))); \ - dhf(12) = tt(rol(dhf(0), 13) + (xh ^ qf(28) ^ mf(12)) \ - + ((xl >> 3) ^ qf(19) ^ qf(12))); \ - dhf(13) = tt(rol(dhf(1), 14) + (xh ^ qf(29) ^ mf(13)) \ - + ((xl >> 4) ^ qf(20) ^ qf(13))); \ - dhf(14) = tt(rol(dhf(2), 15) + (xh ^ qf(30) ^ mf(14)) \ - + ((xl >> 7) ^ qf(21) ^ qf(14))); \ - dhf(15) = tt(rol(dhf(3), 16) + (xh ^ qf(31) ^ mf(15)) \ - + ((xl >> 2) ^ qf(22) ^ qf(15))); \ - } while (0) - -#define FOLDs FOLD(sph_u32, MAKE_Qs, SPH_T32, SPH_ROTL32, M, Qs, dH) - -#if SPH_64 - -#define FOLDb FOLD(sph_u64, MAKE_Qb, SPH_T64, SPH_ROTL64, M, Qb, dH) - -#endif - -static void -compress_small(const unsigned char *data, const sph_u32 h[16], sph_u32 dh[16]) -{ -#if SPH_LITTLE_FAST -#define M(x) sph_dec32le_aligned(data + 4 * (x)) -#else - sph_u32 mv[16]; - - mv[ 0] = sph_dec32le_aligned(data + 0); - mv[ 1] = sph_dec32le_aligned(data + 4); - mv[ 2] = sph_dec32le_aligned(data + 8); - mv[ 3] = sph_dec32le_aligned(data + 12); - mv[ 4] = sph_dec32le_aligned(data + 16); - mv[ 5] = sph_dec32le_aligned(data + 20); - mv[ 6] = sph_dec32le_aligned(data + 24); - mv[ 7] = sph_dec32le_aligned(data + 28); - mv[ 8] = sph_dec32le_aligned(data + 32); - mv[ 9] = sph_dec32le_aligned(data + 36); - mv[10] = sph_dec32le_aligned(data + 40); - mv[11] = sph_dec32le_aligned(data + 44); - mv[12] = sph_dec32le_aligned(data + 48); - mv[13] = sph_dec32le_aligned(data + 52); - mv[14] = sph_dec32le_aligned(data + 56); - mv[15] = sph_dec32le_aligned(data + 60); -#define M(x) (mv[x]) -#endif -#define H(x) (h[x]) -#define dH(x) (dh[x]) - - FOLDs; - -#undef M -#undef H -#undef dH -} - -static const sph_u32 final_s[16] = { - SPH_C32(0xaaaaaaa0), SPH_C32(0xaaaaaaa1), SPH_C32(0xaaaaaaa2), - SPH_C32(0xaaaaaaa3), SPH_C32(0xaaaaaaa4), SPH_C32(0xaaaaaaa5), - SPH_C32(0xaaaaaaa6), SPH_C32(0xaaaaaaa7), SPH_C32(0xaaaaaaa8), - SPH_C32(0xaaaaaaa9), SPH_C32(0xaaaaaaaa), SPH_C32(0xaaaaaaab), - SPH_C32(0xaaaaaaac), SPH_C32(0xaaaaaaad), SPH_C32(0xaaaaaaae), - SPH_C32(0xaaaaaaaf) -}; - -static void -bmw32_init(sph_bmw_small_context *sc, const sph_u32 *iv) -{ - memcpy(sc->H, iv, sizeof sc->H); - sc->ptr = 0; -#if SPH_64 - sc->bit_count = 0; -#else - sc->bit_count_high = 0; - sc->bit_count_low = 0; -#endif -} - -static void -bmw32(sph_bmw_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - sph_u32 htmp[16]; - sph_u32 *h1, *h2; -#if !SPH_64 - sph_u32 tmp; -#endif - -#if SPH_64 - sc->bit_count += (sph_u64)len << 3; -#else - tmp = sc->bit_count_low; - sc->bit_count_low = SPH_T32(tmp + ((sph_u32)len << 3)); - if (sc->bit_count_low < tmp) - sc->bit_count_high ++; - sc->bit_count_high += len >> 29; -#endif - buf = sc->buf; - ptr = sc->ptr; - h1 = sc->H; - h2 = htmp; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - ptr += clen; - if (ptr == sizeof sc->buf) { - sph_u32 *ht; - - compress_small(buf, h1, h2); - ht = h1; - h1 = h2; - h2 = ht; - ptr = 0; - } - } - sc->ptr = ptr; - if (h1 != sc->H) - memcpy(sc->H, h1, sizeof sc->H); -} - -static void -bmw32_close(sph_bmw_small_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32) -{ - unsigned char *buf, *out; - size_t ptr, u, v; - unsigned z; - sph_u32 h1[16], h2[16], *h; - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - h = sc->H; - if (ptr > (sizeof sc->buf) - 8) { - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - compress_small(buf, h, h1); - ptr = 0; - h = h1; - } - memset(buf + ptr, 0, (sizeof sc->buf) - 8 - ptr); -#if SPH_64 - sph_enc64le_aligned(buf + (sizeof sc->buf) - 8, - SPH_T64(sc->bit_count + n)); -#else - sph_enc32le_aligned(buf + (sizeof sc->buf) - 8, - sc->bit_count_low + n); - sph_enc32le_aligned(buf + (sizeof sc->buf) - 4, - SPH_T32(sc->bit_count_high)); -#endif - compress_small(buf, h, h2); - for (u = 0; u < 16; u ++) - sph_enc32le_aligned(buf + 4 * u, h2[u]); - compress_small(buf, final_s, h1); - out = dst; - for (u = 0, v = 16 - out_size_w32; u < out_size_w32; u ++, v ++) - sph_enc32le(out + 4 * u, h1[v]); -} - -#if SPH_64 - -static void -compress_big(const unsigned char *data, const sph_u64 h[16], sph_u64 dh[16]) -{ -#if SPH_LITTLE_FAST -#define M(x) sph_dec64le_aligned(data + 8 * (x)) -#else - sph_u64 mv[16]; - - mv[ 0] = sph_dec64le_aligned(data + 0); - mv[ 1] = sph_dec64le_aligned(data + 8); - mv[ 2] = sph_dec64le_aligned(data + 16); - mv[ 3] = sph_dec64le_aligned(data + 24); - mv[ 4] = sph_dec64le_aligned(data + 32); - mv[ 5] = sph_dec64le_aligned(data + 40); - mv[ 6] = sph_dec64le_aligned(data + 48); - mv[ 7] = sph_dec64le_aligned(data + 56); - mv[ 8] = sph_dec64le_aligned(data + 64); - mv[ 9] = sph_dec64le_aligned(data + 72); - mv[10] = sph_dec64le_aligned(data + 80); - mv[11] = sph_dec64le_aligned(data + 88); - mv[12] = sph_dec64le_aligned(data + 96); - mv[13] = sph_dec64le_aligned(data + 104); - mv[14] = sph_dec64le_aligned(data + 112); - mv[15] = sph_dec64le_aligned(data + 120); -#define M(x) (mv[x]) -#endif -#define H(x) (h[x]) -#define dH(x) (dh[x]) - - FOLDb; - -#undef M -#undef H -#undef dH -} - -static const sph_u64 final_b[16] = { - SPH_C64(0xaaaaaaaaaaaaaaa0), SPH_C64(0xaaaaaaaaaaaaaaa1), - SPH_C64(0xaaaaaaaaaaaaaaa2), SPH_C64(0xaaaaaaaaaaaaaaa3), - SPH_C64(0xaaaaaaaaaaaaaaa4), SPH_C64(0xaaaaaaaaaaaaaaa5), - SPH_C64(0xaaaaaaaaaaaaaaa6), SPH_C64(0xaaaaaaaaaaaaaaa7), - SPH_C64(0xaaaaaaaaaaaaaaa8), SPH_C64(0xaaaaaaaaaaaaaaa9), - SPH_C64(0xaaaaaaaaaaaaaaaa), SPH_C64(0xaaaaaaaaaaaaaaab), - SPH_C64(0xaaaaaaaaaaaaaaac), SPH_C64(0xaaaaaaaaaaaaaaad), - SPH_C64(0xaaaaaaaaaaaaaaae), SPH_C64(0xaaaaaaaaaaaaaaaf) -}; - -static void -bmw64_init(sph_bmw_big_context *sc, const sph_u64 *iv) -{ - memcpy(sc->H, iv, sizeof sc->H); - sc->ptr = 0; - sc->bit_count = 0; -} - -static void -bmw64(sph_bmw_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - sph_u64 htmp[16]; - sph_u64 *h1, *h2; - - sc->bit_count += (sph_u64)len << 3; - buf = sc->buf; - ptr = sc->ptr; - h1 = sc->H; - h2 = htmp; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - ptr += clen; - if (ptr == sizeof sc->buf) { - sph_u64 *ht; - - compress_big(buf, h1, h2); - ht = h1; - h1 = h2; - h2 = ht; - ptr = 0; - } - } - sc->ptr = ptr; - if (h1 != sc->H) - memcpy(sc->H, h1, sizeof sc->H); -} - -static void -bmw64_close(sph_bmw_big_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w64) -{ - unsigned char *buf, *out; - size_t ptr, u, v; - unsigned z; - sph_u64 h1[16], h2[16], *h; - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - h = sc->H; - if (ptr > (sizeof sc->buf) - 8) { - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - compress_big(buf, h, h1); - ptr = 0; - h = h1; - } - memset(buf + ptr, 0, (sizeof sc->buf) - 8 - ptr); - sph_enc64le_aligned(buf + (sizeof sc->buf) - 8, - SPH_T64(sc->bit_count + n)); - compress_big(buf, h, h2); - for (u = 0; u < 16; u ++) - sph_enc64le_aligned(buf + 8 * u, h2[u]); - compress_big(buf, final_b, h1); - out = dst; - for (u = 0, v = 16 - out_size_w64; u < out_size_w64; u ++, v ++) - sph_enc64le(out + 8 * u, h1[v]); -} - -#endif - -/* see sph_bmw.h */ -void -sph_bmw224_init(void *cc) -{ - bmw32_init(cc, IV224); -} - -/* see sph_bmw.h */ -void -sph_bmw224(void *cc, const void *data, size_t len) -{ - bmw32(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw224_close(void *cc, void *dst) -{ - sph_bmw224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw32_close(cc, ub, n, dst, 7); - sph_bmw224_init(cc); -} - -/* see sph_bmw.h */ -void -sph_bmw256_init(void *cc) -{ - bmw32_init(cc, IV256); -} - -/* see sph_bmw.h */ -void -sph_bmw256(void *cc, const void *data, size_t len) -{ - bmw32(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw256_close(void *cc, void *dst) -{ - sph_bmw256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw32_close(cc, ub, n, dst, 8); - sph_bmw256_init(cc); -} - -#if SPH_64 - -/* see sph_bmw.h */ -void -sph_bmw384_init(void *cc) -{ - bmw64_init(cc, IV384); -} - -/* see sph_bmw.h */ -void -sph_bmw384(void *cc, const void *data, size_t len) -{ - bmw64(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw384_close(void *cc, void *dst) -{ - sph_bmw384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw64_close(cc, ub, n, dst, 6); - sph_bmw384_init(cc); -} - -/* see sph_bmw.h */ -void -sph_bmw512_init(void *cc) -{ - bmw64_init(cc, IV512); -} - -/* see sph_bmw.h */ -void -sph_bmw512(void *cc, const void *data, size_t len) -{ - bmw64(cc, data, len); -} - -/* see sph_bmw.h */ -void -sph_bmw512_close(void *cc, void *dst) -{ - sph_bmw512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_bmw.h */ -void -sph_bmw512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - bmw64_close(cc, ub, n, dst, 8); - sph_bmw512_init(cc); -} - -#endif - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/common.h b/src/crypto/common.h deleted file mode 100644 index 9dca82de7..000000000 --- a/src/crypto/common.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_COMMON_H -#define BITCOIN_CRYPTO_COMMON_H - -#if defined(HAVE_CONFIG_H) -#include "interzone-config.h" -#endif - -#include -#include - -#include "compat/endian.h" - -uint16_t static inline ReadLE16(const unsigned char* ptr) -{ - uint16_t x; - memcpy((char*)&x, ptr, 2); - return le16toh(x); -} - -uint32_t static inline ReadLE32(const unsigned char* ptr) -{ - uint32_t x; - memcpy((char*)&x, ptr, 4); - return le32toh(x); -} - -uint64_t static inline ReadLE64(const unsigned char* ptr) -{ - uint64_t x; - memcpy((char*)&x, ptr, 8); - return le64toh(x); -} - -void static inline WriteLE16(unsigned char* ptr, uint16_t x) -{ - uint16_t v = htole16(x); - memcpy(ptr, (char*)&v, 2); -} - -void static inline WriteLE32(unsigned char* ptr, uint32_t x) -{ - uint32_t v = htole32(x); - memcpy(ptr, (char*)&v, 4); -} - -void static inline WriteLE64(unsigned char* ptr, uint64_t x) -{ - uint64_t v = htole64(x); - memcpy(ptr, (char*)&v, 8); -} - -uint32_t static inline ReadBE32(const unsigned char* ptr) -{ - uint32_t x; - memcpy((char*)&x, ptr, 4); - return be32toh(x); -} - -uint64_t static inline ReadBE64(const unsigned char* ptr) -{ - uint64_t x; - memcpy((char*)&x, ptr, 8); - return be64toh(x); -} - -void static inline WriteBE32(unsigned char* ptr, uint32_t x) -{ - uint32_t v = htobe32(x); - memcpy(ptr, (char*)&v, 4); -} - -void static inline WriteBE64(unsigned char* ptr, uint64_t x) -{ - uint64_t v = htobe64(x); - memcpy(ptr, (char*)&v, 8); -} - -/** Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. */ -uint64_t static inline CountBits(uint64_t x) -{ -#ifdef HAVE_DECL___BUILTIN_CLZL - if (sizeof(unsigned long) >= sizeof(uint64_t)) { - return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0; - } -#endif -#ifdef HAVE_DECL___BUILTIN_CLZLL - if (sizeof(unsigned long long) >= sizeof(uint64_t)) { - return x ? 8 * sizeof(unsigned long long) - __builtin_clzll(x) : 0; - } -#endif - int ret = 0; - while (x) { - x >>= 1; - ++ret; - } - return ret; -} - -#endif // BITCOIN_CRYPTO_COMMON_H diff --git a/src/crypto/cubehash.c b/src/crypto/cubehash.c deleted file mode 100644 index 9322fe14e..000000000 --- a/src/crypto/cubehash.c +++ /dev/null @@ -1,723 +0,0 @@ -/* $Id: cubehash.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * CubeHash implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_cubehash.h" -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_CUBEHASH -#define SPH_SMALL_FOOTPRINT_CUBEHASH 1 -#endif - -/* - * Some tests were conducted on an Intel Core2 Q6600 (32-bit and 64-bit - * mode), a PowerPC G3, and a MIPS-compatible CPU (Broadcom BCM3302). - * It appears that the optimal settings are: - * -- full unroll, no state copy on the "big" systems (x86, PowerPC) - * -- unroll to 4 or 8, state copy on the "small" system (MIPS) - */ - -#if SPH_SMALL_FOOTPRINT_CUBEHASH - -#if !defined SPH_CUBEHASH_UNROLL -#define SPH_CUBEHASH_UNROLL 4 -#endif -#if !defined SPH_CUBEHASH_NOCOPY -#define SPH_CUBEHASH_NOCOPY 1 -#endif - -#else - -#if !defined SPH_CUBEHASH_UNROLL -#define SPH_CUBEHASH_UNROLL 0 -#endif -#if !defined SPH_CUBEHASH_NOCOPY -#define SPH_CUBEHASH_NOCOPY 0 -#endif - -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 IV224[] = { - SPH_C32(0xB0FC8217), SPH_C32(0x1BEE1A90), SPH_C32(0x829E1A22), - SPH_C32(0x6362C342), SPH_C32(0x24D91C30), SPH_C32(0x03A7AA24), - SPH_C32(0xA63721C8), SPH_C32(0x85B0E2EF), SPH_C32(0xF35D13F3), - SPH_C32(0x41DA807D), SPH_C32(0x21A70CA6), SPH_C32(0x1F4E9774), - SPH_C32(0xB3E1C932), SPH_C32(0xEB0A79A8), SPH_C32(0xCDDAAA66), - SPH_C32(0xE2F6ECAA), SPH_C32(0x0A713362), SPH_C32(0xAA3080E0), - SPH_C32(0xD8F23A32), SPH_C32(0xCEF15E28), SPH_C32(0xDB086314), - SPH_C32(0x7F709DF7), SPH_C32(0xACD228A4), SPH_C32(0x704D6ECE), - SPH_C32(0xAA3EC95F), SPH_C32(0xE387C214), SPH_C32(0x3A6445FF), - SPH_C32(0x9CAB81C3), SPH_C32(0xC73D4B98), SPH_C32(0xD277AEBE), - SPH_C32(0xFD20151C), SPH_C32(0x00CB573E) -}; - -static const sph_u32 IV256[] = { - SPH_C32(0xEA2BD4B4), SPH_C32(0xCCD6F29F), SPH_C32(0x63117E71), - SPH_C32(0x35481EAE), SPH_C32(0x22512D5B), SPH_C32(0xE5D94E63), - SPH_C32(0x7E624131), SPH_C32(0xF4CC12BE), SPH_C32(0xC2D0B696), - SPH_C32(0x42AF2070), SPH_C32(0xD0720C35), SPH_C32(0x3361DA8C), - SPH_C32(0x28CCECA4), SPH_C32(0x8EF8AD83), SPH_C32(0x4680AC00), - SPH_C32(0x40E5FBAB), SPH_C32(0xD89041C3), SPH_C32(0x6107FBD5), - SPH_C32(0x6C859D41), SPH_C32(0xF0B26679), SPH_C32(0x09392549), - SPH_C32(0x5FA25603), SPH_C32(0x65C892FD), SPH_C32(0x93CB6285), - SPH_C32(0x2AF2B5AE), SPH_C32(0x9E4B4E60), SPH_C32(0x774ABFDD), - SPH_C32(0x85254725), SPH_C32(0x15815AEB), SPH_C32(0x4AB6AAD6), - SPH_C32(0x9CDAF8AF), SPH_C32(0xD6032C0A) -}; - -static const sph_u32 IV384[] = { - SPH_C32(0xE623087E), SPH_C32(0x04C00C87), SPH_C32(0x5EF46453), - SPH_C32(0x69524B13), SPH_C32(0x1A05C7A9), SPH_C32(0x3528DF88), - SPH_C32(0x6BDD01B5), SPH_C32(0x5057B792), SPH_C32(0x6AA7A922), - SPH_C32(0x649C7EEE), SPH_C32(0xF426309F), SPH_C32(0xCB629052), - SPH_C32(0xFC8E20ED), SPH_C32(0xB3482BAB), SPH_C32(0xF89E5E7E), - SPH_C32(0xD83D4DE4), SPH_C32(0x44BFC10D), SPH_C32(0x5FC1E63D), - SPH_C32(0x2104E6CB), SPH_C32(0x17958F7F), SPH_C32(0xDBEAEF70), - SPH_C32(0xB4B97E1E), SPH_C32(0x32C195F6), SPH_C32(0x6184A8E4), - SPH_C32(0x796C2543), SPH_C32(0x23DE176D), SPH_C32(0xD33BBAEC), - SPH_C32(0x0C12E5D2), SPH_C32(0x4EB95A7B), SPH_C32(0x2D18BA01), - SPH_C32(0x04EE475F), SPH_C32(0x1FC5F22E) -}; - -static const sph_u32 IV512[] = { - SPH_C32(0x2AEA2A61), SPH_C32(0x50F494D4), SPH_C32(0x2D538B8B), - SPH_C32(0x4167D83E), SPH_C32(0x3FEE2313), SPH_C32(0xC701CF8C), - SPH_C32(0xCC39968E), SPH_C32(0x50AC5695), SPH_C32(0x4D42C787), - SPH_C32(0xA647A8B3), SPH_C32(0x97CF0BEF), SPH_C32(0x825B4537), - SPH_C32(0xEEF864D2), SPH_C32(0xF22090C4), SPH_C32(0xD0E5CD33), - SPH_C32(0xA23911AE), SPH_C32(0xFCD398D9), SPH_C32(0x148FE485), - SPH_C32(0x1B017BEF), SPH_C32(0xB6444532), SPH_C32(0x6A536159), - SPH_C32(0x2FF5781C), SPH_C32(0x91FA7934), SPH_C32(0x0DBADEA9), - SPH_C32(0xD65C8A2B), SPH_C32(0xA5A70E75), SPH_C32(0xB1C62456), - SPH_C32(0xBC796576), SPH_C32(0x1921C8F7), SPH_C32(0xE7989AF1), - SPH_C32(0x7795D246), SPH_C32(0xD43E3B44) -}; - -#define T32 SPH_T32 -#define ROTL32 SPH_ROTL32 - -#if SPH_CUBEHASH_NOCOPY - -#define DECL_STATE -#define READ_STATE(cc) -#define WRITE_STATE(cc) - -#define x0 ((sc)->state[ 0]) -#define x1 ((sc)->state[ 1]) -#define x2 ((sc)->state[ 2]) -#define x3 ((sc)->state[ 3]) -#define x4 ((sc)->state[ 4]) -#define x5 ((sc)->state[ 5]) -#define x6 ((sc)->state[ 6]) -#define x7 ((sc)->state[ 7]) -#define x8 ((sc)->state[ 8]) -#define x9 ((sc)->state[ 9]) -#define xa ((sc)->state[10]) -#define xb ((sc)->state[11]) -#define xc ((sc)->state[12]) -#define xd ((sc)->state[13]) -#define xe ((sc)->state[14]) -#define xf ((sc)->state[15]) -#define xg ((sc)->state[16]) -#define xh ((sc)->state[17]) -#define xi ((sc)->state[18]) -#define xj ((sc)->state[19]) -#define xk ((sc)->state[20]) -#define xl ((sc)->state[21]) -#define xm ((sc)->state[22]) -#define xn ((sc)->state[23]) -#define xo ((sc)->state[24]) -#define xp ((sc)->state[25]) -#define xq ((sc)->state[26]) -#define xr ((sc)->state[27]) -#define xs ((sc)->state[28]) -#define xt ((sc)->state[29]) -#define xu ((sc)->state[30]) -#define xv ((sc)->state[31]) - -#else - -#define DECL_STATE \ - sph_u32 x0, x1, x2, x3, x4, x5, x6, x7; \ - sph_u32 x8, x9, xa, xb, xc, xd, xe, xf; \ - sph_u32 xg, xh, xi, xj, xk, xl, xm, xn; \ - sph_u32 xo, xp, xq, xr, xs, xt, xu, xv; - -#define READ_STATE(cc) do { \ - x0 = (cc)->state[ 0]; \ - x1 = (cc)->state[ 1]; \ - x2 = (cc)->state[ 2]; \ - x3 = (cc)->state[ 3]; \ - x4 = (cc)->state[ 4]; \ - x5 = (cc)->state[ 5]; \ - x6 = (cc)->state[ 6]; \ - x7 = (cc)->state[ 7]; \ - x8 = (cc)->state[ 8]; \ - x9 = (cc)->state[ 9]; \ - xa = (cc)->state[10]; \ - xb = (cc)->state[11]; \ - xc = (cc)->state[12]; \ - xd = (cc)->state[13]; \ - xe = (cc)->state[14]; \ - xf = (cc)->state[15]; \ - xg = (cc)->state[16]; \ - xh = (cc)->state[17]; \ - xi = (cc)->state[18]; \ - xj = (cc)->state[19]; \ - xk = (cc)->state[20]; \ - xl = (cc)->state[21]; \ - xm = (cc)->state[22]; \ - xn = (cc)->state[23]; \ - xo = (cc)->state[24]; \ - xp = (cc)->state[25]; \ - xq = (cc)->state[26]; \ - xr = (cc)->state[27]; \ - xs = (cc)->state[28]; \ - xt = (cc)->state[29]; \ - xu = (cc)->state[30]; \ - xv = (cc)->state[31]; \ - } while (0) - -#define WRITE_STATE(cc) do { \ - (cc)->state[ 0] = x0; \ - (cc)->state[ 1] = x1; \ - (cc)->state[ 2] = x2; \ - (cc)->state[ 3] = x3; \ - (cc)->state[ 4] = x4; \ - (cc)->state[ 5] = x5; \ - (cc)->state[ 6] = x6; \ - (cc)->state[ 7] = x7; \ - (cc)->state[ 8] = x8; \ - (cc)->state[ 9] = x9; \ - (cc)->state[10] = xa; \ - (cc)->state[11] = xb; \ - (cc)->state[12] = xc; \ - (cc)->state[13] = xd; \ - (cc)->state[14] = xe; \ - (cc)->state[15] = xf; \ - (cc)->state[16] = xg; \ - (cc)->state[17] = xh; \ - (cc)->state[18] = xi; \ - (cc)->state[19] = xj; \ - (cc)->state[20] = xk; \ - (cc)->state[21] = xl; \ - (cc)->state[22] = xm; \ - (cc)->state[23] = xn; \ - (cc)->state[24] = xo; \ - (cc)->state[25] = xp; \ - (cc)->state[26] = xq; \ - (cc)->state[27] = xr; \ - (cc)->state[28] = xs; \ - (cc)->state[29] = xt; \ - (cc)->state[30] = xu; \ - (cc)->state[31] = xv; \ - } while (0) - -#endif - -#define INPUT_BLOCK do { \ - x0 ^= sph_dec32le_aligned(buf + 0); \ - x1 ^= sph_dec32le_aligned(buf + 4); \ - x2 ^= sph_dec32le_aligned(buf + 8); \ - x3 ^= sph_dec32le_aligned(buf + 12); \ - x4 ^= sph_dec32le_aligned(buf + 16); \ - x5 ^= sph_dec32le_aligned(buf + 20); \ - x6 ^= sph_dec32le_aligned(buf + 24); \ - x7 ^= sph_dec32le_aligned(buf + 28); \ - } while (0) - -#define ROUND_EVEN do { \ - xg = T32(x0 + xg); \ - x0 = ROTL32(x0, 7); \ - xh = T32(x1 + xh); \ - x1 = ROTL32(x1, 7); \ - xi = T32(x2 + xi); \ - x2 = ROTL32(x2, 7); \ - xj = T32(x3 + xj); \ - x3 = ROTL32(x3, 7); \ - xk = T32(x4 + xk); \ - x4 = ROTL32(x4, 7); \ - xl = T32(x5 + xl); \ - x5 = ROTL32(x5, 7); \ - xm = T32(x6 + xm); \ - x6 = ROTL32(x6, 7); \ - xn = T32(x7 + xn); \ - x7 = ROTL32(x7, 7); \ - xo = T32(x8 + xo); \ - x8 = ROTL32(x8, 7); \ - xp = T32(x9 + xp); \ - x9 = ROTL32(x9, 7); \ - xq = T32(xa + xq); \ - xa = ROTL32(xa, 7); \ - xr = T32(xb + xr); \ - xb = ROTL32(xb, 7); \ - xs = T32(xc + xs); \ - xc = ROTL32(xc, 7); \ - xt = T32(xd + xt); \ - xd = ROTL32(xd, 7); \ - xu = T32(xe + xu); \ - xe = ROTL32(xe, 7); \ - xv = T32(xf + xv); \ - xf = ROTL32(xf, 7); \ - x8 ^= xg; \ - x9 ^= xh; \ - xa ^= xi; \ - xb ^= xj; \ - xc ^= xk; \ - xd ^= xl; \ - xe ^= xm; \ - xf ^= xn; \ - x0 ^= xo; \ - x1 ^= xp; \ - x2 ^= xq; \ - x3 ^= xr; \ - x4 ^= xs; \ - x5 ^= xt; \ - x6 ^= xu; \ - x7 ^= xv; \ - xi = T32(x8 + xi); \ - x8 = ROTL32(x8, 11); \ - xj = T32(x9 + xj); \ - x9 = ROTL32(x9, 11); \ - xg = T32(xa + xg); \ - xa = ROTL32(xa, 11); \ - xh = T32(xb + xh); \ - xb = ROTL32(xb, 11); \ - xm = T32(xc + xm); \ - xc = ROTL32(xc, 11); \ - xn = T32(xd + xn); \ - xd = ROTL32(xd, 11); \ - xk = T32(xe + xk); \ - xe = ROTL32(xe, 11); \ - xl = T32(xf + xl); \ - xf = ROTL32(xf, 11); \ - xq = T32(x0 + xq); \ - x0 = ROTL32(x0, 11); \ - xr = T32(x1 + xr); \ - x1 = ROTL32(x1, 11); \ - xo = T32(x2 + xo); \ - x2 = ROTL32(x2, 11); \ - xp = T32(x3 + xp); \ - x3 = ROTL32(x3, 11); \ - xu = T32(x4 + xu); \ - x4 = ROTL32(x4, 11); \ - xv = T32(x5 + xv); \ - x5 = ROTL32(x5, 11); \ - xs = T32(x6 + xs); \ - x6 = ROTL32(x6, 11); \ - xt = T32(x7 + xt); \ - x7 = ROTL32(x7, 11); \ - xc ^= xi; \ - xd ^= xj; \ - xe ^= xg; \ - xf ^= xh; \ - x8 ^= xm; \ - x9 ^= xn; \ - xa ^= xk; \ - xb ^= xl; \ - x4 ^= xq; \ - x5 ^= xr; \ - x6 ^= xo; \ - x7 ^= xp; \ - x0 ^= xu; \ - x1 ^= xv; \ - x2 ^= xs; \ - x3 ^= xt; \ - } while (0) - -#define ROUND_ODD do { \ - xj = T32(xc + xj); \ - xc = ROTL32(xc, 7); \ - xi = T32(xd + xi); \ - xd = ROTL32(xd, 7); \ - xh = T32(xe + xh); \ - xe = ROTL32(xe, 7); \ - xg = T32(xf + xg); \ - xf = ROTL32(xf, 7); \ - xn = T32(x8 + xn); \ - x8 = ROTL32(x8, 7); \ - xm = T32(x9 + xm); \ - x9 = ROTL32(x9, 7); \ - xl = T32(xa + xl); \ - xa = ROTL32(xa, 7); \ - xk = T32(xb + xk); \ - xb = ROTL32(xb, 7); \ - xr = T32(x4 + xr); \ - x4 = ROTL32(x4, 7); \ - xq = T32(x5 + xq); \ - x5 = ROTL32(x5, 7); \ - xp = T32(x6 + xp); \ - x6 = ROTL32(x6, 7); \ - xo = T32(x7 + xo); \ - x7 = ROTL32(x7, 7); \ - xv = T32(x0 + xv); \ - x0 = ROTL32(x0, 7); \ - xu = T32(x1 + xu); \ - x1 = ROTL32(x1, 7); \ - xt = T32(x2 + xt); \ - x2 = ROTL32(x2, 7); \ - xs = T32(x3 + xs); \ - x3 = ROTL32(x3, 7); \ - x4 ^= xj; \ - x5 ^= xi; \ - x6 ^= xh; \ - x7 ^= xg; \ - x0 ^= xn; \ - x1 ^= xm; \ - x2 ^= xl; \ - x3 ^= xk; \ - xc ^= xr; \ - xd ^= xq; \ - xe ^= xp; \ - xf ^= xo; \ - x8 ^= xv; \ - x9 ^= xu; \ - xa ^= xt; \ - xb ^= xs; \ - xh = T32(x4 + xh); \ - x4 = ROTL32(x4, 11); \ - xg = T32(x5 + xg); \ - x5 = ROTL32(x5, 11); \ - xj = T32(x6 + xj); \ - x6 = ROTL32(x6, 11); \ - xi = T32(x7 + xi); \ - x7 = ROTL32(x7, 11); \ - xl = T32(x0 + xl); \ - x0 = ROTL32(x0, 11); \ - xk = T32(x1 + xk); \ - x1 = ROTL32(x1, 11); \ - xn = T32(x2 + xn); \ - x2 = ROTL32(x2, 11); \ - xm = T32(x3 + xm); \ - x3 = ROTL32(x3, 11); \ - xp = T32(xc + xp); \ - xc = ROTL32(xc, 11); \ - xo = T32(xd + xo); \ - xd = ROTL32(xd, 11); \ - xr = T32(xe + xr); \ - xe = ROTL32(xe, 11); \ - xq = T32(xf + xq); \ - xf = ROTL32(xf, 11); \ - xt = T32(x8 + xt); \ - x8 = ROTL32(x8, 11); \ - xs = T32(x9 + xs); \ - x9 = ROTL32(x9, 11); \ - xv = T32(xa + xv); \ - xa = ROTL32(xa, 11); \ - xu = T32(xb + xu); \ - xb = ROTL32(xb, 11); \ - x0 ^= xh; \ - x1 ^= xg; \ - x2 ^= xj; \ - x3 ^= xi; \ - x4 ^= xl; \ - x5 ^= xk; \ - x6 ^= xn; \ - x7 ^= xm; \ - x8 ^= xp; \ - x9 ^= xo; \ - xa ^= xr; \ - xb ^= xq; \ - xc ^= xt; \ - xd ^= xs; \ - xe ^= xv; \ - xf ^= xu; \ - } while (0) - -/* - * There is no need to unroll all 16 rounds. The word-swapping permutation - * is an involution, so we need to unroll an even number of rounds. On - * "big" systems, unrolling 4 rounds yields about 97% of the speed - * achieved with full unrolling; and it keeps the code more compact - * for small architectures. - */ - -#if SPH_CUBEHASH_UNROLL == 2 - -#define SIXTEEN_ROUNDS do { \ - int j; \ - for (j = 0; j < 8; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - } \ - } while (0) - -#elif SPH_CUBEHASH_UNROLL == 4 - -#define SIXTEEN_ROUNDS do { \ - int j; \ - for (j = 0; j < 4; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - } \ - } while (0) - -#elif SPH_CUBEHASH_UNROLL == 8 - -#define SIXTEEN_ROUNDS do { \ - int j; \ - for (j = 0; j < 2; j ++) { \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - } \ - } while (0) - -#else - -#define SIXTEEN_ROUNDS do { \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - ROUND_EVEN; \ - ROUND_ODD; \ - } while (0) - -#endif - -static void -cubehash_init(sph_cubehash_context *sc, const sph_u32 *iv) -{ - memcpy(sc->state, iv, sizeof sc->state); - sc->ptr = 0; -} - -static void -cubehash_core(sph_cubehash_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INPUT_BLOCK; - SIXTEEN_ROUNDS; - ptr = 0; - } - } - WRITE_STATE(sc); - sc->ptr = ptr; -} - -static void -cubehash_close(sph_cubehash_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE(sc); - INPUT_BLOCK; - for (i = 0; i < 11; i ++) { - SIXTEEN_ROUNDS; - if (i == 0) - xv ^= SPH_C32(1); - } - WRITE_STATE(sc); - out = dst; - for (z = 0; z < out_size_w32; z ++) - sph_enc32le(out + (z << 2), sc->state[z]); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224_init(void *cc) -{ - cubehash_init(cc, IV224); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224_close(void *cc, void *dst) -{ - sph_cubehash224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 7); - sph_cubehash224_init(cc); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256_init(void *cc) -{ - cubehash_init(cc, IV256); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256_close(void *cc, void *dst) -{ - sph_cubehash256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 8); - sph_cubehash256_init(cc); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384_init(void *cc) -{ - cubehash_init(cc, IV384); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384_close(void *cc, void *dst) -{ - sph_cubehash384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 12); - sph_cubehash384_init(cc); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512_init(void *cc) -{ - cubehash_init(cc, IV512); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512(void *cc, const void *data, size_t len) -{ - cubehash_core(cc, data, len); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512_close(void *cc, void *dst) -{ - sph_cubehash512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_cubehash.h */ -void -sph_cubehash512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - cubehash_close(cc, ub, n, dst, 16); - sph_cubehash512_init(cc); -} -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/echo.c b/src/crypto/echo.c deleted file mode 100644 index 667e3f357..000000000 --- a/src/crypto/echo.c +++ /dev/null @@ -1,1031 +0,0 @@ -/* $Id: echo.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * ECHO implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_echo.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_ECHO -#define SPH_SMALL_FOOTPRINT_ECHO 1 -#endif - -/* - * Some measures tend to show that the 64-bit implementation offers - * better performance only on a "64-bit architectures", those which have - * actual 64-bit registers. - */ -#if !defined SPH_ECHO_64 && SPH_64_TRUE -#define SPH_ECHO_64 1 -#endif - -/* - * We can use a 64-bit implementation only if a 64-bit type is available. - */ -#if !SPH_64 -#undef SPH_ECHO_64 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#define T32 SPH_T32 -#define C32 SPH_C32 -#if SPH_64 -#define C64 SPH_C64 -#endif - -#define AES_BIG_ENDIAN 0 -#include "aes_helper.c" - -#if SPH_ECHO_64 - -#define DECL_STATE_SMALL \ - sph_u64 W[16][2]; - -#define DECL_STATE_BIG \ - sph_u64 W[16][2]; - -#define INPUT_BLOCK_SMALL(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vb, 8 * sizeof(sph_u64)); \ - for (u = 0; u < 12; u ++) { \ - W[u + 4][0] = sph_dec64le_aligned( \ - sc->buf + 16 * u); \ - W[u + 4][1] = sph_dec64le_aligned( \ - sc->buf + 16 * u + 8); \ - } \ - } while (0) - -#define INPUT_BLOCK_BIG(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vb, 16 * sizeof(sph_u64)); \ - for (u = 0; u < 8; u ++) { \ - W[u + 8][0] = sph_dec64le_aligned( \ - sc->buf + 16 * u); \ - W[u + 8][1] = sph_dec64le_aligned( \ - sc->buf + 16 * u + 8); \ - } \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -aes_2rounds_all(sph_u64 W[16][2], - sph_u32 *pK0, sph_u32 *pK1, sph_u32 *pK2, sph_u32 *pK3) -{ - int n; - sph_u32 K0 = *pK0; - sph_u32 K1 = *pK1; - sph_u32 K2 = *pK2; - sph_u32 K3 = *pK3; - - for (n = 0; n < 16; n ++) { - sph_u64 Wl = W[n][0]; - sph_u64 Wh = W[n][1]; - sph_u32 X0 = (sph_u32)Wl; - sph_u32 X1 = (sph_u32)(Wl >> 32); - sph_u32 X2 = (sph_u32)Wh; - sph_u32 X3 = (sph_u32)(Wh >> 32); - sph_u32 Y0, Y1, Y2, Y3; \ - AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); - W[n][0] = (sph_u64)X0 | ((sph_u64)X1 << 32); - W[n][1] = (sph_u64)X2 | ((sph_u64)X3 << 32); - if ((K0 = T32(K0 + 1)) == 0) { - if ((K1 = T32(K1 + 1)) == 0) - if ((K2 = T32(K2 + 1)) == 0) - K3 = T32(K3 + 1); - } - } - *pK0 = K0; - *pK1 = K1; - *pK2 = K2; - *pK3 = K3; -} - -#define BIG_SUB_WORDS do { \ - aes_2rounds_all(W, &K0, &K1, &K2, &K3); \ - } while (0) - -#else - -#define AES_2ROUNDS(X) do { \ - sph_u32 X0 = (sph_u32)(X[0]); \ - sph_u32 X1 = (sph_u32)(X[0] >> 32); \ - sph_u32 X2 = (sph_u32)(X[1]); \ - sph_u32 X3 = (sph_u32)(X[1] >> 32); \ - sph_u32 Y0, Y1, Y2, Y3; \ - AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); \ - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); \ - X[0] = (sph_u64)X0 | ((sph_u64)X1 << 32); \ - X[1] = (sph_u64)X2 | ((sph_u64)X3 << 32); \ - if ((K0 = T32(K0 + 1)) == 0) { \ - if ((K1 = T32(K1 + 1)) == 0) \ - if ((K2 = T32(K2 + 1)) == 0) \ - K3 = T32(K3 + 1); \ - } \ - } while (0) - -#define BIG_SUB_WORDS do { \ - AES_2ROUNDS(W[ 0]); \ - AES_2ROUNDS(W[ 1]); \ - AES_2ROUNDS(W[ 2]); \ - AES_2ROUNDS(W[ 3]); \ - AES_2ROUNDS(W[ 4]); \ - AES_2ROUNDS(W[ 5]); \ - AES_2ROUNDS(W[ 6]); \ - AES_2ROUNDS(W[ 7]); \ - AES_2ROUNDS(W[ 8]); \ - AES_2ROUNDS(W[ 9]); \ - AES_2ROUNDS(W[10]); \ - AES_2ROUNDS(W[11]); \ - AES_2ROUNDS(W[12]); \ - AES_2ROUNDS(W[13]); \ - AES_2ROUNDS(W[14]); \ - AES_2ROUNDS(W[15]); \ - } while (0) - -#endif - -#define SHIFT_ROW1(a, b, c, d) do { \ - sph_u64 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[b][0]; \ - W[b][0] = W[c][0]; \ - W[c][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[b][1]; \ - W[b][1] = W[c][1]; \ - W[c][1] = W[d][1]; \ - W[d][1] = tmp; \ - } while (0) - -#define SHIFT_ROW2(a, b, c, d) do { \ - sph_u64 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[c][0]; \ - W[c][0] = tmp; \ - tmp = W[b][0]; \ - W[b][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[c][1]; \ - W[c][1] = tmp; \ - tmp = W[b][1]; \ - W[b][1] = W[d][1]; \ - W[d][1] = tmp; \ - } while (0) - -#define SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) - -#define BIG_SHIFT_ROWS do { \ - SHIFT_ROW1(1, 5, 9, 13); \ - SHIFT_ROW2(2, 6, 10, 14); \ - SHIFT_ROW3(3, 7, 11, 15); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -mix_column(sph_u64 W[16][2], int ia, int ib, int ic, int id) -{ - int n; - - for (n = 0; n < 2; n ++) { - sph_u64 a = W[ia][n]; - sph_u64 b = W[ib][n]; - sph_u64 c = W[ic][n]; - sph_u64 d = W[id][n]; - sph_u64 ab = a ^ b; - sph_u64 bc = b ^ c; - sph_u64 cd = c ^ d; - sph_u64 abx = ((ab & C64(0x8080808080808080)) >> 7) * 27U - ^ ((ab & C64(0x7F7F7F7F7F7F7F7F)) << 1); - sph_u64 bcx = ((bc & C64(0x8080808080808080)) >> 7) * 27U - ^ ((bc & C64(0x7F7F7F7F7F7F7F7F)) << 1); - sph_u64 cdx = ((cd & C64(0x8080808080808080)) >> 7) * 27U - ^ ((cd & C64(0x7F7F7F7F7F7F7F7F)) << 1); - W[ia][n] = abx ^ bc ^ d; - W[ib][n] = bcx ^ a ^ cd; - W[ic][n] = cdx ^ ab ^ d; - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; - } -} - -#define MIX_COLUMN(a, b, c, d) mix_column(W, a, b, c, d) - -#else - -#define MIX_COLUMN1(ia, ib, ic, id, n) do { \ - sph_u64 a = W[ia][n]; \ - sph_u64 b = W[ib][n]; \ - sph_u64 c = W[ic][n]; \ - sph_u64 d = W[id][n]; \ - sph_u64 ab = a ^ b; \ - sph_u64 bc = b ^ c; \ - sph_u64 cd = c ^ d; \ - sph_u64 abx = ((ab & C64(0x8080808080808080)) >> 7) * 27U \ - ^ ((ab & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ - sph_u64 bcx = ((bc & C64(0x8080808080808080)) >> 7) * 27U \ - ^ ((bc & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ - sph_u64 cdx = ((cd & C64(0x8080808080808080)) >> 7) * 27U \ - ^ ((cd & C64(0x7F7F7F7F7F7F7F7F)) << 1); \ - W[ia][n] = abx ^ bc ^ d; \ - W[ib][n] = bcx ^ a ^ cd; \ - W[ic][n] = cdx ^ ab ^ d; \ - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; \ - } while (0) - -#define MIX_COLUMN(a, b, c, d) do { \ - MIX_COLUMN1(a, b, c, d, 0); \ - MIX_COLUMN1(a, b, c, d, 1); \ - } while (0) - -#endif - -#define BIG_MIX_COLUMNS do { \ - MIX_COLUMN(0, 1, 2, 3); \ - MIX_COLUMN(4, 5, 6, 7); \ - MIX_COLUMN(8, 9, 10, 11); \ - MIX_COLUMN(12, 13, 14, 15); \ - } while (0) - -#define BIG_ROUND do { \ - BIG_SUB_WORDS; \ - BIG_SHIFT_ROWS; \ - BIG_MIX_COLUMNS; \ - } while (0) - -#define FINAL_SMALL do { \ - unsigned u; \ - sph_u64 *VV = &sc->u.Vb[0][0]; \ - sph_u64 *WW = &W[0][0]; \ - for (u = 0; u < 8; u ++) { \ - VV[u] ^= sph_dec64le_aligned(sc->buf + (u * 8)) \ - ^ sph_dec64le_aligned(sc->buf + (u * 8) + 64) \ - ^ sph_dec64le_aligned(sc->buf + (u * 8) + 128) \ - ^ WW[u] ^ WW[u + 8] \ - ^ WW[u + 16] ^ WW[u + 24]; \ - } \ - } while (0) - -#define FINAL_BIG do { \ - unsigned u; \ - sph_u64 *VV = &sc->u.Vb[0][0]; \ - sph_u64 *WW = &W[0][0]; \ - for (u = 0; u < 16; u ++) { \ - VV[u] ^= sph_dec64le_aligned(sc->buf + (u * 8)) \ - ^ WW[u] ^ WW[u + 16]; \ - } \ - } while (0) - -#define COMPRESS_SMALL(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_SMALL(sc); \ - for (u = 0; u < 8; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_SMALL; \ - } while (0) - -#define COMPRESS_BIG(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_BIG(sc); \ - for (u = 0; u < 10; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_BIG; \ - } while (0) - -#else - -#define DECL_STATE_SMALL \ - sph_u32 W[16][4]; - -#define DECL_STATE_BIG \ - sph_u32 W[16][4]; - -#define INPUT_BLOCK_SMALL(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vs, 16 * sizeof(sph_u32)); \ - for (u = 0; u < 12; u ++) { \ - W[u + 4][0] = sph_dec32le_aligned( \ - sc->buf + 16 * u); \ - W[u + 4][1] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 4); \ - W[u + 4][2] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 8); \ - W[u + 4][3] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 12); \ - } \ - } while (0) - -#define INPUT_BLOCK_BIG(sc) do { \ - unsigned u; \ - memcpy(W, sc->u.Vs, 32 * sizeof(sph_u32)); \ - for (u = 0; u < 8; u ++) { \ - W[u + 8][0] = sph_dec32le_aligned( \ - sc->buf + 16 * u); \ - W[u + 8][1] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 4); \ - W[u + 8][2] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 8); \ - W[u + 8][3] = sph_dec32le_aligned( \ - sc->buf + 16 * u + 12); \ - } \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -aes_2rounds_all(sph_u32 W[16][4], - sph_u32 *pK0, sph_u32 *pK1, sph_u32 *pK2, sph_u32 *pK3) -{ - int n; - sph_u32 K0 = *pK0; - sph_u32 K1 = *pK1; - sph_u32 K2 = *pK2; - sph_u32 K3 = *pK3; - - for (n = 0; n < 16; n ++) { - sph_u32 *X = W[n]; - sph_u32 Y0, Y1, Y2, Y3; - AES_ROUND_LE(X[0], X[1], X[2], X[3], - K0, K1, K2, K3, Y0, Y1, Y2, Y3); - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X[0], X[1], X[2], X[3]); - if ((K0 = T32(K0 + 1)) == 0) { - if ((K1 = T32(K1 + 1)) == 0) - if ((K2 = T32(K2 + 1)) == 0) - K3 = T32(K3 + 1); - } - } - *pK0 = K0; - *pK1 = K1; - *pK2 = K2; - *pK3 = K3; -} - -#define BIG_SUB_WORDS do { \ - aes_2rounds_all(W, &K0, &K1, &K2, &K3); \ - } while (0) - -#else - -#define AES_2ROUNDS(X) do { \ - sph_u32 Y0, Y1, Y2, Y3; \ - AES_ROUND_LE(X[0], X[1], X[2], X[3], \ - K0, K1, K2, K3, Y0, Y1, Y2, Y3); \ - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X[0], X[1], X[2], X[3]); \ - if ((K0 = T32(K0 + 1)) == 0) { \ - if ((K1 = T32(K1 + 1)) == 0) \ - if ((K2 = T32(K2 + 1)) == 0) \ - K3 = T32(K3 + 1); \ - } \ - } while (0) - -#define BIG_SUB_WORDS do { \ - AES_2ROUNDS(W[ 0]); \ - AES_2ROUNDS(W[ 1]); \ - AES_2ROUNDS(W[ 2]); \ - AES_2ROUNDS(W[ 3]); \ - AES_2ROUNDS(W[ 4]); \ - AES_2ROUNDS(W[ 5]); \ - AES_2ROUNDS(W[ 6]); \ - AES_2ROUNDS(W[ 7]); \ - AES_2ROUNDS(W[ 8]); \ - AES_2ROUNDS(W[ 9]); \ - AES_2ROUNDS(W[10]); \ - AES_2ROUNDS(W[11]); \ - AES_2ROUNDS(W[12]); \ - AES_2ROUNDS(W[13]); \ - AES_2ROUNDS(W[14]); \ - AES_2ROUNDS(W[15]); \ - } while (0) - -#endif - -#define SHIFT_ROW1(a, b, c, d) do { \ - sph_u32 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[b][0]; \ - W[b][0] = W[c][0]; \ - W[c][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[b][1]; \ - W[b][1] = W[c][1]; \ - W[c][1] = W[d][1]; \ - W[d][1] = tmp; \ - tmp = W[a][2]; \ - W[a][2] = W[b][2]; \ - W[b][2] = W[c][2]; \ - W[c][2] = W[d][2]; \ - W[d][2] = tmp; \ - tmp = W[a][3]; \ - W[a][3] = W[b][3]; \ - W[b][3] = W[c][3]; \ - W[c][3] = W[d][3]; \ - W[d][3] = tmp; \ - } while (0) - -#define SHIFT_ROW2(a, b, c, d) do { \ - sph_u32 tmp; \ - tmp = W[a][0]; \ - W[a][0] = W[c][0]; \ - W[c][0] = tmp; \ - tmp = W[b][0]; \ - W[b][0] = W[d][0]; \ - W[d][0] = tmp; \ - tmp = W[a][1]; \ - W[a][1] = W[c][1]; \ - W[c][1] = tmp; \ - tmp = W[b][1]; \ - W[b][1] = W[d][1]; \ - W[d][1] = tmp; \ - tmp = W[a][2]; \ - W[a][2] = W[c][2]; \ - W[c][2] = tmp; \ - tmp = W[b][2]; \ - W[b][2] = W[d][2]; \ - W[d][2] = tmp; \ - tmp = W[a][3]; \ - W[a][3] = W[c][3]; \ - W[c][3] = tmp; \ - tmp = W[b][3]; \ - W[b][3] = W[d][3]; \ - W[d][3] = tmp; \ - } while (0) - -#define SHIFT_ROW3(a, b, c, d) SHIFT_ROW1(d, c, b, a) - -#define BIG_SHIFT_ROWS do { \ - SHIFT_ROW1(1, 5, 9, 13); \ - SHIFT_ROW2(2, 6, 10, 14); \ - SHIFT_ROW3(3, 7, 11, 15); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_ECHO - -static void -mix_column(sph_u32 W[16][4], int ia, int ib, int ic, int id) -{ - int n; - - for (n = 0; n < 4; n ++) { - sph_u32 a = W[ia][n]; - sph_u32 b = W[ib][n]; - sph_u32 c = W[ic][n]; - sph_u32 d = W[id][n]; - sph_u32 ab = a ^ b; - sph_u32 bc = b ^ c; - sph_u32 cd = c ^ d; - sph_u32 abx = ((ab & C32(0x80808080)) >> 7) * 27U - ^ ((ab & C32(0x7F7F7F7F)) << 1); - sph_u32 bcx = ((bc & C32(0x80808080)) >> 7) * 27U - ^ ((bc & C32(0x7F7F7F7F)) << 1); - sph_u32 cdx = ((cd & C32(0x80808080)) >> 7) * 27U - ^ ((cd & C32(0x7F7F7F7F)) << 1); - W[ia][n] = abx ^ bc ^ d; - W[ib][n] = bcx ^ a ^ cd; - W[ic][n] = cdx ^ ab ^ d; - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; - } -} - -#define MIX_COLUMN(a, b, c, d) mix_column(W, a, b, c, d) - -#else - -#define MIX_COLUMN1(ia, ib, ic, id, n) do { \ - sph_u32 a = W[ia][n]; \ - sph_u32 b = W[ib][n]; \ - sph_u32 c = W[ic][n]; \ - sph_u32 d = W[id][n]; \ - sph_u32 ab = a ^ b; \ - sph_u32 bc = b ^ c; \ - sph_u32 cd = c ^ d; \ - sph_u32 abx = ((ab & C32(0x80808080)) >> 7) * 27U \ - ^ ((ab & C32(0x7F7F7F7F)) << 1); \ - sph_u32 bcx = ((bc & C32(0x80808080)) >> 7) * 27U \ - ^ ((bc & C32(0x7F7F7F7F)) << 1); \ - sph_u32 cdx = ((cd & C32(0x80808080)) >> 7) * 27U \ - ^ ((cd & C32(0x7F7F7F7F)) << 1); \ - W[ia][n] = abx ^ bc ^ d; \ - W[ib][n] = bcx ^ a ^ cd; \ - W[ic][n] = cdx ^ ab ^ d; \ - W[id][n] = abx ^ bcx ^ cdx ^ ab ^ c; \ - } while (0) - -#define MIX_COLUMN(a, b, c, d) do { \ - MIX_COLUMN1(a, b, c, d, 0); \ - MIX_COLUMN1(a, b, c, d, 1); \ - MIX_COLUMN1(a, b, c, d, 2); \ - MIX_COLUMN1(a, b, c, d, 3); \ - } while (0) - -#endif - -#define BIG_MIX_COLUMNS do { \ - MIX_COLUMN(0, 1, 2, 3); \ - MIX_COLUMN(4, 5, 6, 7); \ - MIX_COLUMN(8, 9, 10, 11); \ - MIX_COLUMN(12, 13, 14, 15); \ - } while (0) - -#define BIG_ROUND do { \ - BIG_SUB_WORDS; \ - BIG_SHIFT_ROWS; \ - BIG_MIX_COLUMNS; \ - } while (0) - -#define FINAL_SMALL do { \ - unsigned u; \ - sph_u32 *VV = &sc->u.Vs[0][0]; \ - sph_u32 *WW = &W[0][0]; \ - for (u = 0; u < 16; u ++) { \ - VV[u] ^= sph_dec32le_aligned(sc->buf + (u * 4)) \ - ^ sph_dec32le_aligned(sc->buf + (u * 4) + 64) \ - ^ sph_dec32le_aligned(sc->buf + (u * 4) + 128) \ - ^ WW[u] ^ WW[u + 16] \ - ^ WW[u + 32] ^ WW[u + 48]; \ - } \ - } while (0) - -#define FINAL_BIG do { \ - unsigned u; \ - sph_u32 *VV = &sc->u.Vs[0][0]; \ - sph_u32 *WW = &W[0][0]; \ - for (u = 0; u < 32; u ++) { \ - VV[u] ^= sph_dec32le_aligned(sc->buf + (u * 4)) \ - ^ WW[u] ^ WW[u + 32]; \ - } \ - } while (0) - -#define COMPRESS_SMALL(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_SMALL(sc); \ - for (u = 0; u < 8; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_SMALL; \ - } while (0) - -#define COMPRESS_BIG(sc) do { \ - sph_u32 K0 = sc->C0; \ - sph_u32 K1 = sc->C1; \ - sph_u32 K2 = sc->C2; \ - sph_u32 K3 = sc->C3; \ - unsigned u; \ - INPUT_BLOCK_BIG(sc); \ - for (u = 0; u < 10; u ++) { \ - BIG_ROUND; \ - } \ - FINAL_BIG; \ - } while (0) - -#endif - -#define INCR_COUNTER(sc, val) do { \ - sc->C0 = T32(sc->C0 + (sph_u32)(val)); \ - if (sc->C0 < (sph_u32)(val)) { \ - if ((sc->C1 = T32(sc->C1 + 1)) == 0) \ - if ((sc->C2 = T32(sc->C2 + 1)) == 0) \ - sc->C3 = T32(sc->C3 + 1); \ - } \ - } while (0) - -static void -echo_small_init(sph_echo_small_context *sc, unsigned out_len) -{ -#if SPH_ECHO_64 - sc->u.Vb[0][0] = (sph_u64)out_len; - sc->u.Vb[0][1] = 0; - sc->u.Vb[1][0] = (sph_u64)out_len; - sc->u.Vb[1][1] = 0; - sc->u.Vb[2][0] = (sph_u64)out_len; - sc->u.Vb[2][1] = 0; - sc->u.Vb[3][0] = (sph_u64)out_len; - sc->u.Vb[3][1] = 0; -#else - sc->u.Vs[0][0] = (sph_u32)out_len; - sc->u.Vs[0][1] = sc->u.Vs[0][2] = sc->u.Vs[0][3] = 0; - sc->u.Vs[1][0] = (sph_u32)out_len; - sc->u.Vs[1][1] = sc->u.Vs[1][2] = sc->u.Vs[1][3] = 0; - sc->u.Vs[2][0] = (sph_u32)out_len; - sc->u.Vs[2][1] = sc->u.Vs[2][2] = sc->u.Vs[2][3] = 0; - sc->u.Vs[3][0] = (sph_u32)out_len; - sc->u.Vs[3][1] = sc->u.Vs[3][2] = sc->u.Vs[3][3] = 0; -#endif - sc->ptr = 0; - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; -} - -static void -echo_big_init(sph_echo_big_context *sc, unsigned out_len) -{ -#if SPH_ECHO_64 - sc->u.Vb[0][0] = (sph_u64)out_len; - sc->u.Vb[0][1] = 0; - sc->u.Vb[1][0] = (sph_u64)out_len; - sc->u.Vb[1][1] = 0; - sc->u.Vb[2][0] = (sph_u64)out_len; - sc->u.Vb[2][1] = 0; - sc->u.Vb[3][0] = (sph_u64)out_len; - sc->u.Vb[3][1] = 0; - sc->u.Vb[4][0] = (sph_u64)out_len; - sc->u.Vb[4][1] = 0; - sc->u.Vb[5][0] = (sph_u64)out_len; - sc->u.Vb[5][1] = 0; - sc->u.Vb[6][0] = (sph_u64)out_len; - sc->u.Vb[6][1] = 0; - sc->u.Vb[7][0] = (sph_u64)out_len; - sc->u.Vb[7][1] = 0; -#else - sc->u.Vs[0][0] = (sph_u32)out_len; - sc->u.Vs[0][1] = sc->u.Vs[0][2] = sc->u.Vs[0][3] = 0; - sc->u.Vs[1][0] = (sph_u32)out_len; - sc->u.Vs[1][1] = sc->u.Vs[1][2] = sc->u.Vs[1][3] = 0; - sc->u.Vs[2][0] = (sph_u32)out_len; - sc->u.Vs[2][1] = sc->u.Vs[2][2] = sc->u.Vs[2][3] = 0; - sc->u.Vs[3][0] = (sph_u32)out_len; - sc->u.Vs[3][1] = sc->u.Vs[3][2] = sc->u.Vs[3][3] = 0; - sc->u.Vs[4][0] = (sph_u32)out_len; - sc->u.Vs[4][1] = sc->u.Vs[4][2] = sc->u.Vs[4][3] = 0; - sc->u.Vs[5][0] = (sph_u32)out_len; - sc->u.Vs[5][1] = sc->u.Vs[5][2] = sc->u.Vs[5][3] = 0; - sc->u.Vs[6][0] = (sph_u32)out_len; - sc->u.Vs[6][1] = sc->u.Vs[6][2] = sc->u.Vs[6][3] = 0; - sc->u.Vs[7][0] = (sph_u32)out_len; - sc->u.Vs[7][1] = sc->u.Vs[7][2] = sc->u.Vs[7][3] = 0; -#endif - sc->ptr = 0; - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; -} - -static void -echo_small_compress(sph_echo_small_context *sc) -{ - DECL_STATE_SMALL - - COMPRESS_SMALL(sc); -} - -static void -echo_big_compress(sph_echo_big_context *sc) -{ - DECL_STATE_BIG - - COMPRESS_BIG(sc); -} - -static void -echo_small_core(sph_echo_small_context *sc, - const unsigned char *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INCR_COUNTER(sc, 1536); - echo_small_compress(sc); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -echo_big_core(sph_echo_big_context *sc, - const unsigned char *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INCR_COUNTER(sc, 1024); - echo_big_compress(sc); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -echo_small_close(sph_echo_small_context *sc, unsigned ub, unsigned n, - void *dst, unsigned out_size_w32) -{ - unsigned char *buf; - size_t ptr; - unsigned z; - unsigned elen; - union { - unsigned char tmp[32]; - sph_u32 dummy; -#if SPH_ECHO_64 - sph_u64 dummy2; -#endif - } u; -#if SPH_ECHO_64 - sph_u64 *VV; -#else - sph_u32 *VV; -#endif - unsigned k; - - buf = sc->buf; - ptr = sc->ptr; - elen = ((unsigned)ptr << 3) + n; - INCR_COUNTER(sc, elen); - sph_enc32le_aligned(u.tmp, sc->C0); - sph_enc32le_aligned(u.tmp + 4, sc->C1); - sph_enc32le_aligned(u.tmp + 8, sc->C2); - sph_enc32le_aligned(u.tmp + 12, sc->C3); - /* - * If elen is zero, then this block actually contains no message - * bit, only the first padding bit. - */ - if (elen == 0) { - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - } - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - if (ptr > ((sizeof sc->buf) - 18)) { - echo_small_compress(sc); - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - memset(buf, 0, sizeof sc->buf); - } - sph_enc16le(buf + (sizeof sc->buf) - 18, out_size_w32 << 5); - memcpy(buf + (sizeof sc->buf) - 16, u.tmp, 16); - echo_small_compress(sc); -#if SPH_ECHO_64 - for (VV = &sc->u.Vb[0][0], k = 0; k < ((out_size_w32 + 1) >> 1); k ++) - sph_enc64le_aligned(u.tmp + (k << 3), VV[k]); -#else - for (VV = &sc->u.Vs[0][0], k = 0; k < out_size_w32; k ++) - sph_enc32le_aligned(u.tmp + (k << 2), VV[k]); -#endif - memcpy(dst, u.tmp, out_size_w32 << 2); - echo_small_init(sc, out_size_w32 << 5); -} - -static void -echo_big_close(sph_echo_big_context *sc, unsigned ub, unsigned n, - void *dst, unsigned out_size_w32) -{ - unsigned char *buf; - size_t ptr; - unsigned z; - unsigned elen; - union { - unsigned char tmp[64]; - sph_u32 dummy; -#if SPH_ECHO_64 - sph_u64 dummy2; -#endif - } u; -#if SPH_ECHO_64 - sph_u64 *VV; -#else - sph_u32 *VV; -#endif - unsigned k; - - buf = sc->buf; - ptr = sc->ptr; - elen = ((unsigned)ptr << 3) + n; - INCR_COUNTER(sc, elen); - sph_enc32le_aligned(u.tmp, sc->C0); - sph_enc32le_aligned(u.tmp + 4, sc->C1); - sph_enc32le_aligned(u.tmp + 8, sc->C2); - sph_enc32le_aligned(u.tmp + 12, sc->C3); - /* - * If elen is zero, then this block actually contains no message - * bit, only the first padding bit. - */ - if (elen == 0) { - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - } - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - if (ptr > ((sizeof sc->buf) - 18)) { - echo_big_compress(sc); - sc->C0 = sc->C1 = sc->C2 = sc->C3 = 0; - memset(buf, 0, sizeof sc->buf); - } - sph_enc16le(buf + (sizeof sc->buf) - 18, out_size_w32 << 5); - memcpy(buf + (sizeof sc->buf) - 16, u.tmp, 16); - echo_big_compress(sc); -#if SPH_ECHO_64 - for (VV = &sc->u.Vb[0][0], k = 0; k < ((out_size_w32 + 1) >> 1); k ++) - sph_enc64le_aligned(u.tmp + (k << 3), VV[k]); -#else - for (VV = &sc->u.Vs[0][0], k = 0; k < out_size_w32; k ++) - sph_enc32le_aligned(u.tmp + (k << 2), VV[k]); -#endif - memcpy(dst, u.tmp, out_size_w32 << 2); - echo_big_init(sc, out_size_w32 << 5); -} - -/* see sph_echo.h */ -void -sph_echo224_init(void *cc) -{ - echo_small_init(cc, 224); -} - -/* see sph_echo.h */ -void -sph_echo224(void *cc, const void *data, size_t len) -{ - echo_small_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo224_close(void *cc, void *dst) -{ - echo_small_close(cc, 0, 0, dst, 7); -} - -/* see sph_echo.h */ -void -sph_echo224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_small_close(cc, ub, n, dst, 7); -} - -/* see sph_echo.h */ -void -sph_echo256_init(void *cc) -{ - echo_small_init(cc, 256); -} - -/* see sph_echo.h */ -void -sph_echo256(void *cc, const void *data, size_t len) -{ - echo_small_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo256_close(void *cc, void *dst) -{ - echo_small_close(cc, 0, 0, dst, 8); -} - -/* see sph_echo.h */ -void -sph_echo256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_small_close(cc, ub, n, dst, 8); -} - -/* see sph_echo.h */ -void -sph_echo384_init(void *cc) -{ - echo_big_init(cc, 384); -} - -/* see sph_echo.h */ -void -sph_echo384(void *cc, const void *data, size_t len) -{ - echo_big_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo384_close(void *cc, void *dst) -{ - echo_big_close(cc, 0, 0, dst, 12); -} - -/* see sph_echo.h */ -void -sph_echo384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_big_close(cc, ub, n, dst, 12); -} - -/* see sph_echo.h */ -void -sph_echo512_init(void *cc) -{ - echo_big_init(cc, 512); -} - -/* see sph_echo.h */ -void -sph_echo512(void *cc, const void *data, size_t len) -{ - echo_big_core(cc, data, len); -} - -/* see sph_echo.h */ -void -sph_echo512_close(void *cc, void *dst) -{ - echo_big_close(cc, 0, 0, dst, 16); -} - -/* see sph_echo.h */ -void -sph_echo512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - echo_big_close(cc, ub, n, dst, 16); -} -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/groestl.c b/src/crypto/groestl.c deleted file mode 100644 index 928bc41ef..000000000 --- a/src/crypto/groestl.c +++ /dev/null @@ -1,3123 +0,0 @@ -/* $Id: groestl.c 260 2011-07-21 01:02:38Z tp $ */ -/* - * Groestl implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_groestl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_GROESTL -#define SPH_SMALL_FOOTPRINT_GROESTL 1 -#endif - -/* - * Apparently, the 32-bit-only version is not faster than the 64-bit - * version unless using the "small footprint" code on a 32-bit machine. - */ -#if !defined SPH_GROESTL_64 -#if SPH_SMALL_FOOTPRINT_GROESTL && !SPH_64_TRUE -#define SPH_GROESTL_64 0 -#else -#define SPH_GROESTL_64 1 -#endif -#endif - -#if !SPH_64 -#undef SPH_GROESTL_64 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -/* - * The internal representation may use either big-endian or - * little-endian. Using the platform default representation speeds up - * encoding and decoding between bytes and the matrix columns. - */ - -#undef USE_LE -#if SPH_GROESTL_LITTLE_ENDIAN -#define USE_LE 1 -#elif SPH_GROESTL_BIG_ENDIAN -#define USE_LE 0 -#elif SPH_LITTLE_ENDIAN -#define USE_LE 1 -#endif - -#if USE_LE - -#define C32e(x) ((SPH_C32(x) >> 24) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) -#define dec32e_aligned sph_dec32le_aligned -#define enc32e sph_enc32le -#define B32_0(x) ((x) & 0xFF) -#define B32_1(x) (((x) >> 8) & 0xFF) -#define B32_2(x) (((x) >> 16) & 0xFF) -#define B32_3(x) ((x) >> 24) - -#define R32u(u, d) SPH_T32(((u) << 16) | ((d) >> 16)) -#define R32d(u, d) SPH_T32(((u) >> 16) | ((d) << 16)) - -#define PC32up(j, r) ((sph_u32)((j) + (r))) -#define PC32dn(j, r) 0 -#define QC32up(j, r) SPH_C32(0xFFFFFFFF) -#define QC32dn(j, r) (((sph_u32)(r) << 24) ^ SPH_T32(~((sph_u32)(j) << 24))) - -#if SPH_64 -#define C64e(x) ((SPH_C64(x) >> 56) \ - | ((SPH_C64(x) >> 40) & SPH_C64(0x000000000000FF00)) \ - | ((SPH_C64(x) >> 24) & SPH_C64(0x0000000000FF0000)) \ - | ((SPH_C64(x) >> 8) & SPH_C64(0x00000000FF000000)) \ - | ((SPH_C64(x) << 8) & SPH_C64(0x000000FF00000000)) \ - | ((SPH_C64(x) << 24) & SPH_C64(0x0000FF0000000000)) \ - | ((SPH_C64(x) << 40) & SPH_C64(0x00FF000000000000)) \ - | ((SPH_C64(x) << 56) & SPH_C64(0xFF00000000000000))) -#define dec64e_aligned sph_dec64le_aligned -#define enc64e sph_enc64le -#define B64_0(x) ((x) & 0xFF) -#define B64_1(x) (((x) >> 8) & 0xFF) -#define B64_2(x) (((x) >> 16) & 0xFF) -#define B64_3(x) (((x) >> 24) & 0xFF) -#define B64_4(x) (((x) >> 32) & 0xFF) -#define B64_5(x) (((x) >> 40) & 0xFF) -#define B64_6(x) (((x) >> 48) & 0xFF) -#define B64_7(x) ((x) >> 56) -#define R64 SPH_ROTL64 -#define PC64(j, r) ((sph_u64)((j) + (r))) -#define QC64(j, r) (((sph_u64)(r) << 56) ^ SPH_T64(~((sph_u64)(j) << 56))) -#endif - -#else - -#define C32e(x) SPH_C32(x) -#define dec32e_aligned sph_dec32be_aligned -#define enc32e sph_enc32be -#define B32_0(x) ((x) >> 24) -#define B32_1(x) (((x) >> 16) & 0xFF) -#define B32_2(x) (((x) >> 8) & 0xFF) -#define B32_3(x) ((x) & 0xFF) - -#define R32u(u, d) SPH_T32(((u) >> 16) | ((d) << 16)) -#define R32d(u, d) SPH_T32(((u) << 16) | ((d) >> 16)) - -#define PC32up(j, r) ((sph_u32)((j) + (r)) << 24) -#define PC32dn(j, r) 0 -#define QC32up(j, r) SPH_C32(0xFFFFFFFF) -#define QC32dn(j, r) ((sph_u32)(r) ^ SPH_T32(~(sph_u32)(j))) - -#if SPH_64 -#define C64e(x) SPH_C64(x) -#define dec64e_aligned sph_dec64be_aligned -#define enc64e sph_enc64be -#define B64_0(x) ((x) >> 56) -#define B64_1(x) (((x) >> 48) & 0xFF) -#define B64_2(x) (((x) >> 40) & 0xFF) -#define B64_3(x) (((x) >> 32) & 0xFF) -#define B64_4(x) (((x) >> 24) & 0xFF) -#define B64_5(x) (((x) >> 16) & 0xFF) -#define B64_6(x) (((x) >> 8) & 0xFF) -#define B64_7(x) ((x) & 0xFF) -#define R64 SPH_ROTR64 -#define PC64(j, r) ((sph_u64)((j) + (r)) << 56) -#define QC64(j, r) ((sph_u64)(r) ^ SPH_T64(~(sph_u64)(j))) -#endif - -#endif - -#if SPH_GROESTL_64 - -static const sph_u64 T0[] = { - C64e(0xc632f4a5f497a5c6), C64e(0xf86f978497eb84f8), - C64e(0xee5eb099b0c799ee), C64e(0xf67a8c8d8cf78df6), - C64e(0xffe8170d17e50dff), C64e(0xd60adcbddcb7bdd6), - C64e(0xde16c8b1c8a7b1de), C64e(0x916dfc54fc395491), - C64e(0x6090f050f0c05060), C64e(0x0207050305040302), - C64e(0xce2ee0a9e087a9ce), C64e(0x56d1877d87ac7d56), - C64e(0xe7cc2b192bd519e7), C64e(0xb513a662a67162b5), - C64e(0x4d7c31e6319ae64d), C64e(0xec59b59ab5c39aec), - C64e(0x8f40cf45cf05458f), C64e(0x1fa3bc9dbc3e9d1f), - C64e(0x8949c040c0094089), C64e(0xfa68928792ef87fa), - C64e(0xefd03f153fc515ef), C64e(0xb29426eb267febb2), - C64e(0x8ece40c94007c98e), C64e(0xfbe61d0b1ded0bfb), - C64e(0x416e2fec2f82ec41), C64e(0xb31aa967a97d67b3), - C64e(0x5f431cfd1cbefd5f), C64e(0x456025ea258aea45), - C64e(0x23f9dabfda46bf23), C64e(0x535102f702a6f753), - C64e(0xe445a196a1d396e4), C64e(0x9b76ed5bed2d5b9b), - C64e(0x75285dc25deac275), C64e(0xe1c5241c24d91ce1), - C64e(0x3dd4e9aee97aae3d), C64e(0x4cf2be6abe986a4c), - C64e(0x6c82ee5aeed85a6c), C64e(0x7ebdc341c3fc417e), - C64e(0xf5f3060206f102f5), C64e(0x8352d14fd11d4f83), - C64e(0x688ce45ce4d05c68), C64e(0x515607f407a2f451), - C64e(0xd18d5c345cb934d1), C64e(0xf9e1180818e908f9), - C64e(0xe24cae93aedf93e2), C64e(0xab3e9573954d73ab), - C64e(0x6297f553f5c45362), C64e(0x2a6b413f41543f2a), - C64e(0x081c140c14100c08), C64e(0x9563f652f6315295), - C64e(0x46e9af65af8c6546), C64e(0x9d7fe25ee2215e9d), - C64e(0x3048782878602830), C64e(0x37cff8a1f86ea137), - C64e(0x0a1b110f11140f0a), C64e(0x2febc4b5c45eb52f), - C64e(0x0e151b091b1c090e), C64e(0x247e5a365a483624), - C64e(0x1badb69bb6369b1b), C64e(0xdf98473d47a53ddf), - C64e(0xcda76a266a8126cd), C64e(0x4ef5bb69bb9c694e), - C64e(0x7f334ccd4cfecd7f), C64e(0xea50ba9fbacf9fea), - C64e(0x123f2d1b2d241b12), C64e(0x1da4b99eb93a9e1d), - C64e(0x58c49c749cb07458), C64e(0x3446722e72682e34), - C64e(0x3641772d776c2d36), C64e(0xdc11cdb2cda3b2dc), - C64e(0xb49d29ee2973eeb4), C64e(0x5b4d16fb16b6fb5b), - C64e(0xa4a501f60153f6a4), C64e(0x76a1d74dd7ec4d76), - C64e(0xb714a361a37561b7), C64e(0x7d3449ce49face7d), - C64e(0x52df8d7b8da47b52), C64e(0xdd9f423e42a13edd), - C64e(0x5ecd937193bc715e), C64e(0x13b1a297a2269713), - C64e(0xa6a204f50457f5a6), C64e(0xb901b868b86968b9), - C64e(0x0000000000000000), C64e(0xc1b5742c74992cc1), - C64e(0x40e0a060a0806040), C64e(0xe3c2211f21dd1fe3), - C64e(0x793a43c843f2c879), C64e(0xb69a2ced2c77edb6), - C64e(0xd40dd9bed9b3bed4), C64e(0x8d47ca46ca01468d), - C64e(0x671770d970ced967), C64e(0x72afdd4bdde44b72), - C64e(0x94ed79de7933de94), C64e(0x98ff67d4672bd498), - C64e(0xb09323e8237be8b0), C64e(0x855bde4ade114a85), - C64e(0xbb06bd6bbd6d6bbb), C64e(0xc5bb7e2a7e912ac5), - C64e(0x4f7b34e5349ee54f), C64e(0xedd73a163ac116ed), - C64e(0x86d254c55417c586), C64e(0x9af862d7622fd79a), - C64e(0x6699ff55ffcc5566), C64e(0x11b6a794a7229411), - C64e(0x8ac04acf4a0fcf8a), C64e(0xe9d9301030c910e9), - C64e(0x040e0a060a080604), C64e(0xfe66988198e781fe), - C64e(0xa0ab0bf00b5bf0a0), C64e(0x78b4cc44ccf04478), - C64e(0x25f0d5bad54aba25), C64e(0x4b753ee33e96e34b), - C64e(0xa2ac0ef30e5ff3a2), C64e(0x5d4419fe19bafe5d), - C64e(0x80db5bc05b1bc080), C64e(0x0580858a850a8a05), - C64e(0x3fd3ecadec7ead3f), C64e(0x21fedfbcdf42bc21), - C64e(0x70a8d848d8e04870), C64e(0xf1fd0c040cf904f1), - C64e(0x63197adf7ac6df63), C64e(0x772f58c158eec177), - C64e(0xaf309f759f4575af), C64e(0x42e7a563a5846342), - C64e(0x2070503050403020), C64e(0xe5cb2e1a2ed11ae5), - C64e(0xfdef120e12e10efd), C64e(0xbf08b76db7656dbf), - C64e(0x8155d44cd4194c81), C64e(0x18243c143c301418), - C64e(0x26795f355f4c3526), C64e(0xc3b2712f719d2fc3), - C64e(0xbe8638e13867e1be), C64e(0x35c8fda2fd6aa235), - C64e(0x88c74fcc4f0bcc88), C64e(0x2e654b394b5c392e), - C64e(0x936af957f93d5793), C64e(0x55580df20daaf255), - C64e(0xfc619d829de382fc), C64e(0x7ab3c947c9f4477a), - C64e(0xc827efacef8bacc8), C64e(0xba8832e7326fe7ba), - C64e(0x324f7d2b7d642b32), C64e(0xe642a495a4d795e6), - C64e(0xc03bfba0fb9ba0c0), C64e(0x19aab398b3329819), - C64e(0x9ef668d16827d19e), C64e(0xa322817f815d7fa3), - C64e(0x44eeaa66aa886644), C64e(0x54d6827e82a87e54), - C64e(0x3bdde6abe676ab3b), C64e(0x0b959e839e16830b), - C64e(0x8cc945ca4503ca8c), C64e(0xc7bc7b297b9529c7), - C64e(0x6b056ed36ed6d36b), C64e(0x286c443c44503c28), - C64e(0xa72c8b798b5579a7), C64e(0xbc813de23d63e2bc), - C64e(0x1631271d272c1d16), C64e(0xad379a769a4176ad), - C64e(0xdb964d3b4dad3bdb), C64e(0x649efa56fac85664), - C64e(0x74a6d24ed2e84e74), C64e(0x1436221e22281e14), - C64e(0x92e476db763fdb92), C64e(0x0c121e0a1e180a0c), - C64e(0x48fcb46cb4906c48), C64e(0xb88f37e4376be4b8), - C64e(0x9f78e75de7255d9f), C64e(0xbd0fb26eb2616ebd), - C64e(0x43692aef2a86ef43), C64e(0xc435f1a6f193a6c4), - C64e(0x39dae3a8e372a839), C64e(0x31c6f7a4f762a431), - C64e(0xd38a593759bd37d3), C64e(0xf274868b86ff8bf2), - C64e(0xd583563256b132d5), C64e(0x8b4ec543c50d438b), - C64e(0x6e85eb59ebdc596e), C64e(0xda18c2b7c2afb7da), - C64e(0x018e8f8c8f028c01), C64e(0xb11dac64ac7964b1), - C64e(0x9cf16dd26d23d29c), C64e(0x49723be03b92e049), - C64e(0xd81fc7b4c7abb4d8), C64e(0xacb915fa1543faac), - C64e(0xf3fa090709fd07f3), C64e(0xcfa06f256f8525cf), - C64e(0xca20eaafea8fafca), C64e(0xf47d898e89f38ef4), - C64e(0x476720e9208ee947), C64e(0x1038281828201810), - C64e(0x6f0b64d564ded56f), C64e(0xf073838883fb88f0), - C64e(0x4afbb16fb1946f4a), C64e(0x5cca967296b8725c), - C64e(0x38546c246c702438), C64e(0x575f08f108aef157), - C64e(0x732152c752e6c773), C64e(0x9764f351f3355197), - C64e(0xcbae6523658d23cb), C64e(0xa125847c84597ca1), - C64e(0xe857bf9cbfcb9ce8), C64e(0x3e5d6321637c213e), - C64e(0x96ea7cdd7c37dd96), C64e(0x611e7fdc7fc2dc61), - C64e(0x0d9c9186911a860d), C64e(0x0f9b9485941e850f), - C64e(0xe04bab90abdb90e0), C64e(0x7cbac642c6f8427c), - C64e(0x712657c457e2c471), C64e(0xcc29e5aae583aacc), - C64e(0x90e373d8733bd890), C64e(0x06090f050f0c0506), - C64e(0xf7f4030103f501f7), C64e(0x1c2a36123638121c), - C64e(0xc23cfea3fe9fa3c2), C64e(0x6a8be15fe1d45f6a), - C64e(0xaebe10f91047f9ae), C64e(0x69026bd06bd2d069), - C64e(0x17bfa891a82e9117), C64e(0x9971e858e8295899), - C64e(0x3a5369276974273a), C64e(0x27f7d0b9d04eb927), - C64e(0xd991483848a938d9), C64e(0xebde351335cd13eb), - C64e(0x2be5ceb3ce56b32b), C64e(0x2277553355443322), - C64e(0xd204d6bbd6bfbbd2), C64e(0xa9399070904970a9), - C64e(0x07878089800e8907), C64e(0x33c1f2a7f266a733), - C64e(0x2decc1b6c15ab62d), C64e(0x3c5a66226678223c), - C64e(0x15b8ad92ad2a9215), C64e(0xc9a96020608920c9), - C64e(0x875cdb49db154987), C64e(0xaab01aff1a4fffaa), - C64e(0x50d8887888a07850), C64e(0xa52b8e7a8e517aa5), - C64e(0x03898a8f8a068f03), C64e(0x594a13f813b2f859), - C64e(0x09929b809b128009), C64e(0x1a2339173934171a), - C64e(0x651075da75cada65), C64e(0xd784533153b531d7), - C64e(0x84d551c65113c684), C64e(0xd003d3b8d3bbb8d0), - C64e(0x82dc5ec35e1fc382), C64e(0x29e2cbb0cb52b029), - C64e(0x5ac3997799b4775a), C64e(0x1e2d3311333c111e), - C64e(0x7b3d46cb46f6cb7b), C64e(0xa8b71ffc1f4bfca8), - C64e(0x6d0c61d661dad66d), C64e(0x2c624e3a4e583a2c) -}; - -#if !SPH_SMALL_FOOTPRINT_GROESTL - -static const sph_u64 T1[] = { - C64e(0xc6c632f4a5f497a5), C64e(0xf8f86f978497eb84), - C64e(0xeeee5eb099b0c799), C64e(0xf6f67a8c8d8cf78d), - C64e(0xffffe8170d17e50d), C64e(0xd6d60adcbddcb7bd), - C64e(0xdede16c8b1c8a7b1), C64e(0x91916dfc54fc3954), - C64e(0x606090f050f0c050), C64e(0x0202070503050403), - C64e(0xcece2ee0a9e087a9), C64e(0x5656d1877d87ac7d), - C64e(0xe7e7cc2b192bd519), C64e(0xb5b513a662a67162), - C64e(0x4d4d7c31e6319ae6), C64e(0xecec59b59ab5c39a), - C64e(0x8f8f40cf45cf0545), C64e(0x1f1fa3bc9dbc3e9d), - C64e(0x898949c040c00940), C64e(0xfafa68928792ef87), - C64e(0xefefd03f153fc515), C64e(0xb2b29426eb267feb), - C64e(0x8e8ece40c94007c9), C64e(0xfbfbe61d0b1ded0b), - C64e(0x41416e2fec2f82ec), C64e(0xb3b31aa967a97d67), - C64e(0x5f5f431cfd1cbefd), C64e(0x45456025ea258aea), - C64e(0x2323f9dabfda46bf), C64e(0x53535102f702a6f7), - C64e(0xe4e445a196a1d396), C64e(0x9b9b76ed5bed2d5b), - C64e(0x7575285dc25deac2), C64e(0xe1e1c5241c24d91c), - C64e(0x3d3dd4e9aee97aae), C64e(0x4c4cf2be6abe986a), - C64e(0x6c6c82ee5aeed85a), C64e(0x7e7ebdc341c3fc41), - C64e(0xf5f5f3060206f102), C64e(0x838352d14fd11d4f), - C64e(0x68688ce45ce4d05c), C64e(0x51515607f407a2f4), - C64e(0xd1d18d5c345cb934), C64e(0xf9f9e1180818e908), - C64e(0xe2e24cae93aedf93), C64e(0xabab3e9573954d73), - C64e(0x626297f553f5c453), C64e(0x2a2a6b413f41543f), - C64e(0x08081c140c14100c), C64e(0x959563f652f63152), - C64e(0x4646e9af65af8c65), C64e(0x9d9d7fe25ee2215e), - C64e(0x3030487828786028), C64e(0x3737cff8a1f86ea1), - C64e(0x0a0a1b110f11140f), C64e(0x2f2febc4b5c45eb5), - C64e(0x0e0e151b091b1c09), C64e(0x24247e5a365a4836), - C64e(0x1b1badb69bb6369b), C64e(0xdfdf98473d47a53d), - C64e(0xcdcda76a266a8126), C64e(0x4e4ef5bb69bb9c69), - C64e(0x7f7f334ccd4cfecd), C64e(0xeaea50ba9fbacf9f), - C64e(0x12123f2d1b2d241b), C64e(0x1d1da4b99eb93a9e), - C64e(0x5858c49c749cb074), C64e(0x343446722e72682e), - C64e(0x363641772d776c2d), C64e(0xdcdc11cdb2cda3b2), - C64e(0xb4b49d29ee2973ee), C64e(0x5b5b4d16fb16b6fb), - C64e(0xa4a4a501f60153f6), C64e(0x7676a1d74dd7ec4d), - C64e(0xb7b714a361a37561), C64e(0x7d7d3449ce49face), - C64e(0x5252df8d7b8da47b), C64e(0xdddd9f423e42a13e), - C64e(0x5e5ecd937193bc71), C64e(0x1313b1a297a22697), - C64e(0xa6a6a204f50457f5), C64e(0xb9b901b868b86968), - C64e(0x0000000000000000), C64e(0xc1c1b5742c74992c), - C64e(0x4040e0a060a08060), C64e(0xe3e3c2211f21dd1f), - C64e(0x79793a43c843f2c8), C64e(0xb6b69a2ced2c77ed), - C64e(0xd4d40dd9bed9b3be), C64e(0x8d8d47ca46ca0146), - C64e(0x67671770d970ced9), C64e(0x7272afdd4bdde44b), - C64e(0x9494ed79de7933de), C64e(0x9898ff67d4672bd4), - C64e(0xb0b09323e8237be8), C64e(0x85855bde4ade114a), - C64e(0xbbbb06bd6bbd6d6b), C64e(0xc5c5bb7e2a7e912a), - C64e(0x4f4f7b34e5349ee5), C64e(0xededd73a163ac116), - C64e(0x8686d254c55417c5), C64e(0x9a9af862d7622fd7), - C64e(0x666699ff55ffcc55), C64e(0x1111b6a794a72294), - C64e(0x8a8ac04acf4a0fcf), C64e(0xe9e9d9301030c910), - C64e(0x04040e0a060a0806), C64e(0xfefe66988198e781), - C64e(0xa0a0ab0bf00b5bf0), C64e(0x7878b4cc44ccf044), - C64e(0x2525f0d5bad54aba), C64e(0x4b4b753ee33e96e3), - C64e(0xa2a2ac0ef30e5ff3), C64e(0x5d5d4419fe19bafe), - C64e(0x8080db5bc05b1bc0), C64e(0x050580858a850a8a), - C64e(0x3f3fd3ecadec7ead), C64e(0x2121fedfbcdf42bc), - C64e(0x7070a8d848d8e048), C64e(0xf1f1fd0c040cf904), - C64e(0x6363197adf7ac6df), C64e(0x77772f58c158eec1), - C64e(0xafaf309f759f4575), C64e(0x4242e7a563a58463), - C64e(0x2020705030504030), C64e(0xe5e5cb2e1a2ed11a), - C64e(0xfdfdef120e12e10e), C64e(0xbfbf08b76db7656d), - C64e(0x818155d44cd4194c), C64e(0x1818243c143c3014), - C64e(0x2626795f355f4c35), C64e(0xc3c3b2712f719d2f), - C64e(0xbebe8638e13867e1), C64e(0x3535c8fda2fd6aa2), - C64e(0x8888c74fcc4f0bcc), C64e(0x2e2e654b394b5c39), - C64e(0x93936af957f93d57), C64e(0x5555580df20daaf2), - C64e(0xfcfc619d829de382), C64e(0x7a7ab3c947c9f447), - C64e(0xc8c827efacef8bac), C64e(0xbaba8832e7326fe7), - C64e(0x32324f7d2b7d642b), C64e(0xe6e642a495a4d795), - C64e(0xc0c03bfba0fb9ba0), C64e(0x1919aab398b33298), - C64e(0x9e9ef668d16827d1), C64e(0xa3a322817f815d7f), - C64e(0x4444eeaa66aa8866), C64e(0x5454d6827e82a87e), - C64e(0x3b3bdde6abe676ab), C64e(0x0b0b959e839e1683), - C64e(0x8c8cc945ca4503ca), C64e(0xc7c7bc7b297b9529), - C64e(0x6b6b056ed36ed6d3), C64e(0x28286c443c44503c), - C64e(0xa7a72c8b798b5579), C64e(0xbcbc813de23d63e2), - C64e(0x161631271d272c1d), C64e(0xadad379a769a4176), - C64e(0xdbdb964d3b4dad3b), C64e(0x64649efa56fac856), - C64e(0x7474a6d24ed2e84e), C64e(0x141436221e22281e), - C64e(0x9292e476db763fdb), C64e(0x0c0c121e0a1e180a), - C64e(0x4848fcb46cb4906c), C64e(0xb8b88f37e4376be4), - C64e(0x9f9f78e75de7255d), C64e(0xbdbd0fb26eb2616e), - C64e(0x4343692aef2a86ef), C64e(0xc4c435f1a6f193a6), - C64e(0x3939dae3a8e372a8), C64e(0x3131c6f7a4f762a4), - C64e(0xd3d38a593759bd37), C64e(0xf2f274868b86ff8b), - C64e(0xd5d583563256b132), C64e(0x8b8b4ec543c50d43), - C64e(0x6e6e85eb59ebdc59), C64e(0xdada18c2b7c2afb7), - C64e(0x01018e8f8c8f028c), C64e(0xb1b11dac64ac7964), - C64e(0x9c9cf16dd26d23d2), C64e(0x4949723be03b92e0), - C64e(0xd8d81fc7b4c7abb4), C64e(0xacacb915fa1543fa), - C64e(0xf3f3fa090709fd07), C64e(0xcfcfa06f256f8525), - C64e(0xcaca20eaafea8faf), C64e(0xf4f47d898e89f38e), - C64e(0x47476720e9208ee9), C64e(0x1010382818282018), - C64e(0x6f6f0b64d564ded5), C64e(0xf0f073838883fb88), - C64e(0x4a4afbb16fb1946f), C64e(0x5c5cca967296b872), - C64e(0x3838546c246c7024), C64e(0x57575f08f108aef1), - C64e(0x73732152c752e6c7), C64e(0x979764f351f33551), - C64e(0xcbcbae6523658d23), C64e(0xa1a125847c84597c), - C64e(0xe8e857bf9cbfcb9c), C64e(0x3e3e5d6321637c21), - C64e(0x9696ea7cdd7c37dd), C64e(0x61611e7fdc7fc2dc), - C64e(0x0d0d9c9186911a86), C64e(0x0f0f9b9485941e85), - C64e(0xe0e04bab90abdb90), C64e(0x7c7cbac642c6f842), - C64e(0x71712657c457e2c4), C64e(0xcccc29e5aae583aa), - C64e(0x9090e373d8733bd8), C64e(0x0606090f050f0c05), - C64e(0xf7f7f4030103f501), C64e(0x1c1c2a3612363812), - C64e(0xc2c23cfea3fe9fa3), C64e(0x6a6a8be15fe1d45f), - C64e(0xaeaebe10f91047f9), C64e(0x6969026bd06bd2d0), - C64e(0x1717bfa891a82e91), C64e(0x999971e858e82958), - C64e(0x3a3a536927697427), C64e(0x2727f7d0b9d04eb9), - C64e(0xd9d991483848a938), C64e(0xebebde351335cd13), - C64e(0x2b2be5ceb3ce56b3), C64e(0x2222775533554433), - C64e(0xd2d204d6bbd6bfbb), C64e(0xa9a9399070904970), - C64e(0x0707878089800e89), C64e(0x3333c1f2a7f266a7), - C64e(0x2d2decc1b6c15ab6), C64e(0x3c3c5a6622667822), - C64e(0x1515b8ad92ad2a92), C64e(0xc9c9a96020608920), - C64e(0x87875cdb49db1549), C64e(0xaaaab01aff1a4fff), - C64e(0x5050d8887888a078), C64e(0xa5a52b8e7a8e517a), - C64e(0x0303898a8f8a068f), C64e(0x59594a13f813b2f8), - C64e(0x0909929b809b1280), C64e(0x1a1a233917393417), - C64e(0x65651075da75cada), C64e(0xd7d784533153b531), - C64e(0x8484d551c65113c6), C64e(0xd0d003d3b8d3bbb8), - C64e(0x8282dc5ec35e1fc3), C64e(0x2929e2cbb0cb52b0), - C64e(0x5a5ac3997799b477), C64e(0x1e1e2d3311333c11), - C64e(0x7b7b3d46cb46f6cb), C64e(0xa8a8b71ffc1f4bfc), - C64e(0x6d6d0c61d661dad6), C64e(0x2c2c624e3a4e583a) -}; - -static const sph_u64 T2[] = { - C64e(0xa5c6c632f4a5f497), C64e(0x84f8f86f978497eb), - C64e(0x99eeee5eb099b0c7), C64e(0x8df6f67a8c8d8cf7), - C64e(0x0dffffe8170d17e5), C64e(0xbdd6d60adcbddcb7), - C64e(0xb1dede16c8b1c8a7), C64e(0x5491916dfc54fc39), - C64e(0x50606090f050f0c0), C64e(0x0302020705030504), - C64e(0xa9cece2ee0a9e087), C64e(0x7d5656d1877d87ac), - C64e(0x19e7e7cc2b192bd5), C64e(0x62b5b513a662a671), - C64e(0xe64d4d7c31e6319a), C64e(0x9aecec59b59ab5c3), - C64e(0x458f8f40cf45cf05), C64e(0x9d1f1fa3bc9dbc3e), - C64e(0x40898949c040c009), C64e(0x87fafa68928792ef), - C64e(0x15efefd03f153fc5), C64e(0xebb2b29426eb267f), - C64e(0xc98e8ece40c94007), C64e(0x0bfbfbe61d0b1ded), - C64e(0xec41416e2fec2f82), C64e(0x67b3b31aa967a97d), - C64e(0xfd5f5f431cfd1cbe), C64e(0xea45456025ea258a), - C64e(0xbf2323f9dabfda46), C64e(0xf753535102f702a6), - C64e(0x96e4e445a196a1d3), C64e(0x5b9b9b76ed5bed2d), - C64e(0xc27575285dc25dea), C64e(0x1ce1e1c5241c24d9), - C64e(0xae3d3dd4e9aee97a), C64e(0x6a4c4cf2be6abe98), - C64e(0x5a6c6c82ee5aeed8), C64e(0x417e7ebdc341c3fc), - C64e(0x02f5f5f3060206f1), C64e(0x4f838352d14fd11d), - C64e(0x5c68688ce45ce4d0), C64e(0xf451515607f407a2), - C64e(0x34d1d18d5c345cb9), C64e(0x08f9f9e1180818e9), - C64e(0x93e2e24cae93aedf), C64e(0x73abab3e9573954d), - C64e(0x53626297f553f5c4), C64e(0x3f2a2a6b413f4154), - C64e(0x0c08081c140c1410), C64e(0x52959563f652f631), - C64e(0x654646e9af65af8c), C64e(0x5e9d9d7fe25ee221), - C64e(0x2830304878287860), C64e(0xa13737cff8a1f86e), - C64e(0x0f0a0a1b110f1114), C64e(0xb52f2febc4b5c45e), - C64e(0x090e0e151b091b1c), C64e(0x3624247e5a365a48), - C64e(0x9b1b1badb69bb636), C64e(0x3ddfdf98473d47a5), - C64e(0x26cdcda76a266a81), C64e(0x694e4ef5bb69bb9c), - C64e(0xcd7f7f334ccd4cfe), C64e(0x9feaea50ba9fbacf), - C64e(0x1b12123f2d1b2d24), C64e(0x9e1d1da4b99eb93a), - C64e(0x745858c49c749cb0), C64e(0x2e343446722e7268), - C64e(0x2d363641772d776c), C64e(0xb2dcdc11cdb2cda3), - C64e(0xeeb4b49d29ee2973), C64e(0xfb5b5b4d16fb16b6), - C64e(0xf6a4a4a501f60153), C64e(0x4d7676a1d74dd7ec), - C64e(0x61b7b714a361a375), C64e(0xce7d7d3449ce49fa), - C64e(0x7b5252df8d7b8da4), C64e(0x3edddd9f423e42a1), - C64e(0x715e5ecd937193bc), C64e(0x971313b1a297a226), - C64e(0xf5a6a6a204f50457), C64e(0x68b9b901b868b869), - C64e(0x0000000000000000), C64e(0x2cc1c1b5742c7499), - C64e(0x604040e0a060a080), C64e(0x1fe3e3c2211f21dd), - C64e(0xc879793a43c843f2), C64e(0xedb6b69a2ced2c77), - C64e(0xbed4d40dd9bed9b3), C64e(0x468d8d47ca46ca01), - C64e(0xd967671770d970ce), C64e(0x4b7272afdd4bdde4), - C64e(0xde9494ed79de7933), C64e(0xd49898ff67d4672b), - C64e(0xe8b0b09323e8237b), C64e(0x4a85855bde4ade11), - C64e(0x6bbbbb06bd6bbd6d), C64e(0x2ac5c5bb7e2a7e91), - C64e(0xe54f4f7b34e5349e), C64e(0x16ededd73a163ac1), - C64e(0xc58686d254c55417), C64e(0xd79a9af862d7622f), - C64e(0x55666699ff55ffcc), C64e(0x941111b6a794a722), - C64e(0xcf8a8ac04acf4a0f), C64e(0x10e9e9d9301030c9), - C64e(0x0604040e0a060a08), C64e(0x81fefe66988198e7), - C64e(0xf0a0a0ab0bf00b5b), C64e(0x447878b4cc44ccf0), - C64e(0xba2525f0d5bad54a), C64e(0xe34b4b753ee33e96), - C64e(0xf3a2a2ac0ef30e5f), C64e(0xfe5d5d4419fe19ba), - C64e(0xc08080db5bc05b1b), C64e(0x8a050580858a850a), - C64e(0xad3f3fd3ecadec7e), C64e(0xbc2121fedfbcdf42), - C64e(0x487070a8d848d8e0), C64e(0x04f1f1fd0c040cf9), - C64e(0xdf6363197adf7ac6), C64e(0xc177772f58c158ee), - C64e(0x75afaf309f759f45), C64e(0x634242e7a563a584), - C64e(0x3020207050305040), C64e(0x1ae5e5cb2e1a2ed1), - C64e(0x0efdfdef120e12e1), C64e(0x6dbfbf08b76db765), - C64e(0x4c818155d44cd419), C64e(0x141818243c143c30), - C64e(0x352626795f355f4c), C64e(0x2fc3c3b2712f719d), - C64e(0xe1bebe8638e13867), C64e(0xa23535c8fda2fd6a), - C64e(0xcc8888c74fcc4f0b), C64e(0x392e2e654b394b5c), - C64e(0x5793936af957f93d), C64e(0xf25555580df20daa), - C64e(0x82fcfc619d829de3), C64e(0x477a7ab3c947c9f4), - C64e(0xacc8c827efacef8b), C64e(0xe7baba8832e7326f), - C64e(0x2b32324f7d2b7d64), C64e(0x95e6e642a495a4d7), - C64e(0xa0c0c03bfba0fb9b), C64e(0x981919aab398b332), - C64e(0xd19e9ef668d16827), C64e(0x7fa3a322817f815d), - C64e(0x664444eeaa66aa88), C64e(0x7e5454d6827e82a8), - C64e(0xab3b3bdde6abe676), C64e(0x830b0b959e839e16), - C64e(0xca8c8cc945ca4503), C64e(0x29c7c7bc7b297b95), - C64e(0xd36b6b056ed36ed6), C64e(0x3c28286c443c4450), - C64e(0x79a7a72c8b798b55), C64e(0xe2bcbc813de23d63), - C64e(0x1d161631271d272c), C64e(0x76adad379a769a41), - C64e(0x3bdbdb964d3b4dad), C64e(0x5664649efa56fac8), - C64e(0x4e7474a6d24ed2e8), C64e(0x1e141436221e2228), - C64e(0xdb9292e476db763f), C64e(0x0a0c0c121e0a1e18), - C64e(0x6c4848fcb46cb490), C64e(0xe4b8b88f37e4376b), - C64e(0x5d9f9f78e75de725), C64e(0x6ebdbd0fb26eb261), - C64e(0xef4343692aef2a86), C64e(0xa6c4c435f1a6f193), - C64e(0xa83939dae3a8e372), C64e(0xa43131c6f7a4f762), - C64e(0x37d3d38a593759bd), C64e(0x8bf2f274868b86ff), - C64e(0x32d5d583563256b1), C64e(0x438b8b4ec543c50d), - C64e(0x596e6e85eb59ebdc), C64e(0xb7dada18c2b7c2af), - C64e(0x8c01018e8f8c8f02), C64e(0x64b1b11dac64ac79), - C64e(0xd29c9cf16dd26d23), C64e(0xe04949723be03b92), - C64e(0xb4d8d81fc7b4c7ab), C64e(0xfaacacb915fa1543), - C64e(0x07f3f3fa090709fd), C64e(0x25cfcfa06f256f85), - C64e(0xafcaca20eaafea8f), C64e(0x8ef4f47d898e89f3), - C64e(0xe947476720e9208e), C64e(0x1810103828182820), - C64e(0xd56f6f0b64d564de), C64e(0x88f0f073838883fb), - C64e(0x6f4a4afbb16fb194), C64e(0x725c5cca967296b8), - C64e(0x243838546c246c70), C64e(0xf157575f08f108ae), - C64e(0xc773732152c752e6), C64e(0x51979764f351f335), - C64e(0x23cbcbae6523658d), C64e(0x7ca1a125847c8459), - C64e(0x9ce8e857bf9cbfcb), C64e(0x213e3e5d6321637c), - C64e(0xdd9696ea7cdd7c37), C64e(0xdc61611e7fdc7fc2), - C64e(0x860d0d9c9186911a), C64e(0x850f0f9b9485941e), - C64e(0x90e0e04bab90abdb), C64e(0x427c7cbac642c6f8), - C64e(0xc471712657c457e2), C64e(0xaacccc29e5aae583), - C64e(0xd89090e373d8733b), C64e(0x050606090f050f0c), - C64e(0x01f7f7f4030103f5), C64e(0x121c1c2a36123638), - C64e(0xa3c2c23cfea3fe9f), C64e(0x5f6a6a8be15fe1d4), - C64e(0xf9aeaebe10f91047), C64e(0xd06969026bd06bd2), - C64e(0x911717bfa891a82e), C64e(0x58999971e858e829), - C64e(0x273a3a5369276974), C64e(0xb92727f7d0b9d04e), - C64e(0x38d9d991483848a9), C64e(0x13ebebde351335cd), - C64e(0xb32b2be5ceb3ce56), C64e(0x3322227755335544), - C64e(0xbbd2d204d6bbd6bf), C64e(0x70a9a93990709049), - C64e(0x890707878089800e), C64e(0xa73333c1f2a7f266), - C64e(0xb62d2decc1b6c15a), C64e(0x223c3c5a66226678), - C64e(0x921515b8ad92ad2a), C64e(0x20c9c9a960206089), - C64e(0x4987875cdb49db15), C64e(0xffaaaab01aff1a4f), - C64e(0x785050d8887888a0), C64e(0x7aa5a52b8e7a8e51), - C64e(0x8f0303898a8f8a06), C64e(0xf859594a13f813b2), - C64e(0x800909929b809b12), C64e(0x171a1a2339173934), - C64e(0xda65651075da75ca), C64e(0x31d7d784533153b5), - C64e(0xc68484d551c65113), C64e(0xb8d0d003d3b8d3bb), - C64e(0xc38282dc5ec35e1f), C64e(0xb02929e2cbb0cb52), - C64e(0x775a5ac3997799b4), C64e(0x111e1e2d3311333c), - C64e(0xcb7b7b3d46cb46f6), C64e(0xfca8a8b71ffc1f4b), - C64e(0xd66d6d0c61d661da), C64e(0x3a2c2c624e3a4e58) -}; - -static const sph_u64 T3[] = { - C64e(0x97a5c6c632f4a5f4), C64e(0xeb84f8f86f978497), - C64e(0xc799eeee5eb099b0), C64e(0xf78df6f67a8c8d8c), - C64e(0xe50dffffe8170d17), C64e(0xb7bdd6d60adcbddc), - C64e(0xa7b1dede16c8b1c8), C64e(0x395491916dfc54fc), - C64e(0xc050606090f050f0), C64e(0x0403020207050305), - C64e(0x87a9cece2ee0a9e0), C64e(0xac7d5656d1877d87), - C64e(0xd519e7e7cc2b192b), C64e(0x7162b5b513a662a6), - C64e(0x9ae64d4d7c31e631), C64e(0xc39aecec59b59ab5), - C64e(0x05458f8f40cf45cf), C64e(0x3e9d1f1fa3bc9dbc), - C64e(0x0940898949c040c0), C64e(0xef87fafa68928792), - C64e(0xc515efefd03f153f), C64e(0x7febb2b29426eb26), - C64e(0x07c98e8ece40c940), C64e(0xed0bfbfbe61d0b1d), - C64e(0x82ec41416e2fec2f), C64e(0x7d67b3b31aa967a9), - C64e(0xbefd5f5f431cfd1c), C64e(0x8aea45456025ea25), - C64e(0x46bf2323f9dabfda), C64e(0xa6f753535102f702), - C64e(0xd396e4e445a196a1), C64e(0x2d5b9b9b76ed5bed), - C64e(0xeac27575285dc25d), C64e(0xd91ce1e1c5241c24), - C64e(0x7aae3d3dd4e9aee9), C64e(0x986a4c4cf2be6abe), - C64e(0xd85a6c6c82ee5aee), C64e(0xfc417e7ebdc341c3), - C64e(0xf102f5f5f3060206), C64e(0x1d4f838352d14fd1), - C64e(0xd05c68688ce45ce4), C64e(0xa2f451515607f407), - C64e(0xb934d1d18d5c345c), C64e(0xe908f9f9e1180818), - C64e(0xdf93e2e24cae93ae), C64e(0x4d73abab3e957395), - C64e(0xc453626297f553f5), C64e(0x543f2a2a6b413f41), - C64e(0x100c08081c140c14), C64e(0x3152959563f652f6), - C64e(0x8c654646e9af65af), C64e(0x215e9d9d7fe25ee2), - C64e(0x6028303048782878), C64e(0x6ea13737cff8a1f8), - C64e(0x140f0a0a1b110f11), C64e(0x5eb52f2febc4b5c4), - C64e(0x1c090e0e151b091b), C64e(0x483624247e5a365a), - C64e(0x369b1b1badb69bb6), C64e(0xa53ddfdf98473d47), - C64e(0x8126cdcda76a266a), C64e(0x9c694e4ef5bb69bb), - C64e(0xfecd7f7f334ccd4c), C64e(0xcf9feaea50ba9fba), - C64e(0x241b12123f2d1b2d), C64e(0x3a9e1d1da4b99eb9), - C64e(0xb0745858c49c749c), C64e(0x682e343446722e72), - C64e(0x6c2d363641772d77), C64e(0xa3b2dcdc11cdb2cd), - C64e(0x73eeb4b49d29ee29), C64e(0xb6fb5b5b4d16fb16), - C64e(0x53f6a4a4a501f601), C64e(0xec4d7676a1d74dd7), - C64e(0x7561b7b714a361a3), C64e(0xface7d7d3449ce49), - C64e(0xa47b5252df8d7b8d), C64e(0xa13edddd9f423e42), - C64e(0xbc715e5ecd937193), C64e(0x26971313b1a297a2), - C64e(0x57f5a6a6a204f504), C64e(0x6968b9b901b868b8), - C64e(0x0000000000000000), C64e(0x992cc1c1b5742c74), - C64e(0x80604040e0a060a0), C64e(0xdd1fe3e3c2211f21), - C64e(0xf2c879793a43c843), C64e(0x77edb6b69a2ced2c), - C64e(0xb3bed4d40dd9bed9), C64e(0x01468d8d47ca46ca), - C64e(0xced967671770d970), C64e(0xe44b7272afdd4bdd), - C64e(0x33de9494ed79de79), C64e(0x2bd49898ff67d467), - C64e(0x7be8b0b09323e823), C64e(0x114a85855bde4ade), - C64e(0x6d6bbbbb06bd6bbd), C64e(0x912ac5c5bb7e2a7e), - C64e(0x9ee54f4f7b34e534), C64e(0xc116ededd73a163a), - C64e(0x17c58686d254c554), C64e(0x2fd79a9af862d762), - C64e(0xcc55666699ff55ff), C64e(0x22941111b6a794a7), - C64e(0x0fcf8a8ac04acf4a), C64e(0xc910e9e9d9301030), - C64e(0x080604040e0a060a), C64e(0xe781fefe66988198), - C64e(0x5bf0a0a0ab0bf00b), C64e(0xf0447878b4cc44cc), - C64e(0x4aba2525f0d5bad5), C64e(0x96e34b4b753ee33e), - C64e(0x5ff3a2a2ac0ef30e), C64e(0xbafe5d5d4419fe19), - C64e(0x1bc08080db5bc05b), C64e(0x0a8a050580858a85), - C64e(0x7ead3f3fd3ecadec), C64e(0x42bc2121fedfbcdf), - C64e(0xe0487070a8d848d8), C64e(0xf904f1f1fd0c040c), - C64e(0xc6df6363197adf7a), C64e(0xeec177772f58c158), - C64e(0x4575afaf309f759f), C64e(0x84634242e7a563a5), - C64e(0x4030202070503050), C64e(0xd11ae5e5cb2e1a2e), - C64e(0xe10efdfdef120e12), C64e(0x656dbfbf08b76db7), - C64e(0x194c818155d44cd4), C64e(0x30141818243c143c), - C64e(0x4c352626795f355f), C64e(0x9d2fc3c3b2712f71), - C64e(0x67e1bebe8638e138), C64e(0x6aa23535c8fda2fd), - C64e(0x0bcc8888c74fcc4f), C64e(0x5c392e2e654b394b), - C64e(0x3d5793936af957f9), C64e(0xaaf25555580df20d), - C64e(0xe382fcfc619d829d), C64e(0xf4477a7ab3c947c9), - C64e(0x8bacc8c827efacef), C64e(0x6fe7baba8832e732), - C64e(0x642b32324f7d2b7d), C64e(0xd795e6e642a495a4), - C64e(0x9ba0c0c03bfba0fb), C64e(0x32981919aab398b3), - C64e(0x27d19e9ef668d168), C64e(0x5d7fa3a322817f81), - C64e(0x88664444eeaa66aa), C64e(0xa87e5454d6827e82), - C64e(0x76ab3b3bdde6abe6), C64e(0x16830b0b959e839e), - C64e(0x03ca8c8cc945ca45), C64e(0x9529c7c7bc7b297b), - C64e(0xd6d36b6b056ed36e), C64e(0x503c28286c443c44), - C64e(0x5579a7a72c8b798b), C64e(0x63e2bcbc813de23d), - C64e(0x2c1d161631271d27), C64e(0x4176adad379a769a), - C64e(0xad3bdbdb964d3b4d), C64e(0xc85664649efa56fa), - C64e(0xe84e7474a6d24ed2), C64e(0x281e141436221e22), - C64e(0x3fdb9292e476db76), C64e(0x180a0c0c121e0a1e), - C64e(0x906c4848fcb46cb4), C64e(0x6be4b8b88f37e437), - C64e(0x255d9f9f78e75de7), C64e(0x616ebdbd0fb26eb2), - C64e(0x86ef4343692aef2a), C64e(0x93a6c4c435f1a6f1), - C64e(0x72a83939dae3a8e3), C64e(0x62a43131c6f7a4f7), - C64e(0xbd37d3d38a593759), C64e(0xff8bf2f274868b86), - C64e(0xb132d5d583563256), C64e(0x0d438b8b4ec543c5), - C64e(0xdc596e6e85eb59eb), C64e(0xafb7dada18c2b7c2), - C64e(0x028c01018e8f8c8f), C64e(0x7964b1b11dac64ac), - C64e(0x23d29c9cf16dd26d), C64e(0x92e04949723be03b), - C64e(0xabb4d8d81fc7b4c7), C64e(0x43faacacb915fa15), - C64e(0xfd07f3f3fa090709), C64e(0x8525cfcfa06f256f), - C64e(0x8fafcaca20eaafea), C64e(0xf38ef4f47d898e89), - C64e(0x8ee947476720e920), C64e(0x2018101038281828), - C64e(0xded56f6f0b64d564), C64e(0xfb88f0f073838883), - C64e(0x946f4a4afbb16fb1), C64e(0xb8725c5cca967296), - C64e(0x70243838546c246c), C64e(0xaef157575f08f108), - C64e(0xe6c773732152c752), C64e(0x3551979764f351f3), - C64e(0x8d23cbcbae652365), C64e(0x597ca1a125847c84), - C64e(0xcb9ce8e857bf9cbf), C64e(0x7c213e3e5d632163), - C64e(0x37dd9696ea7cdd7c), C64e(0xc2dc61611e7fdc7f), - C64e(0x1a860d0d9c918691), C64e(0x1e850f0f9b948594), - C64e(0xdb90e0e04bab90ab), C64e(0xf8427c7cbac642c6), - C64e(0xe2c471712657c457), C64e(0x83aacccc29e5aae5), - C64e(0x3bd89090e373d873), C64e(0x0c050606090f050f), - C64e(0xf501f7f7f4030103), C64e(0x38121c1c2a361236), - C64e(0x9fa3c2c23cfea3fe), C64e(0xd45f6a6a8be15fe1), - C64e(0x47f9aeaebe10f910), C64e(0xd2d06969026bd06b), - C64e(0x2e911717bfa891a8), C64e(0x2958999971e858e8), - C64e(0x74273a3a53692769), C64e(0x4eb92727f7d0b9d0), - C64e(0xa938d9d991483848), C64e(0xcd13ebebde351335), - C64e(0x56b32b2be5ceb3ce), C64e(0x4433222277553355), - C64e(0xbfbbd2d204d6bbd6), C64e(0x4970a9a939907090), - C64e(0x0e89070787808980), C64e(0x66a73333c1f2a7f2), - C64e(0x5ab62d2decc1b6c1), C64e(0x78223c3c5a662266), - C64e(0x2a921515b8ad92ad), C64e(0x8920c9c9a9602060), - C64e(0x154987875cdb49db), C64e(0x4fffaaaab01aff1a), - C64e(0xa0785050d8887888), C64e(0x517aa5a52b8e7a8e), - C64e(0x068f0303898a8f8a), C64e(0xb2f859594a13f813), - C64e(0x12800909929b809b), C64e(0x34171a1a23391739), - C64e(0xcada65651075da75), C64e(0xb531d7d784533153), - C64e(0x13c68484d551c651), C64e(0xbbb8d0d003d3b8d3), - C64e(0x1fc38282dc5ec35e), C64e(0x52b02929e2cbb0cb), - C64e(0xb4775a5ac3997799), C64e(0x3c111e1e2d331133), - C64e(0xf6cb7b7b3d46cb46), C64e(0x4bfca8a8b71ffc1f), - C64e(0xdad66d6d0c61d661), C64e(0x583a2c2c624e3a4e) -}; - -#endif - -static const sph_u64 T4[] = { - C64e(0xf497a5c6c632f4a5), C64e(0x97eb84f8f86f9784), - C64e(0xb0c799eeee5eb099), C64e(0x8cf78df6f67a8c8d), - C64e(0x17e50dffffe8170d), C64e(0xdcb7bdd6d60adcbd), - C64e(0xc8a7b1dede16c8b1), C64e(0xfc395491916dfc54), - C64e(0xf0c050606090f050), C64e(0x0504030202070503), - C64e(0xe087a9cece2ee0a9), C64e(0x87ac7d5656d1877d), - C64e(0x2bd519e7e7cc2b19), C64e(0xa67162b5b513a662), - C64e(0x319ae64d4d7c31e6), C64e(0xb5c39aecec59b59a), - C64e(0xcf05458f8f40cf45), C64e(0xbc3e9d1f1fa3bc9d), - C64e(0xc00940898949c040), C64e(0x92ef87fafa689287), - C64e(0x3fc515efefd03f15), C64e(0x267febb2b29426eb), - C64e(0x4007c98e8ece40c9), C64e(0x1ded0bfbfbe61d0b), - C64e(0x2f82ec41416e2fec), C64e(0xa97d67b3b31aa967), - C64e(0x1cbefd5f5f431cfd), C64e(0x258aea45456025ea), - C64e(0xda46bf2323f9dabf), C64e(0x02a6f753535102f7), - C64e(0xa1d396e4e445a196), C64e(0xed2d5b9b9b76ed5b), - C64e(0x5deac27575285dc2), C64e(0x24d91ce1e1c5241c), - C64e(0xe97aae3d3dd4e9ae), C64e(0xbe986a4c4cf2be6a), - C64e(0xeed85a6c6c82ee5a), C64e(0xc3fc417e7ebdc341), - C64e(0x06f102f5f5f30602), C64e(0xd11d4f838352d14f), - C64e(0xe4d05c68688ce45c), C64e(0x07a2f451515607f4), - C64e(0x5cb934d1d18d5c34), C64e(0x18e908f9f9e11808), - C64e(0xaedf93e2e24cae93), C64e(0x954d73abab3e9573), - C64e(0xf5c453626297f553), C64e(0x41543f2a2a6b413f), - C64e(0x14100c08081c140c), C64e(0xf63152959563f652), - C64e(0xaf8c654646e9af65), C64e(0xe2215e9d9d7fe25e), - C64e(0x7860283030487828), C64e(0xf86ea13737cff8a1), - C64e(0x11140f0a0a1b110f), C64e(0xc45eb52f2febc4b5), - C64e(0x1b1c090e0e151b09), C64e(0x5a483624247e5a36), - C64e(0xb6369b1b1badb69b), C64e(0x47a53ddfdf98473d), - C64e(0x6a8126cdcda76a26), C64e(0xbb9c694e4ef5bb69), - C64e(0x4cfecd7f7f334ccd), C64e(0xbacf9feaea50ba9f), - C64e(0x2d241b12123f2d1b), C64e(0xb93a9e1d1da4b99e), - C64e(0x9cb0745858c49c74), C64e(0x72682e343446722e), - C64e(0x776c2d363641772d), C64e(0xcda3b2dcdc11cdb2), - C64e(0x2973eeb4b49d29ee), C64e(0x16b6fb5b5b4d16fb), - C64e(0x0153f6a4a4a501f6), C64e(0xd7ec4d7676a1d74d), - C64e(0xa37561b7b714a361), C64e(0x49face7d7d3449ce), - C64e(0x8da47b5252df8d7b), C64e(0x42a13edddd9f423e), - C64e(0x93bc715e5ecd9371), C64e(0xa226971313b1a297), - C64e(0x0457f5a6a6a204f5), C64e(0xb86968b9b901b868), - C64e(0x0000000000000000), C64e(0x74992cc1c1b5742c), - C64e(0xa080604040e0a060), C64e(0x21dd1fe3e3c2211f), - C64e(0x43f2c879793a43c8), C64e(0x2c77edb6b69a2ced), - C64e(0xd9b3bed4d40dd9be), C64e(0xca01468d8d47ca46), - C64e(0x70ced967671770d9), C64e(0xdde44b7272afdd4b), - C64e(0x7933de9494ed79de), C64e(0x672bd49898ff67d4), - C64e(0x237be8b0b09323e8), C64e(0xde114a85855bde4a), - C64e(0xbd6d6bbbbb06bd6b), C64e(0x7e912ac5c5bb7e2a), - C64e(0x349ee54f4f7b34e5), C64e(0x3ac116ededd73a16), - C64e(0x5417c58686d254c5), C64e(0x622fd79a9af862d7), - C64e(0xffcc55666699ff55), C64e(0xa722941111b6a794), - C64e(0x4a0fcf8a8ac04acf), C64e(0x30c910e9e9d93010), - C64e(0x0a080604040e0a06), C64e(0x98e781fefe669881), - C64e(0x0b5bf0a0a0ab0bf0), C64e(0xccf0447878b4cc44), - C64e(0xd54aba2525f0d5ba), C64e(0x3e96e34b4b753ee3), - C64e(0x0e5ff3a2a2ac0ef3), C64e(0x19bafe5d5d4419fe), - C64e(0x5b1bc08080db5bc0), C64e(0x850a8a050580858a), - C64e(0xec7ead3f3fd3ecad), C64e(0xdf42bc2121fedfbc), - C64e(0xd8e0487070a8d848), C64e(0x0cf904f1f1fd0c04), - C64e(0x7ac6df6363197adf), C64e(0x58eec177772f58c1), - C64e(0x9f4575afaf309f75), C64e(0xa584634242e7a563), - C64e(0x5040302020705030), C64e(0x2ed11ae5e5cb2e1a), - C64e(0x12e10efdfdef120e), C64e(0xb7656dbfbf08b76d), - C64e(0xd4194c818155d44c), C64e(0x3c30141818243c14), - C64e(0x5f4c352626795f35), C64e(0x719d2fc3c3b2712f), - C64e(0x3867e1bebe8638e1), C64e(0xfd6aa23535c8fda2), - C64e(0x4f0bcc8888c74fcc), C64e(0x4b5c392e2e654b39), - C64e(0xf93d5793936af957), C64e(0x0daaf25555580df2), - C64e(0x9de382fcfc619d82), C64e(0xc9f4477a7ab3c947), - C64e(0xef8bacc8c827efac), C64e(0x326fe7baba8832e7), - C64e(0x7d642b32324f7d2b), C64e(0xa4d795e6e642a495), - C64e(0xfb9ba0c0c03bfba0), C64e(0xb332981919aab398), - C64e(0x6827d19e9ef668d1), C64e(0x815d7fa3a322817f), - C64e(0xaa88664444eeaa66), C64e(0x82a87e5454d6827e), - C64e(0xe676ab3b3bdde6ab), C64e(0x9e16830b0b959e83), - C64e(0x4503ca8c8cc945ca), C64e(0x7b9529c7c7bc7b29), - C64e(0x6ed6d36b6b056ed3), C64e(0x44503c28286c443c), - C64e(0x8b5579a7a72c8b79), C64e(0x3d63e2bcbc813de2), - C64e(0x272c1d161631271d), C64e(0x9a4176adad379a76), - C64e(0x4dad3bdbdb964d3b), C64e(0xfac85664649efa56), - C64e(0xd2e84e7474a6d24e), C64e(0x22281e141436221e), - C64e(0x763fdb9292e476db), C64e(0x1e180a0c0c121e0a), - C64e(0xb4906c4848fcb46c), C64e(0x376be4b8b88f37e4), - C64e(0xe7255d9f9f78e75d), C64e(0xb2616ebdbd0fb26e), - C64e(0x2a86ef4343692aef), C64e(0xf193a6c4c435f1a6), - C64e(0xe372a83939dae3a8), C64e(0xf762a43131c6f7a4), - C64e(0x59bd37d3d38a5937), C64e(0x86ff8bf2f274868b), - C64e(0x56b132d5d5835632), C64e(0xc50d438b8b4ec543), - C64e(0xebdc596e6e85eb59), C64e(0xc2afb7dada18c2b7), - C64e(0x8f028c01018e8f8c), C64e(0xac7964b1b11dac64), - C64e(0x6d23d29c9cf16dd2), C64e(0x3b92e04949723be0), - C64e(0xc7abb4d8d81fc7b4), C64e(0x1543faacacb915fa), - C64e(0x09fd07f3f3fa0907), C64e(0x6f8525cfcfa06f25), - C64e(0xea8fafcaca20eaaf), C64e(0x89f38ef4f47d898e), - C64e(0x208ee947476720e9), C64e(0x2820181010382818), - C64e(0x64ded56f6f0b64d5), C64e(0x83fb88f0f0738388), - C64e(0xb1946f4a4afbb16f), C64e(0x96b8725c5cca9672), - C64e(0x6c70243838546c24), C64e(0x08aef157575f08f1), - C64e(0x52e6c773732152c7), C64e(0xf33551979764f351), - C64e(0x658d23cbcbae6523), C64e(0x84597ca1a125847c), - C64e(0xbfcb9ce8e857bf9c), C64e(0x637c213e3e5d6321), - C64e(0x7c37dd9696ea7cdd), C64e(0x7fc2dc61611e7fdc), - C64e(0x911a860d0d9c9186), C64e(0x941e850f0f9b9485), - C64e(0xabdb90e0e04bab90), C64e(0xc6f8427c7cbac642), - C64e(0x57e2c471712657c4), C64e(0xe583aacccc29e5aa), - C64e(0x733bd89090e373d8), C64e(0x0f0c050606090f05), - C64e(0x03f501f7f7f40301), C64e(0x3638121c1c2a3612), - C64e(0xfe9fa3c2c23cfea3), C64e(0xe1d45f6a6a8be15f), - C64e(0x1047f9aeaebe10f9), C64e(0x6bd2d06969026bd0), - C64e(0xa82e911717bfa891), C64e(0xe82958999971e858), - C64e(0x6974273a3a536927), C64e(0xd04eb92727f7d0b9), - C64e(0x48a938d9d9914838), C64e(0x35cd13ebebde3513), - C64e(0xce56b32b2be5ceb3), C64e(0x5544332222775533), - C64e(0xd6bfbbd2d204d6bb), C64e(0x904970a9a9399070), - C64e(0x800e890707878089), C64e(0xf266a73333c1f2a7), - C64e(0xc15ab62d2decc1b6), C64e(0x6678223c3c5a6622), - C64e(0xad2a921515b8ad92), C64e(0x608920c9c9a96020), - C64e(0xdb154987875cdb49), C64e(0x1a4fffaaaab01aff), - C64e(0x88a0785050d88878), C64e(0x8e517aa5a52b8e7a), - C64e(0x8a068f0303898a8f), C64e(0x13b2f859594a13f8), - C64e(0x9b12800909929b80), C64e(0x3934171a1a233917), - C64e(0x75cada65651075da), C64e(0x53b531d7d7845331), - C64e(0x5113c68484d551c6), C64e(0xd3bbb8d0d003d3b8), - C64e(0x5e1fc38282dc5ec3), C64e(0xcb52b02929e2cbb0), - C64e(0x99b4775a5ac39977), C64e(0x333c111e1e2d3311), - C64e(0x46f6cb7b7b3d46cb), C64e(0x1f4bfca8a8b71ffc), - C64e(0x61dad66d6d0c61d6), C64e(0x4e583a2c2c624e3a) -}; - -#if !SPH_SMALL_FOOTPRINT_GROESTL - -static const sph_u64 T5[] = { - C64e(0xa5f497a5c6c632f4), C64e(0x8497eb84f8f86f97), - C64e(0x99b0c799eeee5eb0), C64e(0x8d8cf78df6f67a8c), - C64e(0x0d17e50dffffe817), C64e(0xbddcb7bdd6d60adc), - C64e(0xb1c8a7b1dede16c8), C64e(0x54fc395491916dfc), - C64e(0x50f0c050606090f0), C64e(0x0305040302020705), - C64e(0xa9e087a9cece2ee0), C64e(0x7d87ac7d5656d187), - C64e(0x192bd519e7e7cc2b), C64e(0x62a67162b5b513a6), - C64e(0xe6319ae64d4d7c31), C64e(0x9ab5c39aecec59b5), - C64e(0x45cf05458f8f40cf), C64e(0x9dbc3e9d1f1fa3bc), - C64e(0x40c00940898949c0), C64e(0x8792ef87fafa6892), - C64e(0x153fc515efefd03f), C64e(0xeb267febb2b29426), - C64e(0xc94007c98e8ece40), C64e(0x0b1ded0bfbfbe61d), - C64e(0xec2f82ec41416e2f), C64e(0x67a97d67b3b31aa9), - C64e(0xfd1cbefd5f5f431c), C64e(0xea258aea45456025), - C64e(0xbfda46bf2323f9da), C64e(0xf702a6f753535102), - C64e(0x96a1d396e4e445a1), C64e(0x5bed2d5b9b9b76ed), - C64e(0xc25deac27575285d), C64e(0x1c24d91ce1e1c524), - C64e(0xaee97aae3d3dd4e9), C64e(0x6abe986a4c4cf2be), - C64e(0x5aeed85a6c6c82ee), C64e(0x41c3fc417e7ebdc3), - C64e(0x0206f102f5f5f306), C64e(0x4fd11d4f838352d1), - C64e(0x5ce4d05c68688ce4), C64e(0xf407a2f451515607), - C64e(0x345cb934d1d18d5c), C64e(0x0818e908f9f9e118), - C64e(0x93aedf93e2e24cae), C64e(0x73954d73abab3e95), - C64e(0x53f5c453626297f5), C64e(0x3f41543f2a2a6b41), - C64e(0x0c14100c08081c14), C64e(0x52f63152959563f6), - C64e(0x65af8c654646e9af), C64e(0x5ee2215e9d9d7fe2), - C64e(0x2878602830304878), C64e(0xa1f86ea13737cff8), - C64e(0x0f11140f0a0a1b11), C64e(0xb5c45eb52f2febc4), - C64e(0x091b1c090e0e151b), C64e(0x365a483624247e5a), - C64e(0x9bb6369b1b1badb6), C64e(0x3d47a53ddfdf9847), - C64e(0x266a8126cdcda76a), C64e(0x69bb9c694e4ef5bb), - C64e(0xcd4cfecd7f7f334c), C64e(0x9fbacf9feaea50ba), - C64e(0x1b2d241b12123f2d), C64e(0x9eb93a9e1d1da4b9), - C64e(0x749cb0745858c49c), C64e(0x2e72682e34344672), - C64e(0x2d776c2d36364177), C64e(0xb2cda3b2dcdc11cd), - C64e(0xee2973eeb4b49d29), C64e(0xfb16b6fb5b5b4d16), - C64e(0xf60153f6a4a4a501), C64e(0x4dd7ec4d7676a1d7), - C64e(0x61a37561b7b714a3), C64e(0xce49face7d7d3449), - C64e(0x7b8da47b5252df8d), C64e(0x3e42a13edddd9f42), - C64e(0x7193bc715e5ecd93), C64e(0x97a226971313b1a2), - C64e(0xf50457f5a6a6a204), C64e(0x68b86968b9b901b8), - C64e(0x0000000000000000), C64e(0x2c74992cc1c1b574), - C64e(0x60a080604040e0a0), C64e(0x1f21dd1fe3e3c221), - C64e(0xc843f2c879793a43), C64e(0xed2c77edb6b69a2c), - C64e(0xbed9b3bed4d40dd9), C64e(0x46ca01468d8d47ca), - C64e(0xd970ced967671770), C64e(0x4bdde44b7272afdd), - C64e(0xde7933de9494ed79), C64e(0xd4672bd49898ff67), - C64e(0xe8237be8b0b09323), C64e(0x4ade114a85855bde), - C64e(0x6bbd6d6bbbbb06bd), C64e(0x2a7e912ac5c5bb7e), - C64e(0xe5349ee54f4f7b34), C64e(0x163ac116ededd73a), - C64e(0xc55417c58686d254), C64e(0xd7622fd79a9af862), - C64e(0x55ffcc55666699ff), C64e(0x94a722941111b6a7), - C64e(0xcf4a0fcf8a8ac04a), C64e(0x1030c910e9e9d930), - C64e(0x060a080604040e0a), C64e(0x8198e781fefe6698), - C64e(0xf00b5bf0a0a0ab0b), C64e(0x44ccf0447878b4cc), - C64e(0xbad54aba2525f0d5), C64e(0xe33e96e34b4b753e), - C64e(0xf30e5ff3a2a2ac0e), C64e(0xfe19bafe5d5d4419), - C64e(0xc05b1bc08080db5b), C64e(0x8a850a8a05058085), - C64e(0xadec7ead3f3fd3ec), C64e(0xbcdf42bc2121fedf), - C64e(0x48d8e0487070a8d8), C64e(0x040cf904f1f1fd0c), - C64e(0xdf7ac6df6363197a), C64e(0xc158eec177772f58), - C64e(0x759f4575afaf309f), C64e(0x63a584634242e7a5), - C64e(0x3050403020207050), C64e(0x1a2ed11ae5e5cb2e), - C64e(0x0e12e10efdfdef12), C64e(0x6db7656dbfbf08b7), - C64e(0x4cd4194c818155d4), C64e(0x143c30141818243c), - C64e(0x355f4c352626795f), C64e(0x2f719d2fc3c3b271), - C64e(0xe13867e1bebe8638), C64e(0xa2fd6aa23535c8fd), - C64e(0xcc4f0bcc8888c74f), C64e(0x394b5c392e2e654b), - C64e(0x57f93d5793936af9), C64e(0xf20daaf25555580d), - C64e(0x829de382fcfc619d), C64e(0x47c9f4477a7ab3c9), - C64e(0xacef8bacc8c827ef), C64e(0xe7326fe7baba8832), - C64e(0x2b7d642b32324f7d), C64e(0x95a4d795e6e642a4), - C64e(0xa0fb9ba0c0c03bfb), C64e(0x98b332981919aab3), - C64e(0xd16827d19e9ef668), C64e(0x7f815d7fa3a32281), - C64e(0x66aa88664444eeaa), C64e(0x7e82a87e5454d682), - C64e(0xabe676ab3b3bdde6), C64e(0x839e16830b0b959e), - C64e(0xca4503ca8c8cc945), C64e(0x297b9529c7c7bc7b), - C64e(0xd36ed6d36b6b056e), C64e(0x3c44503c28286c44), - C64e(0x798b5579a7a72c8b), C64e(0xe23d63e2bcbc813d), - C64e(0x1d272c1d16163127), C64e(0x769a4176adad379a), - C64e(0x3b4dad3bdbdb964d), C64e(0x56fac85664649efa), - C64e(0x4ed2e84e7474a6d2), C64e(0x1e22281e14143622), - C64e(0xdb763fdb9292e476), C64e(0x0a1e180a0c0c121e), - C64e(0x6cb4906c4848fcb4), C64e(0xe4376be4b8b88f37), - C64e(0x5de7255d9f9f78e7), C64e(0x6eb2616ebdbd0fb2), - C64e(0xef2a86ef4343692a), C64e(0xa6f193a6c4c435f1), - C64e(0xa8e372a83939dae3), C64e(0xa4f762a43131c6f7), - C64e(0x3759bd37d3d38a59), C64e(0x8b86ff8bf2f27486), - C64e(0x3256b132d5d58356), C64e(0x43c50d438b8b4ec5), - C64e(0x59ebdc596e6e85eb), C64e(0xb7c2afb7dada18c2), - C64e(0x8c8f028c01018e8f), C64e(0x64ac7964b1b11dac), - C64e(0xd26d23d29c9cf16d), C64e(0xe03b92e04949723b), - C64e(0xb4c7abb4d8d81fc7), C64e(0xfa1543faacacb915), - C64e(0x0709fd07f3f3fa09), C64e(0x256f8525cfcfa06f), - C64e(0xafea8fafcaca20ea), C64e(0x8e89f38ef4f47d89), - C64e(0xe9208ee947476720), C64e(0x1828201810103828), - C64e(0xd564ded56f6f0b64), C64e(0x8883fb88f0f07383), - C64e(0x6fb1946f4a4afbb1), C64e(0x7296b8725c5cca96), - C64e(0x246c70243838546c), C64e(0xf108aef157575f08), - C64e(0xc752e6c773732152), C64e(0x51f33551979764f3), - C64e(0x23658d23cbcbae65), C64e(0x7c84597ca1a12584), - C64e(0x9cbfcb9ce8e857bf), C64e(0x21637c213e3e5d63), - C64e(0xdd7c37dd9696ea7c), C64e(0xdc7fc2dc61611e7f), - C64e(0x86911a860d0d9c91), C64e(0x85941e850f0f9b94), - C64e(0x90abdb90e0e04bab), C64e(0x42c6f8427c7cbac6), - C64e(0xc457e2c471712657), C64e(0xaae583aacccc29e5), - C64e(0xd8733bd89090e373), C64e(0x050f0c050606090f), - C64e(0x0103f501f7f7f403), C64e(0x123638121c1c2a36), - C64e(0xa3fe9fa3c2c23cfe), C64e(0x5fe1d45f6a6a8be1), - C64e(0xf91047f9aeaebe10), C64e(0xd06bd2d06969026b), - C64e(0x91a82e911717bfa8), C64e(0x58e82958999971e8), - C64e(0x276974273a3a5369), C64e(0xb9d04eb92727f7d0), - C64e(0x3848a938d9d99148), C64e(0x1335cd13ebebde35), - C64e(0xb3ce56b32b2be5ce), C64e(0x3355443322227755), - C64e(0xbbd6bfbbd2d204d6), C64e(0x70904970a9a93990), - C64e(0x89800e8907078780), C64e(0xa7f266a73333c1f2), - C64e(0xb6c15ab62d2decc1), C64e(0x226678223c3c5a66), - C64e(0x92ad2a921515b8ad), C64e(0x20608920c9c9a960), - C64e(0x49db154987875cdb), C64e(0xff1a4fffaaaab01a), - C64e(0x7888a0785050d888), C64e(0x7a8e517aa5a52b8e), - C64e(0x8f8a068f0303898a), C64e(0xf813b2f859594a13), - C64e(0x809b12800909929b), C64e(0x173934171a1a2339), - C64e(0xda75cada65651075), C64e(0x3153b531d7d78453), - C64e(0xc65113c68484d551), C64e(0xb8d3bbb8d0d003d3), - C64e(0xc35e1fc38282dc5e), C64e(0xb0cb52b02929e2cb), - C64e(0x7799b4775a5ac399), C64e(0x11333c111e1e2d33), - C64e(0xcb46f6cb7b7b3d46), C64e(0xfc1f4bfca8a8b71f), - C64e(0xd661dad66d6d0c61), C64e(0x3a4e583a2c2c624e) -}; - -static const sph_u64 T6[] = { - C64e(0xf4a5f497a5c6c632), C64e(0x978497eb84f8f86f), - C64e(0xb099b0c799eeee5e), C64e(0x8c8d8cf78df6f67a), - C64e(0x170d17e50dffffe8), C64e(0xdcbddcb7bdd6d60a), - C64e(0xc8b1c8a7b1dede16), C64e(0xfc54fc395491916d), - C64e(0xf050f0c050606090), C64e(0x0503050403020207), - C64e(0xe0a9e087a9cece2e), C64e(0x877d87ac7d5656d1), - C64e(0x2b192bd519e7e7cc), C64e(0xa662a67162b5b513), - C64e(0x31e6319ae64d4d7c), C64e(0xb59ab5c39aecec59), - C64e(0xcf45cf05458f8f40), C64e(0xbc9dbc3e9d1f1fa3), - C64e(0xc040c00940898949), C64e(0x928792ef87fafa68), - C64e(0x3f153fc515efefd0), C64e(0x26eb267febb2b294), - C64e(0x40c94007c98e8ece), C64e(0x1d0b1ded0bfbfbe6), - C64e(0x2fec2f82ec41416e), C64e(0xa967a97d67b3b31a), - C64e(0x1cfd1cbefd5f5f43), C64e(0x25ea258aea454560), - C64e(0xdabfda46bf2323f9), C64e(0x02f702a6f7535351), - C64e(0xa196a1d396e4e445), C64e(0xed5bed2d5b9b9b76), - C64e(0x5dc25deac2757528), C64e(0x241c24d91ce1e1c5), - C64e(0xe9aee97aae3d3dd4), C64e(0xbe6abe986a4c4cf2), - C64e(0xee5aeed85a6c6c82), C64e(0xc341c3fc417e7ebd), - C64e(0x060206f102f5f5f3), C64e(0xd14fd11d4f838352), - C64e(0xe45ce4d05c68688c), C64e(0x07f407a2f4515156), - C64e(0x5c345cb934d1d18d), C64e(0x180818e908f9f9e1), - C64e(0xae93aedf93e2e24c), C64e(0x9573954d73abab3e), - C64e(0xf553f5c453626297), C64e(0x413f41543f2a2a6b), - C64e(0x140c14100c08081c), C64e(0xf652f63152959563), - C64e(0xaf65af8c654646e9), C64e(0xe25ee2215e9d9d7f), - C64e(0x7828786028303048), C64e(0xf8a1f86ea13737cf), - C64e(0x110f11140f0a0a1b), C64e(0xc4b5c45eb52f2feb), - C64e(0x1b091b1c090e0e15), C64e(0x5a365a483624247e), - C64e(0xb69bb6369b1b1bad), C64e(0x473d47a53ddfdf98), - C64e(0x6a266a8126cdcda7), C64e(0xbb69bb9c694e4ef5), - C64e(0x4ccd4cfecd7f7f33), C64e(0xba9fbacf9feaea50), - C64e(0x2d1b2d241b12123f), C64e(0xb99eb93a9e1d1da4), - C64e(0x9c749cb0745858c4), C64e(0x722e72682e343446), - C64e(0x772d776c2d363641), C64e(0xcdb2cda3b2dcdc11), - C64e(0x29ee2973eeb4b49d), C64e(0x16fb16b6fb5b5b4d), - C64e(0x01f60153f6a4a4a5), C64e(0xd74dd7ec4d7676a1), - C64e(0xa361a37561b7b714), C64e(0x49ce49face7d7d34), - C64e(0x8d7b8da47b5252df), C64e(0x423e42a13edddd9f), - C64e(0x937193bc715e5ecd), C64e(0xa297a226971313b1), - C64e(0x04f50457f5a6a6a2), C64e(0xb868b86968b9b901), - C64e(0x0000000000000000), C64e(0x742c74992cc1c1b5), - C64e(0xa060a080604040e0), C64e(0x211f21dd1fe3e3c2), - C64e(0x43c843f2c879793a), C64e(0x2ced2c77edb6b69a), - C64e(0xd9bed9b3bed4d40d), C64e(0xca46ca01468d8d47), - C64e(0x70d970ced9676717), C64e(0xdd4bdde44b7272af), - C64e(0x79de7933de9494ed), C64e(0x67d4672bd49898ff), - C64e(0x23e8237be8b0b093), C64e(0xde4ade114a85855b), - C64e(0xbd6bbd6d6bbbbb06), C64e(0x7e2a7e912ac5c5bb), - C64e(0x34e5349ee54f4f7b), C64e(0x3a163ac116ededd7), - C64e(0x54c55417c58686d2), C64e(0x62d7622fd79a9af8), - C64e(0xff55ffcc55666699), C64e(0xa794a722941111b6), - C64e(0x4acf4a0fcf8a8ac0), C64e(0x301030c910e9e9d9), - C64e(0x0a060a080604040e), C64e(0x988198e781fefe66), - C64e(0x0bf00b5bf0a0a0ab), C64e(0xcc44ccf0447878b4), - C64e(0xd5bad54aba2525f0), C64e(0x3ee33e96e34b4b75), - C64e(0x0ef30e5ff3a2a2ac), C64e(0x19fe19bafe5d5d44), - C64e(0x5bc05b1bc08080db), C64e(0x858a850a8a050580), - C64e(0xecadec7ead3f3fd3), C64e(0xdfbcdf42bc2121fe), - C64e(0xd848d8e0487070a8), C64e(0x0c040cf904f1f1fd), - C64e(0x7adf7ac6df636319), C64e(0x58c158eec177772f), - C64e(0x9f759f4575afaf30), C64e(0xa563a584634242e7), - C64e(0x5030504030202070), C64e(0x2e1a2ed11ae5e5cb), - C64e(0x120e12e10efdfdef), C64e(0xb76db7656dbfbf08), - C64e(0xd44cd4194c818155), C64e(0x3c143c3014181824), - C64e(0x5f355f4c35262679), C64e(0x712f719d2fc3c3b2), - C64e(0x38e13867e1bebe86), C64e(0xfda2fd6aa23535c8), - C64e(0x4fcc4f0bcc8888c7), C64e(0x4b394b5c392e2e65), - C64e(0xf957f93d5793936a), C64e(0x0df20daaf2555558), - C64e(0x9d829de382fcfc61), C64e(0xc947c9f4477a7ab3), - C64e(0xefacef8bacc8c827), C64e(0x32e7326fe7baba88), - C64e(0x7d2b7d642b32324f), C64e(0xa495a4d795e6e642), - C64e(0xfba0fb9ba0c0c03b), C64e(0xb398b332981919aa), - C64e(0x68d16827d19e9ef6), C64e(0x817f815d7fa3a322), - C64e(0xaa66aa88664444ee), C64e(0x827e82a87e5454d6), - C64e(0xe6abe676ab3b3bdd), C64e(0x9e839e16830b0b95), - C64e(0x45ca4503ca8c8cc9), C64e(0x7b297b9529c7c7bc), - C64e(0x6ed36ed6d36b6b05), C64e(0x443c44503c28286c), - C64e(0x8b798b5579a7a72c), C64e(0x3de23d63e2bcbc81), - C64e(0x271d272c1d161631), C64e(0x9a769a4176adad37), - C64e(0x4d3b4dad3bdbdb96), C64e(0xfa56fac85664649e), - C64e(0xd24ed2e84e7474a6), C64e(0x221e22281e141436), - C64e(0x76db763fdb9292e4), C64e(0x1e0a1e180a0c0c12), - C64e(0xb46cb4906c4848fc), C64e(0x37e4376be4b8b88f), - C64e(0xe75de7255d9f9f78), C64e(0xb26eb2616ebdbd0f), - C64e(0x2aef2a86ef434369), C64e(0xf1a6f193a6c4c435), - C64e(0xe3a8e372a83939da), C64e(0xf7a4f762a43131c6), - C64e(0x593759bd37d3d38a), C64e(0x868b86ff8bf2f274), - C64e(0x563256b132d5d583), C64e(0xc543c50d438b8b4e), - C64e(0xeb59ebdc596e6e85), C64e(0xc2b7c2afb7dada18), - C64e(0x8f8c8f028c01018e), C64e(0xac64ac7964b1b11d), - C64e(0x6dd26d23d29c9cf1), C64e(0x3be03b92e0494972), - C64e(0xc7b4c7abb4d8d81f), C64e(0x15fa1543faacacb9), - C64e(0x090709fd07f3f3fa), C64e(0x6f256f8525cfcfa0), - C64e(0xeaafea8fafcaca20), C64e(0x898e89f38ef4f47d), - C64e(0x20e9208ee9474767), C64e(0x2818282018101038), - C64e(0x64d564ded56f6f0b), C64e(0x838883fb88f0f073), - C64e(0xb16fb1946f4a4afb), C64e(0x967296b8725c5cca), - C64e(0x6c246c7024383854), C64e(0x08f108aef157575f), - C64e(0x52c752e6c7737321), C64e(0xf351f33551979764), - C64e(0x6523658d23cbcbae), C64e(0x847c84597ca1a125), - C64e(0xbf9cbfcb9ce8e857), C64e(0x6321637c213e3e5d), - C64e(0x7cdd7c37dd9696ea), C64e(0x7fdc7fc2dc61611e), - C64e(0x9186911a860d0d9c), C64e(0x9485941e850f0f9b), - C64e(0xab90abdb90e0e04b), C64e(0xc642c6f8427c7cba), - C64e(0x57c457e2c4717126), C64e(0xe5aae583aacccc29), - C64e(0x73d8733bd89090e3), C64e(0x0f050f0c05060609), - C64e(0x030103f501f7f7f4), C64e(0x36123638121c1c2a), - C64e(0xfea3fe9fa3c2c23c), C64e(0xe15fe1d45f6a6a8b), - C64e(0x10f91047f9aeaebe), C64e(0x6bd06bd2d0696902), - C64e(0xa891a82e911717bf), C64e(0xe858e82958999971), - C64e(0x69276974273a3a53), C64e(0xd0b9d04eb92727f7), - C64e(0x483848a938d9d991), C64e(0x351335cd13ebebde), - C64e(0xceb3ce56b32b2be5), C64e(0x5533554433222277), - C64e(0xd6bbd6bfbbd2d204), C64e(0x9070904970a9a939), - C64e(0x8089800e89070787), C64e(0xf2a7f266a73333c1), - C64e(0xc1b6c15ab62d2dec), C64e(0x66226678223c3c5a), - C64e(0xad92ad2a921515b8), C64e(0x6020608920c9c9a9), - C64e(0xdb49db154987875c), C64e(0x1aff1a4fffaaaab0), - C64e(0x887888a0785050d8), C64e(0x8e7a8e517aa5a52b), - C64e(0x8a8f8a068f030389), C64e(0x13f813b2f859594a), - C64e(0x9b809b1280090992), C64e(0x39173934171a1a23), - C64e(0x75da75cada656510), C64e(0x533153b531d7d784), - C64e(0x51c65113c68484d5), C64e(0xd3b8d3bbb8d0d003), - C64e(0x5ec35e1fc38282dc), C64e(0xcbb0cb52b02929e2), - C64e(0x997799b4775a5ac3), C64e(0x3311333c111e1e2d), - C64e(0x46cb46f6cb7b7b3d), C64e(0x1ffc1f4bfca8a8b7), - C64e(0x61d661dad66d6d0c), C64e(0x4e3a4e583a2c2c62) -}; - -static const sph_u64 T7[] = { - C64e(0x32f4a5f497a5c6c6), C64e(0x6f978497eb84f8f8), - C64e(0x5eb099b0c799eeee), C64e(0x7a8c8d8cf78df6f6), - C64e(0xe8170d17e50dffff), C64e(0x0adcbddcb7bdd6d6), - C64e(0x16c8b1c8a7b1dede), C64e(0x6dfc54fc39549191), - C64e(0x90f050f0c0506060), C64e(0x0705030504030202), - C64e(0x2ee0a9e087a9cece), C64e(0xd1877d87ac7d5656), - C64e(0xcc2b192bd519e7e7), C64e(0x13a662a67162b5b5), - C64e(0x7c31e6319ae64d4d), C64e(0x59b59ab5c39aecec), - C64e(0x40cf45cf05458f8f), C64e(0xa3bc9dbc3e9d1f1f), - C64e(0x49c040c009408989), C64e(0x68928792ef87fafa), - C64e(0xd03f153fc515efef), C64e(0x9426eb267febb2b2), - C64e(0xce40c94007c98e8e), C64e(0xe61d0b1ded0bfbfb), - C64e(0x6e2fec2f82ec4141), C64e(0x1aa967a97d67b3b3), - C64e(0x431cfd1cbefd5f5f), C64e(0x6025ea258aea4545), - C64e(0xf9dabfda46bf2323), C64e(0x5102f702a6f75353), - C64e(0x45a196a1d396e4e4), C64e(0x76ed5bed2d5b9b9b), - C64e(0x285dc25deac27575), C64e(0xc5241c24d91ce1e1), - C64e(0xd4e9aee97aae3d3d), C64e(0xf2be6abe986a4c4c), - C64e(0x82ee5aeed85a6c6c), C64e(0xbdc341c3fc417e7e), - C64e(0xf3060206f102f5f5), C64e(0x52d14fd11d4f8383), - C64e(0x8ce45ce4d05c6868), C64e(0x5607f407a2f45151), - C64e(0x8d5c345cb934d1d1), C64e(0xe1180818e908f9f9), - C64e(0x4cae93aedf93e2e2), C64e(0x3e9573954d73abab), - C64e(0x97f553f5c4536262), C64e(0x6b413f41543f2a2a), - C64e(0x1c140c14100c0808), C64e(0x63f652f631529595), - C64e(0xe9af65af8c654646), C64e(0x7fe25ee2215e9d9d), - C64e(0x4878287860283030), C64e(0xcff8a1f86ea13737), - C64e(0x1b110f11140f0a0a), C64e(0xebc4b5c45eb52f2f), - C64e(0x151b091b1c090e0e), C64e(0x7e5a365a48362424), - C64e(0xadb69bb6369b1b1b), C64e(0x98473d47a53ddfdf), - C64e(0xa76a266a8126cdcd), C64e(0xf5bb69bb9c694e4e), - C64e(0x334ccd4cfecd7f7f), C64e(0x50ba9fbacf9feaea), - C64e(0x3f2d1b2d241b1212), C64e(0xa4b99eb93a9e1d1d), - C64e(0xc49c749cb0745858), C64e(0x46722e72682e3434), - C64e(0x41772d776c2d3636), C64e(0x11cdb2cda3b2dcdc), - C64e(0x9d29ee2973eeb4b4), C64e(0x4d16fb16b6fb5b5b), - C64e(0xa501f60153f6a4a4), C64e(0xa1d74dd7ec4d7676), - C64e(0x14a361a37561b7b7), C64e(0x3449ce49face7d7d), - C64e(0xdf8d7b8da47b5252), C64e(0x9f423e42a13edddd), - C64e(0xcd937193bc715e5e), C64e(0xb1a297a226971313), - C64e(0xa204f50457f5a6a6), C64e(0x01b868b86968b9b9), - C64e(0x0000000000000000), C64e(0xb5742c74992cc1c1), - C64e(0xe0a060a080604040), C64e(0xc2211f21dd1fe3e3), - C64e(0x3a43c843f2c87979), C64e(0x9a2ced2c77edb6b6), - C64e(0x0dd9bed9b3bed4d4), C64e(0x47ca46ca01468d8d), - C64e(0x1770d970ced96767), C64e(0xafdd4bdde44b7272), - C64e(0xed79de7933de9494), C64e(0xff67d4672bd49898), - C64e(0x9323e8237be8b0b0), C64e(0x5bde4ade114a8585), - C64e(0x06bd6bbd6d6bbbbb), C64e(0xbb7e2a7e912ac5c5), - C64e(0x7b34e5349ee54f4f), C64e(0xd73a163ac116eded), - C64e(0xd254c55417c58686), C64e(0xf862d7622fd79a9a), - C64e(0x99ff55ffcc556666), C64e(0xb6a794a722941111), - C64e(0xc04acf4a0fcf8a8a), C64e(0xd9301030c910e9e9), - C64e(0x0e0a060a08060404), C64e(0x66988198e781fefe), - C64e(0xab0bf00b5bf0a0a0), C64e(0xb4cc44ccf0447878), - C64e(0xf0d5bad54aba2525), C64e(0x753ee33e96e34b4b), - C64e(0xac0ef30e5ff3a2a2), C64e(0x4419fe19bafe5d5d), - C64e(0xdb5bc05b1bc08080), C64e(0x80858a850a8a0505), - C64e(0xd3ecadec7ead3f3f), C64e(0xfedfbcdf42bc2121), - C64e(0xa8d848d8e0487070), C64e(0xfd0c040cf904f1f1), - C64e(0x197adf7ac6df6363), C64e(0x2f58c158eec17777), - C64e(0x309f759f4575afaf), C64e(0xe7a563a584634242), - C64e(0x7050305040302020), C64e(0xcb2e1a2ed11ae5e5), - C64e(0xef120e12e10efdfd), C64e(0x08b76db7656dbfbf), - C64e(0x55d44cd4194c8181), C64e(0x243c143c30141818), - C64e(0x795f355f4c352626), C64e(0xb2712f719d2fc3c3), - C64e(0x8638e13867e1bebe), C64e(0xc8fda2fd6aa23535), - C64e(0xc74fcc4f0bcc8888), C64e(0x654b394b5c392e2e), - C64e(0x6af957f93d579393), C64e(0x580df20daaf25555), - C64e(0x619d829de382fcfc), C64e(0xb3c947c9f4477a7a), - C64e(0x27efacef8bacc8c8), C64e(0x8832e7326fe7baba), - C64e(0x4f7d2b7d642b3232), C64e(0x42a495a4d795e6e6), - C64e(0x3bfba0fb9ba0c0c0), C64e(0xaab398b332981919), - C64e(0xf668d16827d19e9e), C64e(0x22817f815d7fa3a3), - C64e(0xeeaa66aa88664444), C64e(0xd6827e82a87e5454), - C64e(0xdde6abe676ab3b3b), C64e(0x959e839e16830b0b), - C64e(0xc945ca4503ca8c8c), C64e(0xbc7b297b9529c7c7), - C64e(0x056ed36ed6d36b6b), C64e(0x6c443c44503c2828), - C64e(0x2c8b798b5579a7a7), C64e(0x813de23d63e2bcbc), - C64e(0x31271d272c1d1616), C64e(0x379a769a4176adad), - C64e(0x964d3b4dad3bdbdb), C64e(0x9efa56fac8566464), - C64e(0xa6d24ed2e84e7474), C64e(0x36221e22281e1414), - C64e(0xe476db763fdb9292), C64e(0x121e0a1e180a0c0c), - C64e(0xfcb46cb4906c4848), C64e(0x8f37e4376be4b8b8), - C64e(0x78e75de7255d9f9f), C64e(0x0fb26eb2616ebdbd), - C64e(0x692aef2a86ef4343), C64e(0x35f1a6f193a6c4c4), - C64e(0xdae3a8e372a83939), C64e(0xc6f7a4f762a43131), - C64e(0x8a593759bd37d3d3), C64e(0x74868b86ff8bf2f2), - C64e(0x83563256b132d5d5), C64e(0x4ec543c50d438b8b), - C64e(0x85eb59ebdc596e6e), C64e(0x18c2b7c2afb7dada), - C64e(0x8e8f8c8f028c0101), C64e(0x1dac64ac7964b1b1), - C64e(0xf16dd26d23d29c9c), C64e(0x723be03b92e04949), - C64e(0x1fc7b4c7abb4d8d8), C64e(0xb915fa1543faacac), - C64e(0xfa090709fd07f3f3), C64e(0xa06f256f8525cfcf), - C64e(0x20eaafea8fafcaca), C64e(0x7d898e89f38ef4f4), - C64e(0x6720e9208ee94747), C64e(0x3828182820181010), - C64e(0x0b64d564ded56f6f), C64e(0x73838883fb88f0f0), - C64e(0xfbb16fb1946f4a4a), C64e(0xca967296b8725c5c), - C64e(0x546c246c70243838), C64e(0x5f08f108aef15757), - C64e(0x2152c752e6c77373), C64e(0x64f351f335519797), - C64e(0xae6523658d23cbcb), C64e(0x25847c84597ca1a1), - C64e(0x57bf9cbfcb9ce8e8), C64e(0x5d6321637c213e3e), - C64e(0xea7cdd7c37dd9696), C64e(0x1e7fdc7fc2dc6161), - C64e(0x9c9186911a860d0d), C64e(0x9b9485941e850f0f), - C64e(0x4bab90abdb90e0e0), C64e(0xbac642c6f8427c7c), - C64e(0x2657c457e2c47171), C64e(0x29e5aae583aacccc), - C64e(0xe373d8733bd89090), C64e(0x090f050f0c050606), - C64e(0xf4030103f501f7f7), C64e(0x2a36123638121c1c), - C64e(0x3cfea3fe9fa3c2c2), C64e(0x8be15fe1d45f6a6a), - C64e(0xbe10f91047f9aeae), C64e(0x026bd06bd2d06969), - C64e(0xbfa891a82e911717), C64e(0x71e858e829589999), - C64e(0x5369276974273a3a), C64e(0xf7d0b9d04eb92727), - C64e(0x91483848a938d9d9), C64e(0xde351335cd13ebeb), - C64e(0xe5ceb3ce56b32b2b), C64e(0x7755335544332222), - C64e(0x04d6bbd6bfbbd2d2), C64e(0x399070904970a9a9), - C64e(0x878089800e890707), C64e(0xc1f2a7f266a73333), - C64e(0xecc1b6c15ab62d2d), C64e(0x5a66226678223c3c), - C64e(0xb8ad92ad2a921515), C64e(0xa96020608920c9c9), - C64e(0x5cdb49db15498787), C64e(0xb01aff1a4fffaaaa), - C64e(0xd8887888a0785050), C64e(0x2b8e7a8e517aa5a5), - C64e(0x898a8f8a068f0303), C64e(0x4a13f813b2f85959), - C64e(0x929b809b12800909), C64e(0x2339173934171a1a), - C64e(0x1075da75cada6565), C64e(0x84533153b531d7d7), - C64e(0xd551c65113c68484), C64e(0x03d3b8d3bbb8d0d0), - C64e(0xdc5ec35e1fc38282), C64e(0xe2cbb0cb52b02929), - C64e(0xc3997799b4775a5a), C64e(0x2d3311333c111e1e), - C64e(0x3d46cb46f6cb7b7b), C64e(0xb71ffc1f4bfca8a8), - C64e(0x0c61d661dad66d6d), C64e(0x624e3a4e583a2c2c) -}; - -#endif - -#define DECL_STATE_SMALL \ - sph_u64 H[8]; - -#define READ_STATE_SMALL(sc) do { \ - memcpy(H, (sc)->state.wide, sizeof H); \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - memcpy((sc)->state.wide, H, sizeof H); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define RSTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ R64(T0[B64_1(a[b1])], 8) \ - ^ R64(T0[B64_2(a[b2])], 16) \ - ^ R64(T0[B64_3(a[b3])], 24) \ - ^ T4[B64_4(a[b4])] \ - ^ R64(T4[B64_5(a[b5])], 8) \ - ^ R64(T4[B64_6(a[b6])], 16) \ - ^ R64(T4[B64_7(a[b7])], 24); \ - } while (0) - -#else - -#define RSTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ T1[B64_1(a[b1])] \ - ^ T2[B64_2(a[b2])] \ - ^ T3[B64_3(a[b3])] \ - ^ T4[B64_4(a[b4])] \ - ^ T5[B64_5(a[b5])] \ - ^ T6[B64_6(a[b6])] \ - ^ T7[B64_7(a[b7])]; \ - } while (0) - -#endif - -#define ROUND_SMALL_P(a, r) do { \ - sph_u64 t[8]; \ - a[0] ^= PC64(0x00, r); \ - a[1] ^= PC64(0x10, r); \ - a[2] ^= PC64(0x20, r); \ - a[3] ^= PC64(0x30, r); \ - a[4] ^= PC64(0x40, r); \ - a[5] ^= PC64(0x50, r); \ - a[6] ^= PC64(0x60, r); \ - a[7] ^= PC64(0x70, r); \ - RSTT(0, a, 0, 1, 2, 3, 4, 5, 6, 7); \ - RSTT(1, a, 1, 2, 3, 4, 5, 6, 7, 0); \ - RSTT(2, a, 2, 3, 4, 5, 6, 7, 0, 1); \ - RSTT(3, a, 3, 4, 5, 6, 7, 0, 1, 2); \ - RSTT(4, a, 4, 5, 6, 7, 0, 1, 2, 3); \ - RSTT(5, a, 5, 6, 7, 0, 1, 2, 3, 4); \ - RSTT(6, a, 6, 7, 0, 1, 2, 3, 4, 5); \ - RSTT(7, a, 7, 0, 1, 2, 3, 4, 5, 6); \ - a[0] = t[0]; \ - a[1] = t[1]; \ - a[2] = t[2]; \ - a[3] = t[3]; \ - a[4] = t[4]; \ - a[5] = t[5]; \ - a[6] = t[6]; \ - a[7] = t[7]; \ - } while (0) - -#define ROUND_SMALL_Q(a, r) do { \ - sph_u64 t[8]; \ - a[0] ^= QC64(0x00, r); \ - a[1] ^= QC64(0x10, r); \ - a[2] ^= QC64(0x20, r); \ - a[3] ^= QC64(0x30, r); \ - a[4] ^= QC64(0x40, r); \ - a[5] ^= QC64(0x50, r); \ - a[6] ^= QC64(0x60, r); \ - a[7] ^= QC64(0x70, r); \ - RSTT(0, a, 1, 3, 5, 7, 0, 2, 4, 6); \ - RSTT(1, a, 2, 4, 6, 0, 1, 3, 5, 7); \ - RSTT(2, a, 3, 5, 7, 1, 2, 4, 6, 0); \ - RSTT(3, a, 4, 6, 0, 2, 3, 5, 7, 1); \ - RSTT(4, a, 5, 7, 1, 3, 4, 6, 0, 2); \ - RSTT(5, a, 6, 0, 2, 4, 5, 7, 1, 3); \ - RSTT(6, a, 7, 1, 3, 5, 6, 0, 2, 4); \ - RSTT(7, a, 0, 2, 4, 6, 7, 1, 3, 5); \ - a[0] = t[0]; \ - a[1] = t[1]; \ - a[2] = t[2]; \ - a[3] = t[3]; \ - a[4] = t[4]; \ - a[5] = t[5]; \ - a[6] = t[6]; \ - a[7] = t[7]; \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_P(a, r); \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_Q(a, r); \ - } while (0) - -#else - -/* - * Apparently, unrolling more than that confuses GCC, resulting in - * lower performance, even though L1 cache would be no problem. - */ -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_P(a, r + 0); \ - ROUND_SMALL_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_Q(a, r + 0); \ - ROUND_SMALL_Q(a, r + 1); \ - } \ - } while (0) - -#endif - -#define COMPRESS_SMALL do { \ - sph_u64 g[8], m[8]; \ - size_t u; \ - for (u = 0; u < 8; u ++) { \ - m[u] = dec64e_aligned(buf + (u << 3)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_SMALL_P(g); \ - PERM_SMALL_Q(m); \ - for (u = 0; u < 8; u ++) \ - H[u] ^= g[u] ^ m[u]; \ - } while (0) - -#define FINAL_SMALL do { \ - sph_u64 x[8]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_SMALL_P(x); \ - for (u = 0; u < 8; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#define DECL_STATE_BIG \ - sph_u64 H[16]; - -#define READ_STATE_BIG(sc) do { \ - memcpy(H, (sc)->state.wide, sizeof H); \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - memcpy((sc)->state.wide, H, sizeof H); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define RBTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ R64(T0[B64_1(a[b1])], 8) \ - ^ R64(T0[B64_2(a[b2])], 16) \ - ^ R64(T0[B64_3(a[b3])], 24) \ - ^ T4[B64_4(a[b4])] \ - ^ R64(T4[B64_5(a[b5])], 8) \ - ^ R64(T4[B64_6(a[b6])], 16) \ - ^ R64(T4[B64_7(a[b7])], 24); \ - } while (0) - -#else - -#define RBTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d] = T0[B64_0(a[b0])] \ - ^ T1[B64_1(a[b1])] \ - ^ T2[B64_2(a[b2])] \ - ^ T3[B64_3(a[b3])] \ - ^ T4[B64_4(a[b4])] \ - ^ T5[B64_5(a[b5])] \ - ^ T6[B64_6(a[b6])] \ - ^ T7[B64_7(a[b7])]; \ - } while (0) - -#endif - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define ROUND_BIG_P(a, r) do { \ - sph_u64 t[16]; \ - size_t u; \ - a[0x0] ^= PC64(0x00, r); \ - a[0x1] ^= PC64(0x10, r); \ - a[0x2] ^= PC64(0x20, r); \ - a[0x3] ^= PC64(0x30, r); \ - a[0x4] ^= PC64(0x40, r); \ - a[0x5] ^= PC64(0x50, r); \ - a[0x6] ^= PC64(0x60, r); \ - a[0x7] ^= PC64(0x70, r); \ - a[0x8] ^= PC64(0x80, r); \ - a[0x9] ^= PC64(0x90, r); \ - a[0xA] ^= PC64(0xA0, r); \ - a[0xB] ^= PC64(0xB0, r); \ - a[0xC] ^= PC64(0xC0, r); \ - a[0xD] ^= PC64(0xD0, r); \ - a[0xE] ^= PC64(0xE0, r); \ - a[0xF] ^= PC64(0xF0, r); \ - for (u = 0; u < 16; u += 4) { \ - RBTT(u + 0, a, u + 0, (u + 1) & 0xF, \ - (u + 2) & 0xF, (u + 3) & 0xF, (u + 4) & 0xF, \ - (u + 5) & 0xF, (u + 6) & 0xF, (u + 11) & 0xF); \ - RBTT(u + 1, a, u + 1, (u + 2) & 0xF, \ - (u + 3) & 0xF, (u + 4) & 0xF, (u + 5) & 0xF, \ - (u + 6) & 0xF, (u + 7) & 0xF, (u + 12) & 0xF); \ - RBTT(u + 2, a, u + 2, (u + 3) & 0xF, \ - (u + 4) & 0xF, (u + 5) & 0xF, (u + 6) & 0xF, \ - (u + 7) & 0xF, (u + 8) & 0xF, (u + 13) & 0xF); \ - RBTT(u + 3, a, u + 3, (u + 4) & 0xF, \ - (u + 5) & 0xF, (u + 6) & 0xF, (u + 7) & 0xF, \ - (u + 8) & 0xF, (u + 9) & 0xF, (u + 14) & 0xF); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u64 t[16]; \ - size_t u; \ - a[0x0] ^= QC64(0x00, r); \ - a[0x1] ^= QC64(0x10, r); \ - a[0x2] ^= QC64(0x20, r); \ - a[0x3] ^= QC64(0x30, r); \ - a[0x4] ^= QC64(0x40, r); \ - a[0x5] ^= QC64(0x50, r); \ - a[0x6] ^= QC64(0x60, r); \ - a[0x7] ^= QC64(0x70, r); \ - a[0x8] ^= QC64(0x80, r); \ - a[0x9] ^= QC64(0x90, r); \ - a[0xA] ^= QC64(0xA0, r); \ - a[0xB] ^= QC64(0xB0, r); \ - a[0xC] ^= QC64(0xC0, r); \ - a[0xD] ^= QC64(0xD0, r); \ - a[0xE] ^= QC64(0xE0, r); \ - a[0xF] ^= QC64(0xF0, r); \ - for (u = 0; u < 16; u += 4) { \ - RBTT(u + 0, a, (u + 1) & 0xF, (u + 3) & 0xF, \ - (u + 5) & 0xF, (u + 11) & 0xF, (u + 0) & 0xF, \ - (u + 2) & 0xF, (u + 4) & 0xF, (u + 6) & 0xF); \ - RBTT(u + 1, a, (u + 2) & 0xF, (u + 4) & 0xF, \ - (u + 6) & 0xF, (u + 12) & 0xF, (u + 1) & 0xF, \ - (u + 3) & 0xF, (u + 5) & 0xF, (u + 7) & 0xF); \ - RBTT(u + 2, a, (u + 3) & 0xF, (u + 5) & 0xF, \ - (u + 7) & 0xF, (u + 13) & 0xF, (u + 2) & 0xF, \ - (u + 4) & 0xF, (u + 6) & 0xF, (u + 8) & 0xF); \ - RBTT(u + 3, a, (u + 4) & 0xF, (u + 6) & 0xF, \ - (u + 8) & 0xF, (u + 14) & 0xF, (u + 3) & 0xF, \ - (u + 5) & 0xF, (u + 7) & 0xF, (u + 9) & 0xF); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#else - -#define ROUND_BIG_P(a, r) do { \ - sph_u64 t[16]; \ - a[0x0] ^= PC64(0x00, r); \ - a[0x1] ^= PC64(0x10, r); \ - a[0x2] ^= PC64(0x20, r); \ - a[0x3] ^= PC64(0x30, r); \ - a[0x4] ^= PC64(0x40, r); \ - a[0x5] ^= PC64(0x50, r); \ - a[0x6] ^= PC64(0x60, r); \ - a[0x7] ^= PC64(0x70, r); \ - a[0x8] ^= PC64(0x80, r); \ - a[0x9] ^= PC64(0x90, r); \ - a[0xA] ^= PC64(0xA0, r); \ - a[0xB] ^= PC64(0xB0, r); \ - a[0xC] ^= PC64(0xC0, r); \ - a[0xD] ^= PC64(0xD0, r); \ - a[0xE] ^= PC64(0xE0, r); \ - a[0xF] ^= PC64(0xF0, r); \ - RBTT(0x0, a, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0xB); \ - RBTT(0x1, a, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0xC); \ - RBTT(0x2, a, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0xD); \ - RBTT(0x3, a, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xE); \ - RBTT(0x4, a, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xF); \ - RBTT(0x5, a, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0x0); \ - RBTT(0x6, a, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0x1); \ - RBTT(0x7, a, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0x2); \ - RBTT(0x8, a, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0x3); \ - RBTT(0x9, a, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x4); \ - RBTT(0xA, a, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x0, 0x5); \ - RBTT(0xB, a, 0xB, 0xC, 0xD, 0xE, 0xF, 0x0, 0x1, 0x6); \ - RBTT(0xC, a, 0xC, 0xD, 0xE, 0xF, 0x0, 0x1, 0x2, 0x7); \ - RBTT(0xD, a, 0xD, 0xE, 0xF, 0x0, 0x1, 0x2, 0x3, 0x8); \ - RBTT(0xE, a, 0xE, 0xF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x9); \ - RBTT(0xF, a, 0xF, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xA); \ - a[0x0] = t[0x0]; \ - a[0x1] = t[0x1]; \ - a[0x2] = t[0x2]; \ - a[0x3] = t[0x3]; \ - a[0x4] = t[0x4]; \ - a[0x5] = t[0x5]; \ - a[0x6] = t[0x6]; \ - a[0x7] = t[0x7]; \ - a[0x8] = t[0x8]; \ - a[0x9] = t[0x9]; \ - a[0xA] = t[0xA]; \ - a[0xB] = t[0xB]; \ - a[0xC] = t[0xC]; \ - a[0xD] = t[0xD]; \ - a[0xE] = t[0xE]; \ - a[0xF] = t[0xF]; \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u64 t[16]; \ - a[0x0] ^= QC64(0x00, r); \ - a[0x1] ^= QC64(0x10, r); \ - a[0x2] ^= QC64(0x20, r); \ - a[0x3] ^= QC64(0x30, r); \ - a[0x4] ^= QC64(0x40, r); \ - a[0x5] ^= QC64(0x50, r); \ - a[0x6] ^= QC64(0x60, r); \ - a[0x7] ^= QC64(0x70, r); \ - a[0x8] ^= QC64(0x80, r); \ - a[0x9] ^= QC64(0x90, r); \ - a[0xA] ^= QC64(0xA0, r); \ - a[0xB] ^= QC64(0xB0, r); \ - a[0xC] ^= QC64(0xC0, r); \ - a[0xD] ^= QC64(0xD0, r); \ - a[0xE] ^= QC64(0xE0, r); \ - a[0xF] ^= QC64(0xF0, r); \ - RBTT(0x0, a, 0x1, 0x3, 0x5, 0xB, 0x0, 0x2, 0x4, 0x6); \ - RBTT(0x1, a, 0x2, 0x4, 0x6, 0xC, 0x1, 0x3, 0x5, 0x7); \ - RBTT(0x2, a, 0x3, 0x5, 0x7, 0xD, 0x2, 0x4, 0x6, 0x8); \ - RBTT(0x3, a, 0x4, 0x6, 0x8, 0xE, 0x3, 0x5, 0x7, 0x9); \ - RBTT(0x4, a, 0x5, 0x7, 0x9, 0xF, 0x4, 0x6, 0x8, 0xA); \ - RBTT(0x5, a, 0x6, 0x8, 0xA, 0x0, 0x5, 0x7, 0x9, 0xB); \ - RBTT(0x6, a, 0x7, 0x9, 0xB, 0x1, 0x6, 0x8, 0xA, 0xC); \ - RBTT(0x7, a, 0x8, 0xA, 0xC, 0x2, 0x7, 0x9, 0xB, 0xD); \ - RBTT(0x8, a, 0x9, 0xB, 0xD, 0x3, 0x8, 0xA, 0xC, 0xE); \ - RBTT(0x9, a, 0xA, 0xC, 0xE, 0x4, 0x9, 0xB, 0xD, 0xF); \ - RBTT(0xA, a, 0xB, 0xD, 0xF, 0x5, 0xA, 0xC, 0xE, 0x0); \ - RBTT(0xB, a, 0xC, 0xE, 0x0, 0x6, 0xB, 0xD, 0xF, 0x1); \ - RBTT(0xC, a, 0xD, 0xF, 0x1, 0x7, 0xC, 0xE, 0x0, 0x2); \ - RBTT(0xD, a, 0xE, 0x0, 0x2, 0x8, 0xD, 0xF, 0x1, 0x3); \ - RBTT(0xE, a, 0xF, 0x1, 0x3, 0x9, 0xE, 0x0, 0x2, 0x4); \ - RBTT(0xF, a, 0x0, 0x2, 0x4, 0xA, 0xF, 0x1, 0x3, 0x5); \ - a[0x0] = t[0x0]; \ - a[0x1] = t[0x1]; \ - a[0x2] = t[0x2]; \ - a[0x3] = t[0x3]; \ - a[0x4] = t[0x4]; \ - a[0x5] = t[0x5]; \ - a[0x6] = t[0x6]; \ - a[0x7] = t[0x7]; \ - a[0x8] = t[0x8]; \ - a[0x9] = t[0x9]; \ - a[0xA] = t[0xA]; \ - a[0xB] = t[0xB]; \ - a[0xC] = t[0xC]; \ - a[0xD] = t[0xD]; \ - a[0xE] = t[0xE]; \ - a[0xF] = t[0xF]; \ - } while (0) - -#endif - -#define PERM_BIG_P(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_P(a, r + 0); \ - ROUND_BIG_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_BIG_Q(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_Q(a, r + 0); \ - ROUND_BIG_Q(a, r + 1); \ - } \ - } while (0) - -/* obsolete -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define COMPRESS_BIG do { \ - sph_u64 g[16], m[16], *ya; \ - const sph_u64 *yc; \ - size_t u; \ - int i; \ - for (u = 0; u < 16; u ++) { \ - m[u] = dec64e_aligned(buf + (u << 3)); \ - g[u] = m[u] ^ H[u]; \ - } \ - ya = g; \ - yc = CP; \ - for (i = 0; i < 2; i ++) { \ - PERM_BIG(ya, yc); \ - ya = m; \ - yc = CQ; \ - } \ - for (u = 0; u < 16; u ++) { \ - H[u] ^= g[u] ^ m[u]; \ - } \ - } while (0) - -#else -*/ - -#define COMPRESS_BIG do { \ - sph_u64 g[16], m[16]; \ - size_t u; \ - for (u = 0; u < 16; u ++) { \ - m[u] = dec64e_aligned(buf + (u << 3)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_BIG_P(g); \ - PERM_BIG_Q(m); \ - for (u = 0; u < 16; u ++) { \ - H[u] ^= g[u] ^ m[u]; \ - } \ - } while (0) - -/* obsolete -#endif -*/ - -#define FINAL_BIG do { \ - sph_u64 x[16]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_BIG_P(x); \ - for (u = 0; u < 16; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#else - -static const sph_u32 T0up[] = { - C32e(0xc632f4a5), C32e(0xf86f9784), C32e(0xee5eb099), C32e(0xf67a8c8d), - C32e(0xffe8170d), C32e(0xd60adcbd), C32e(0xde16c8b1), C32e(0x916dfc54), - C32e(0x6090f050), C32e(0x02070503), C32e(0xce2ee0a9), C32e(0x56d1877d), - C32e(0xe7cc2b19), C32e(0xb513a662), C32e(0x4d7c31e6), C32e(0xec59b59a), - C32e(0x8f40cf45), C32e(0x1fa3bc9d), C32e(0x8949c040), C32e(0xfa689287), - C32e(0xefd03f15), C32e(0xb29426eb), C32e(0x8ece40c9), C32e(0xfbe61d0b), - C32e(0x416e2fec), C32e(0xb31aa967), C32e(0x5f431cfd), C32e(0x456025ea), - C32e(0x23f9dabf), C32e(0x535102f7), C32e(0xe445a196), C32e(0x9b76ed5b), - C32e(0x75285dc2), C32e(0xe1c5241c), C32e(0x3dd4e9ae), C32e(0x4cf2be6a), - C32e(0x6c82ee5a), C32e(0x7ebdc341), C32e(0xf5f30602), C32e(0x8352d14f), - C32e(0x688ce45c), C32e(0x515607f4), C32e(0xd18d5c34), C32e(0xf9e11808), - C32e(0xe24cae93), C32e(0xab3e9573), C32e(0x6297f553), C32e(0x2a6b413f), - C32e(0x081c140c), C32e(0x9563f652), C32e(0x46e9af65), C32e(0x9d7fe25e), - C32e(0x30487828), C32e(0x37cff8a1), C32e(0x0a1b110f), C32e(0x2febc4b5), - C32e(0x0e151b09), C32e(0x247e5a36), C32e(0x1badb69b), C32e(0xdf98473d), - C32e(0xcda76a26), C32e(0x4ef5bb69), C32e(0x7f334ccd), C32e(0xea50ba9f), - C32e(0x123f2d1b), C32e(0x1da4b99e), C32e(0x58c49c74), C32e(0x3446722e), - C32e(0x3641772d), C32e(0xdc11cdb2), C32e(0xb49d29ee), C32e(0x5b4d16fb), - C32e(0xa4a501f6), C32e(0x76a1d74d), C32e(0xb714a361), C32e(0x7d3449ce), - C32e(0x52df8d7b), C32e(0xdd9f423e), C32e(0x5ecd9371), C32e(0x13b1a297), - C32e(0xa6a204f5), C32e(0xb901b868), C32e(0x00000000), C32e(0xc1b5742c), - C32e(0x40e0a060), C32e(0xe3c2211f), C32e(0x793a43c8), C32e(0xb69a2ced), - C32e(0xd40dd9be), C32e(0x8d47ca46), C32e(0x671770d9), C32e(0x72afdd4b), - C32e(0x94ed79de), C32e(0x98ff67d4), C32e(0xb09323e8), C32e(0x855bde4a), - C32e(0xbb06bd6b), C32e(0xc5bb7e2a), C32e(0x4f7b34e5), C32e(0xedd73a16), - C32e(0x86d254c5), C32e(0x9af862d7), C32e(0x6699ff55), C32e(0x11b6a794), - C32e(0x8ac04acf), C32e(0xe9d93010), C32e(0x040e0a06), C32e(0xfe669881), - C32e(0xa0ab0bf0), C32e(0x78b4cc44), C32e(0x25f0d5ba), C32e(0x4b753ee3), - C32e(0xa2ac0ef3), C32e(0x5d4419fe), C32e(0x80db5bc0), C32e(0x0580858a), - C32e(0x3fd3ecad), C32e(0x21fedfbc), C32e(0x70a8d848), C32e(0xf1fd0c04), - C32e(0x63197adf), C32e(0x772f58c1), C32e(0xaf309f75), C32e(0x42e7a563), - C32e(0x20705030), C32e(0xe5cb2e1a), C32e(0xfdef120e), C32e(0xbf08b76d), - C32e(0x8155d44c), C32e(0x18243c14), C32e(0x26795f35), C32e(0xc3b2712f), - C32e(0xbe8638e1), C32e(0x35c8fda2), C32e(0x88c74fcc), C32e(0x2e654b39), - C32e(0x936af957), C32e(0x55580df2), C32e(0xfc619d82), C32e(0x7ab3c947), - C32e(0xc827efac), C32e(0xba8832e7), C32e(0x324f7d2b), C32e(0xe642a495), - C32e(0xc03bfba0), C32e(0x19aab398), C32e(0x9ef668d1), C32e(0xa322817f), - C32e(0x44eeaa66), C32e(0x54d6827e), C32e(0x3bdde6ab), C32e(0x0b959e83), - C32e(0x8cc945ca), C32e(0xc7bc7b29), C32e(0x6b056ed3), C32e(0x286c443c), - C32e(0xa72c8b79), C32e(0xbc813de2), C32e(0x1631271d), C32e(0xad379a76), - C32e(0xdb964d3b), C32e(0x649efa56), C32e(0x74a6d24e), C32e(0x1436221e), - C32e(0x92e476db), C32e(0x0c121e0a), C32e(0x48fcb46c), C32e(0xb88f37e4), - C32e(0x9f78e75d), C32e(0xbd0fb26e), C32e(0x43692aef), C32e(0xc435f1a6), - C32e(0x39dae3a8), C32e(0x31c6f7a4), C32e(0xd38a5937), C32e(0xf274868b), - C32e(0xd5835632), C32e(0x8b4ec543), C32e(0x6e85eb59), C32e(0xda18c2b7), - C32e(0x018e8f8c), C32e(0xb11dac64), C32e(0x9cf16dd2), C32e(0x49723be0), - C32e(0xd81fc7b4), C32e(0xacb915fa), C32e(0xf3fa0907), C32e(0xcfa06f25), - C32e(0xca20eaaf), C32e(0xf47d898e), C32e(0x476720e9), C32e(0x10382818), - C32e(0x6f0b64d5), C32e(0xf0738388), C32e(0x4afbb16f), C32e(0x5cca9672), - C32e(0x38546c24), C32e(0x575f08f1), C32e(0x732152c7), C32e(0x9764f351), - C32e(0xcbae6523), C32e(0xa125847c), C32e(0xe857bf9c), C32e(0x3e5d6321), - C32e(0x96ea7cdd), C32e(0x611e7fdc), C32e(0x0d9c9186), C32e(0x0f9b9485), - C32e(0xe04bab90), C32e(0x7cbac642), C32e(0x712657c4), C32e(0xcc29e5aa), - C32e(0x90e373d8), C32e(0x06090f05), C32e(0xf7f40301), C32e(0x1c2a3612), - C32e(0xc23cfea3), C32e(0x6a8be15f), C32e(0xaebe10f9), C32e(0x69026bd0), - C32e(0x17bfa891), C32e(0x9971e858), C32e(0x3a536927), C32e(0x27f7d0b9), - C32e(0xd9914838), C32e(0xebde3513), C32e(0x2be5ceb3), C32e(0x22775533), - C32e(0xd204d6bb), C32e(0xa9399070), C32e(0x07878089), C32e(0x33c1f2a7), - C32e(0x2decc1b6), C32e(0x3c5a6622), C32e(0x15b8ad92), C32e(0xc9a96020), - C32e(0x875cdb49), C32e(0xaab01aff), C32e(0x50d88878), C32e(0xa52b8e7a), - C32e(0x03898a8f), C32e(0x594a13f8), C32e(0x09929b80), C32e(0x1a233917), - C32e(0x651075da), C32e(0xd7845331), C32e(0x84d551c6), C32e(0xd003d3b8), - C32e(0x82dc5ec3), C32e(0x29e2cbb0), C32e(0x5ac39977), C32e(0x1e2d3311), - C32e(0x7b3d46cb), C32e(0xa8b71ffc), C32e(0x6d0c61d6), C32e(0x2c624e3a) -}; - -static const sph_u32 T0dn[] = { - C32e(0xf497a5c6), C32e(0x97eb84f8), C32e(0xb0c799ee), C32e(0x8cf78df6), - C32e(0x17e50dff), C32e(0xdcb7bdd6), C32e(0xc8a7b1de), C32e(0xfc395491), - C32e(0xf0c05060), C32e(0x05040302), C32e(0xe087a9ce), C32e(0x87ac7d56), - C32e(0x2bd519e7), C32e(0xa67162b5), C32e(0x319ae64d), C32e(0xb5c39aec), - C32e(0xcf05458f), C32e(0xbc3e9d1f), C32e(0xc0094089), C32e(0x92ef87fa), - C32e(0x3fc515ef), C32e(0x267febb2), C32e(0x4007c98e), C32e(0x1ded0bfb), - C32e(0x2f82ec41), C32e(0xa97d67b3), C32e(0x1cbefd5f), C32e(0x258aea45), - C32e(0xda46bf23), C32e(0x02a6f753), C32e(0xa1d396e4), C32e(0xed2d5b9b), - C32e(0x5deac275), C32e(0x24d91ce1), C32e(0xe97aae3d), C32e(0xbe986a4c), - C32e(0xeed85a6c), C32e(0xc3fc417e), C32e(0x06f102f5), C32e(0xd11d4f83), - C32e(0xe4d05c68), C32e(0x07a2f451), C32e(0x5cb934d1), C32e(0x18e908f9), - C32e(0xaedf93e2), C32e(0x954d73ab), C32e(0xf5c45362), C32e(0x41543f2a), - C32e(0x14100c08), C32e(0xf6315295), C32e(0xaf8c6546), C32e(0xe2215e9d), - C32e(0x78602830), C32e(0xf86ea137), C32e(0x11140f0a), C32e(0xc45eb52f), - C32e(0x1b1c090e), C32e(0x5a483624), C32e(0xb6369b1b), C32e(0x47a53ddf), - C32e(0x6a8126cd), C32e(0xbb9c694e), C32e(0x4cfecd7f), C32e(0xbacf9fea), - C32e(0x2d241b12), C32e(0xb93a9e1d), C32e(0x9cb07458), C32e(0x72682e34), - C32e(0x776c2d36), C32e(0xcda3b2dc), C32e(0x2973eeb4), C32e(0x16b6fb5b), - C32e(0x0153f6a4), C32e(0xd7ec4d76), C32e(0xa37561b7), C32e(0x49face7d), - C32e(0x8da47b52), C32e(0x42a13edd), C32e(0x93bc715e), C32e(0xa2269713), - C32e(0x0457f5a6), C32e(0xb86968b9), C32e(0x00000000), C32e(0x74992cc1), - C32e(0xa0806040), C32e(0x21dd1fe3), C32e(0x43f2c879), C32e(0x2c77edb6), - C32e(0xd9b3bed4), C32e(0xca01468d), C32e(0x70ced967), C32e(0xdde44b72), - C32e(0x7933de94), C32e(0x672bd498), C32e(0x237be8b0), C32e(0xde114a85), - C32e(0xbd6d6bbb), C32e(0x7e912ac5), C32e(0x349ee54f), C32e(0x3ac116ed), - C32e(0x5417c586), C32e(0x622fd79a), C32e(0xffcc5566), C32e(0xa7229411), - C32e(0x4a0fcf8a), C32e(0x30c910e9), C32e(0x0a080604), C32e(0x98e781fe), - C32e(0x0b5bf0a0), C32e(0xccf04478), C32e(0xd54aba25), C32e(0x3e96e34b), - C32e(0x0e5ff3a2), C32e(0x19bafe5d), C32e(0x5b1bc080), C32e(0x850a8a05), - C32e(0xec7ead3f), C32e(0xdf42bc21), C32e(0xd8e04870), C32e(0x0cf904f1), - C32e(0x7ac6df63), C32e(0x58eec177), C32e(0x9f4575af), C32e(0xa5846342), - C32e(0x50403020), C32e(0x2ed11ae5), C32e(0x12e10efd), C32e(0xb7656dbf), - C32e(0xd4194c81), C32e(0x3c301418), C32e(0x5f4c3526), C32e(0x719d2fc3), - C32e(0x3867e1be), C32e(0xfd6aa235), C32e(0x4f0bcc88), C32e(0x4b5c392e), - C32e(0xf93d5793), C32e(0x0daaf255), C32e(0x9de382fc), C32e(0xc9f4477a), - C32e(0xef8bacc8), C32e(0x326fe7ba), C32e(0x7d642b32), C32e(0xa4d795e6), - C32e(0xfb9ba0c0), C32e(0xb3329819), C32e(0x6827d19e), C32e(0x815d7fa3), - C32e(0xaa886644), C32e(0x82a87e54), C32e(0xe676ab3b), C32e(0x9e16830b), - C32e(0x4503ca8c), C32e(0x7b9529c7), C32e(0x6ed6d36b), C32e(0x44503c28), - C32e(0x8b5579a7), C32e(0x3d63e2bc), C32e(0x272c1d16), C32e(0x9a4176ad), - C32e(0x4dad3bdb), C32e(0xfac85664), C32e(0xd2e84e74), C32e(0x22281e14), - C32e(0x763fdb92), C32e(0x1e180a0c), C32e(0xb4906c48), C32e(0x376be4b8), - C32e(0xe7255d9f), C32e(0xb2616ebd), C32e(0x2a86ef43), C32e(0xf193a6c4), - C32e(0xe372a839), C32e(0xf762a431), C32e(0x59bd37d3), C32e(0x86ff8bf2), - C32e(0x56b132d5), C32e(0xc50d438b), C32e(0xebdc596e), C32e(0xc2afb7da), - C32e(0x8f028c01), C32e(0xac7964b1), C32e(0x6d23d29c), C32e(0x3b92e049), - C32e(0xc7abb4d8), C32e(0x1543faac), C32e(0x09fd07f3), C32e(0x6f8525cf), - C32e(0xea8fafca), C32e(0x89f38ef4), C32e(0x208ee947), C32e(0x28201810), - C32e(0x64ded56f), C32e(0x83fb88f0), C32e(0xb1946f4a), C32e(0x96b8725c), - C32e(0x6c702438), C32e(0x08aef157), C32e(0x52e6c773), C32e(0xf3355197), - C32e(0x658d23cb), C32e(0x84597ca1), C32e(0xbfcb9ce8), C32e(0x637c213e), - C32e(0x7c37dd96), C32e(0x7fc2dc61), C32e(0x911a860d), C32e(0x941e850f), - C32e(0xabdb90e0), C32e(0xc6f8427c), C32e(0x57e2c471), C32e(0xe583aacc), - C32e(0x733bd890), C32e(0x0f0c0506), C32e(0x03f501f7), C32e(0x3638121c), - C32e(0xfe9fa3c2), C32e(0xe1d45f6a), C32e(0x1047f9ae), C32e(0x6bd2d069), - C32e(0xa82e9117), C32e(0xe8295899), C32e(0x6974273a), C32e(0xd04eb927), - C32e(0x48a938d9), C32e(0x35cd13eb), C32e(0xce56b32b), C32e(0x55443322), - C32e(0xd6bfbbd2), C32e(0x904970a9), C32e(0x800e8907), C32e(0xf266a733), - C32e(0xc15ab62d), C32e(0x6678223c), C32e(0xad2a9215), C32e(0x608920c9), - C32e(0xdb154987), C32e(0x1a4fffaa), C32e(0x88a07850), C32e(0x8e517aa5), - C32e(0x8a068f03), C32e(0x13b2f859), C32e(0x9b128009), C32e(0x3934171a), - C32e(0x75cada65), C32e(0x53b531d7), C32e(0x5113c684), C32e(0xd3bbb8d0), - C32e(0x5e1fc382), C32e(0xcb52b029), C32e(0x99b4775a), C32e(0x333c111e), - C32e(0x46f6cb7b), C32e(0x1f4bfca8), C32e(0x61dad66d), C32e(0x4e583a2c) -}; - -static const sph_u32 T1up[] = { - C32e(0xc6c632f4), C32e(0xf8f86f97), C32e(0xeeee5eb0), C32e(0xf6f67a8c), - C32e(0xffffe817), C32e(0xd6d60adc), C32e(0xdede16c8), C32e(0x91916dfc), - C32e(0x606090f0), C32e(0x02020705), C32e(0xcece2ee0), C32e(0x5656d187), - C32e(0xe7e7cc2b), C32e(0xb5b513a6), C32e(0x4d4d7c31), C32e(0xecec59b5), - C32e(0x8f8f40cf), C32e(0x1f1fa3bc), C32e(0x898949c0), C32e(0xfafa6892), - C32e(0xefefd03f), C32e(0xb2b29426), C32e(0x8e8ece40), C32e(0xfbfbe61d), - C32e(0x41416e2f), C32e(0xb3b31aa9), C32e(0x5f5f431c), C32e(0x45456025), - C32e(0x2323f9da), C32e(0x53535102), C32e(0xe4e445a1), C32e(0x9b9b76ed), - C32e(0x7575285d), C32e(0xe1e1c524), C32e(0x3d3dd4e9), C32e(0x4c4cf2be), - C32e(0x6c6c82ee), C32e(0x7e7ebdc3), C32e(0xf5f5f306), C32e(0x838352d1), - C32e(0x68688ce4), C32e(0x51515607), C32e(0xd1d18d5c), C32e(0xf9f9e118), - C32e(0xe2e24cae), C32e(0xabab3e95), C32e(0x626297f5), C32e(0x2a2a6b41), - C32e(0x08081c14), C32e(0x959563f6), C32e(0x4646e9af), C32e(0x9d9d7fe2), - C32e(0x30304878), C32e(0x3737cff8), C32e(0x0a0a1b11), C32e(0x2f2febc4), - C32e(0x0e0e151b), C32e(0x24247e5a), C32e(0x1b1badb6), C32e(0xdfdf9847), - C32e(0xcdcda76a), C32e(0x4e4ef5bb), C32e(0x7f7f334c), C32e(0xeaea50ba), - C32e(0x12123f2d), C32e(0x1d1da4b9), C32e(0x5858c49c), C32e(0x34344672), - C32e(0x36364177), C32e(0xdcdc11cd), C32e(0xb4b49d29), C32e(0x5b5b4d16), - C32e(0xa4a4a501), C32e(0x7676a1d7), C32e(0xb7b714a3), C32e(0x7d7d3449), - C32e(0x5252df8d), C32e(0xdddd9f42), C32e(0x5e5ecd93), C32e(0x1313b1a2), - C32e(0xa6a6a204), C32e(0xb9b901b8), C32e(0x00000000), C32e(0xc1c1b574), - C32e(0x4040e0a0), C32e(0xe3e3c221), C32e(0x79793a43), C32e(0xb6b69a2c), - C32e(0xd4d40dd9), C32e(0x8d8d47ca), C32e(0x67671770), C32e(0x7272afdd), - C32e(0x9494ed79), C32e(0x9898ff67), C32e(0xb0b09323), C32e(0x85855bde), - C32e(0xbbbb06bd), C32e(0xc5c5bb7e), C32e(0x4f4f7b34), C32e(0xededd73a), - C32e(0x8686d254), C32e(0x9a9af862), C32e(0x666699ff), C32e(0x1111b6a7), - C32e(0x8a8ac04a), C32e(0xe9e9d930), C32e(0x04040e0a), C32e(0xfefe6698), - C32e(0xa0a0ab0b), C32e(0x7878b4cc), C32e(0x2525f0d5), C32e(0x4b4b753e), - C32e(0xa2a2ac0e), C32e(0x5d5d4419), C32e(0x8080db5b), C32e(0x05058085), - C32e(0x3f3fd3ec), C32e(0x2121fedf), C32e(0x7070a8d8), C32e(0xf1f1fd0c), - C32e(0x6363197a), C32e(0x77772f58), C32e(0xafaf309f), C32e(0x4242e7a5), - C32e(0x20207050), C32e(0xe5e5cb2e), C32e(0xfdfdef12), C32e(0xbfbf08b7), - C32e(0x818155d4), C32e(0x1818243c), C32e(0x2626795f), C32e(0xc3c3b271), - C32e(0xbebe8638), C32e(0x3535c8fd), C32e(0x8888c74f), C32e(0x2e2e654b), - C32e(0x93936af9), C32e(0x5555580d), C32e(0xfcfc619d), C32e(0x7a7ab3c9), - C32e(0xc8c827ef), C32e(0xbaba8832), C32e(0x32324f7d), C32e(0xe6e642a4), - C32e(0xc0c03bfb), C32e(0x1919aab3), C32e(0x9e9ef668), C32e(0xa3a32281), - C32e(0x4444eeaa), C32e(0x5454d682), C32e(0x3b3bdde6), C32e(0x0b0b959e), - C32e(0x8c8cc945), C32e(0xc7c7bc7b), C32e(0x6b6b056e), C32e(0x28286c44), - C32e(0xa7a72c8b), C32e(0xbcbc813d), C32e(0x16163127), C32e(0xadad379a), - C32e(0xdbdb964d), C32e(0x64649efa), C32e(0x7474a6d2), C32e(0x14143622), - C32e(0x9292e476), C32e(0x0c0c121e), C32e(0x4848fcb4), C32e(0xb8b88f37), - C32e(0x9f9f78e7), C32e(0xbdbd0fb2), C32e(0x4343692a), C32e(0xc4c435f1), - C32e(0x3939dae3), C32e(0x3131c6f7), C32e(0xd3d38a59), C32e(0xf2f27486), - C32e(0xd5d58356), C32e(0x8b8b4ec5), C32e(0x6e6e85eb), C32e(0xdada18c2), - C32e(0x01018e8f), C32e(0xb1b11dac), C32e(0x9c9cf16d), C32e(0x4949723b), - C32e(0xd8d81fc7), C32e(0xacacb915), C32e(0xf3f3fa09), C32e(0xcfcfa06f), - C32e(0xcaca20ea), C32e(0xf4f47d89), C32e(0x47476720), C32e(0x10103828), - C32e(0x6f6f0b64), C32e(0xf0f07383), C32e(0x4a4afbb1), C32e(0x5c5cca96), - C32e(0x3838546c), C32e(0x57575f08), C32e(0x73732152), C32e(0x979764f3), - C32e(0xcbcbae65), C32e(0xa1a12584), C32e(0xe8e857bf), C32e(0x3e3e5d63), - C32e(0x9696ea7c), C32e(0x61611e7f), C32e(0x0d0d9c91), C32e(0x0f0f9b94), - C32e(0xe0e04bab), C32e(0x7c7cbac6), C32e(0x71712657), C32e(0xcccc29e5), - C32e(0x9090e373), C32e(0x0606090f), C32e(0xf7f7f403), C32e(0x1c1c2a36), - C32e(0xc2c23cfe), C32e(0x6a6a8be1), C32e(0xaeaebe10), C32e(0x6969026b), - C32e(0x1717bfa8), C32e(0x999971e8), C32e(0x3a3a5369), C32e(0x2727f7d0), - C32e(0xd9d99148), C32e(0xebebde35), C32e(0x2b2be5ce), C32e(0x22227755), - C32e(0xd2d204d6), C32e(0xa9a93990), C32e(0x07078780), C32e(0x3333c1f2), - C32e(0x2d2decc1), C32e(0x3c3c5a66), C32e(0x1515b8ad), C32e(0xc9c9a960), - C32e(0x87875cdb), C32e(0xaaaab01a), C32e(0x5050d888), C32e(0xa5a52b8e), - C32e(0x0303898a), C32e(0x59594a13), C32e(0x0909929b), C32e(0x1a1a2339), - C32e(0x65651075), C32e(0xd7d78453), C32e(0x8484d551), C32e(0xd0d003d3), - C32e(0x8282dc5e), C32e(0x2929e2cb), C32e(0x5a5ac399), C32e(0x1e1e2d33), - C32e(0x7b7b3d46), C32e(0xa8a8b71f), C32e(0x6d6d0c61), C32e(0x2c2c624e) -}; - -static const sph_u32 T1dn[] = { - C32e(0xa5f497a5), C32e(0x8497eb84), C32e(0x99b0c799), C32e(0x8d8cf78d), - C32e(0x0d17e50d), C32e(0xbddcb7bd), C32e(0xb1c8a7b1), C32e(0x54fc3954), - C32e(0x50f0c050), C32e(0x03050403), C32e(0xa9e087a9), C32e(0x7d87ac7d), - C32e(0x192bd519), C32e(0x62a67162), C32e(0xe6319ae6), C32e(0x9ab5c39a), - C32e(0x45cf0545), C32e(0x9dbc3e9d), C32e(0x40c00940), C32e(0x8792ef87), - C32e(0x153fc515), C32e(0xeb267feb), C32e(0xc94007c9), C32e(0x0b1ded0b), - C32e(0xec2f82ec), C32e(0x67a97d67), C32e(0xfd1cbefd), C32e(0xea258aea), - C32e(0xbfda46bf), C32e(0xf702a6f7), C32e(0x96a1d396), C32e(0x5bed2d5b), - C32e(0xc25deac2), C32e(0x1c24d91c), C32e(0xaee97aae), C32e(0x6abe986a), - C32e(0x5aeed85a), C32e(0x41c3fc41), C32e(0x0206f102), C32e(0x4fd11d4f), - C32e(0x5ce4d05c), C32e(0xf407a2f4), C32e(0x345cb934), C32e(0x0818e908), - C32e(0x93aedf93), C32e(0x73954d73), C32e(0x53f5c453), C32e(0x3f41543f), - C32e(0x0c14100c), C32e(0x52f63152), C32e(0x65af8c65), C32e(0x5ee2215e), - C32e(0x28786028), C32e(0xa1f86ea1), C32e(0x0f11140f), C32e(0xb5c45eb5), - C32e(0x091b1c09), C32e(0x365a4836), C32e(0x9bb6369b), C32e(0x3d47a53d), - C32e(0x266a8126), C32e(0x69bb9c69), C32e(0xcd4cfecd), C32e(0x9fbacf9f), - C32e(0x1b2d241b), C32e(0x9eb93a9e), C32e(0x749cb074), C32e(0x2e72682e), - C32e(0x2d776c2d), C32e(0xb2cda3b2), C32e(0xee2973ee), C32e(0xfb16b6fb), - C32e(0xf60153f6), C32e(0x4dd7ec4d), C32e(0x61a37561), C32e(0xce49face), - C32e(0x7b8da47b), C32e(0x3e42a13e), C32e(0x7193bc71), C32e(0x97a22697), - C32e(0xf50457f5), C32e(0x68b86968), C32e(0x00000000), C32e(0x2c74992c), - C32e(0x60a08060), C32e(0x1f21dd1f), C32e(0xc843f2c8), C32e(0xed2c77ed), - C32e(0xbed9b3be), C32e(0x46ca0146), C32e(0xd970ced9), C32e(0x4bdde44b), - C32e(0xde7933de), C32e(0xd4672bd4), C32e(0xe8237be8), C32e(0x4ade114a), - C32e(0x6bbd6d6b), C32e(0x2a7e912a), C32e(0xe5349ee5), C32e(0x163ac116), - C32e(0xc55417c5), C32e(0xd7622fd7), C32e(0x55ffcc55), C32e(0x94a72294), - C32e(0xcf4a0fcf), C32e(0x1030c910), C32e(0x060a0806), C32e(0x8198e781), - C32e(0xf00b5bf0), C32e(0x44ccf044), C32e(0xbad54aba), C32e(0xe33e96e3), - C32e(0xf30e5ff3), C32e(0xfe19bafe), C32e(0xc05b1bc0), C32e(0x8a850a8a), - C32e(0xadec7ead), C32e(0xbcdf42bc), C32e(0x48d8e048), C32e(0x040cf904), - C32e(0xdf7ac6df), C32e(0xc158eec1), C32e(0x759f4575), C32e(0x63a58463), - C32e(0x30504030), C32e(0x1a2ed11a), C32e(0x0e12e10e), C32e(0x6db7656d), - C32e(0x4cd4194c), C32e(0x143c3014), C32e(0x355f4c35), C32e(0x2f719d2f), - C32e(0xe13867e1), C32e(0xa2fd6aa2), C32e(0xcc4f0bcc), C32e(0x394b5c39), - C32e(0x57f93d57), C32e(0xf20daaf2), C32e(0x829de382), C32e(0x47c9f447), - C32e(0xacef8bac), C32e(0xe7326fe7), C32e(0x2b7d642b), C32e(0x95a4d795), - C32e(0xa0fb9ba0), C32e(0x98b33298), C32e(0xd16827d1), C32e(0x7f815d7f), - C32e(0x66aa8866), C32e(0x7e82a87e), C32e(0xabe676ab), C32e(0x839e1683), - C32e(0xca4503ca), C32e(0x297b9529), C32e(0xd36ed6d3), C32e(0x3c44503c), - C32e(0x798b5579), C32e(0xe23d63e2), C32e(0x1d272c1d), C32e(0x769a4176), - C32e(0x3b4dad3b), C32e(0x56fac856), C32e(0x4ed2e84e), C32e(0x1e22281e), - C32e(0xdb763fdb), C32e(0x0a1e180a), C32e(0x6cb4906c), C32e(0xe4376be4), - C32e(0x5de7255d), C32e(0x6eb2616e), C32e(0xef2a86ef), C32e(0xa6f193a6), - C32e(0xa8e372a8), C32e(0xa4f762a4), C32e(0x3759bd37), C32e(0x8b86ff8b), - C32e(0x3256b132), C32e(0x43c50d43), C32e(0x59ebdc59), C32e(0xb7c2afb7), - C32e(0x8c8f028c), C32e(0x64ac7964), C32e(0xd26d23d2), C32e(0xe03b92e0), - C32e(0xb4c7abb4), C32e(0xfa1543fa), C32e(0x0709fd07), C32e(0x256f8525), - C32e(0xafea8faf), C32e(0x8e89f38e), C32e(0xe9208ee9), C32e(0x18282018), - C32e(0xd564ded5), C32e(0x8883fb88), C32e(0x6fb1946f), C32e(0x7296b872), - C32e(0x246c7024), C32e(0xf108aef1), C32e(0xc752e6c7), C32e(0x51f33551), - C32e(0x23658d23), C32e(0x7c84597c), C32e(0x9cbfcb9c), C32e(0x21637c21), - C32e(0xdd7c37dd), C32e(0xdc7fc2dc), C32e(0x86911a86), C32e(0x85941e85), - C32e(0x90abdb90), C32e(0x42c6f842), C32e(0xc457e2c4), C32e(0xaae583aa), - C32e(0xd8733bd8), C32e(0x050f0c05), C32e(0x0103f501), C32e(0x12363812), - C32e(0xa3fe9fa3), C32e(0x5fe1d45f), C32e(0xf91047f9), C32e(0xd06bd2d0), - C32e(0x91a82e91), C32e(0x58e82958), C32e(0x27697427), C32e(0xb9d04eb9), - C32e(0x3848a938), C32e(0x1335cd13), C32e(0xb3ce56b3), C32e(0x33554433), - C32e(0xbbd6bfbb), C32e(0x70904970), C32e(0x89800e89), C32e(0xa7f266a7), - C32e(0xb6c15ab6), C32e(0x22667822), C32e(0x92ad2a92), C32e(0x20608920), - C32e(0x49db1549), C32e(0xff1a4fff), C32e(0x7888a078), C32e(0x7a8e517a), - C32e(0x8f8a068f), C32e(0xf813b2f8), C32e(0x809b1280), C32e(0x17393417), - C32e(0xda75cada), C32e(0x3153b531), C32e(0xc65113c6), C32e(0xb8d3bbb8), - C32e(0xc35e1fc3), C32e(0xb0cb52b0), C32e(0x7799b477), C32e(0x11333c11), - C32e(0xcb46f6cb), C32e(0xfc1f4bfc), C32e(0xd661dad6), C32e(0x3a4e583a) -}; - -static const sph_u32 T2up[] = { - C32e(0xa5c6c632), C32e(0x84f8f86f), C32e(0x99eeee5e), C32e(0x8df6f67a), - C32e(0x0dffffe8), C32e(0xbdd6d60a), C32e(0xb1dede16), C32e(0x5491916d), - C32e(0x50606090), C32e(0x03020207), C32e(0xa9cece2e), C32e(0x7d5656d1), - C32e(0x19e7e7cc), C32e(0x62b5b513), C32e(0xe64d4d7c), C32e(0x9aecec59), - C32e(0x458f8f40), C32e(0x9d1f1fa3), C32e(0x40898949), C32e(0x87fafa68), - C32e(0x15efefd0), C32e(0xebb2b294), C32e(0xc98e8ece), C32e(0x0bfbfbe6), - C32e(0xec41416e), C32e(0x67b3b31a), C32e(0xfd5f5f43), C32e(0xea454560), - C32e(0xbf2323f9), C32e(0xf7535351), C32e(0x96e4e445), C32e(0x5b9b9b76), - C32e(0xc2757528), C32e(0x1ce1e1c5), C32e(0xae3d3dd4), C32e(0x6a4c4cf2), - C32e(0x5a6c6c82), C32e(0x417e7ebd), C32e(0x02f5f5f3), C32e(0x4f838352), - C32e(0x5c68688c), C32e(0xf4515156), C32e(0x34d1d18d), C32e(0x08f9f9e1), - C32e(0x93e2e24c), C32e(0x73abab3e), C32e(0x53626297), C32e(0x3f2a2a6b), - C32e(0x0c08081c), C32e(0x52959563), C32e(0x654646e9), C32e(0x5e9d9d7f), - C32e(0x28303048), C32e(0xa13737cf), C32e(0x0f0a0a1b), C32e(0xb52f2feb), - C32e(0x090e0e15), C32e(0x3624247e), C32e(0x9b1b1bad), C32e(0x3ddfdf98), - C32e(0x26cdcda7), C32e(0x694e4ef5), C32e(0xcd7f7f33), C32e(0x9feaea50), - C32e(0x1b12123f), C32e(0x9e1d1da4), C32e(0x745858c4), C32e(0x2e343446), - C32e(0x2d363641), C32e(0xb2dcdc11), C32e(0xeeb4b49d), C32e(0xfb5b5b4d), - C32e(0xf6a4a4a5), C32e(0x4d7676a1), C32e(0x61b7b714), C32e(0xce7d7d34), - C32e(0x7b5252df), C32e(0x3edddd9f), C32e(0x715e5ecd), C32e(0x971313b1), - C32e(0xf5a6a6a2), C32e(0x68b9b901), C32e(0x00000000), C32e(0x2cc1c1b5), - C32e(0x604040e0), C32e(0x1fe3e3c2), C32e(0xc879793a), C32e(0xedb6b69a), - C32e(0xbed4d40d), C32e(0x468d8d47), C32e(0xd9676717), C32e(0x4b7272af), - C32e(0xde9494ed), C32e(0xd49898ff), C32e(0xe8b0b093), C32e(0x4a85855b), - C32e(0x6bbbbb06), C32e(0x2ac5c5bb), C32e(0xe54f4f7b), C32e(0x16ededd7), - C32e(0xc58686d2), C32e(0xd79a9af8), C32e(0x55666699), C32e(0x941111b6), - C32e(0xcf8a8ac0), C32e(0x10e9e9d9), C32e(0x0604040e), C32e(0x81fefe66), - C32e(0xf0a0a0ab), C32e(0x447878b4), C32e(0xba2525f0), C32e(0xe34b4b75), - C32e(0xf3a2a2ac), C32e(0xfe5d5d44), C32e(0xc08080db), C32e(0x8a050580), - C32e(0xad3f3fd3), C32e(0xbc2121fe), C32e(0x487070a8), C32e(0x04f1f1fd), - C32e(0xdf636319), C32e(0xc177772f), C32e(0x75afaf30), C32e(0x634242e7), - C32e(0x30202070), C32e(0x1ae5e5cb), C32e(0x0efdfdef), C32e(0x6dbfbf08), - C32e(0x4c818155), C32e(0x14181824), C32e(0x35262679), C32e(0x2fc3c3b2), - C32e(0xe1bebe86), C32e(0xa23535c8), C32e(0xcc8888c7), C32e(0x392e2e65), - C32e(0x5793936a), C32e(0xf2555558), C32e(0x82fcfc61), C32e(0x477a7ab3), - C32e(0xacc8c827), C32e(0xe7baba88), C32e(0x2b32324f), C32e(0x95e6e642), - C32e(0xa0c0c03b), C32e(0x981919aa), C32e(0xd19e9ef6), C32e(0x7fa3a322), - C32e(0x664444ee), C32e(0x7e5454d6), C32e(0xab3b3bdd), C32e(0x830b0b95), - C32e(0xca8c8cc9), C32e(0x29c7c7bc), C32e(0xd36b6b05), C32e(0x3c28286c), - C32e(0x79a7a72c), C32e(0xe2bcbc81), C32e(0x1d161631), C32e(0x76adad37), - C32e(0x3bdbdb96), C32e(0x5664649e), C32e(0x4e7474a6), C32e(0x1e141436), - C32e(0xdb9292e4), C32e(0x0a0c0c12), C32e(0x6c4848fc), C32e(0xe4b8b88f), - C32e(0x5d9f9f78), C32e(0x6ebdbd0f), C32e(0xef434369), C32e(0xa6c4c435), - C32e(0xa83939da), C32e(0xa43131c6), C32e(0x37d3d38a), C32e(0x8bf2f274), - C32e(0x32d5d583), C32e(0x438b8b4e), C32e(0x596e6e85), C32e(0xb7dada18), - C32e(0x8c01018e), C32e(0x64b1b11d), C32e(0xd29c9cf1), C32e(0xe0494972), - C32e(0xb4d8d81f), C32e(0xfaacacb9), C32e(0x07f3f3fa), C32e(0x25cfcfa0), - C32e(0xafcaca20), C32e(0x8ef4f47d), C32e(0xe9474767), C32e(0x18101038), - C32e(0xd56f6f0b), C32e(0x88f0f073), C32e(0x6f4a4afb), C32e(0x725c5cca), - C32e(0x24383854), C32e(0xf157575f), C32e(0xc7737321), C32e(0x51979764), - C32e(0x23cbcbae), C32e(0x7ca1a125), C32e(0x9ce8e857), C32e(0x213e3e5d), - C32e(0xdd9696ea), C32e(0xdc61611e), C32e(0x860d0d9c), C32e(0x850f0f9b), - C32e(0x90e0e04b), C32e(0x427c7cba), C32e(0xc4717126), C32e(0xaacccc29), - C32e(0xd89090e3), C32e(0x05060609), C32e(0x01f7f7f4), C32e(0x121c1c2a), - C32e(0xa3c2c23c), C32e(0x5f6a6a8b), C32e(0xf9aeaebe), C32e(0xd0696902), - C32e(0x911717bf), C32e(0x58999971), C32e(0x273a3a53), C32e(0xb92727f7), - C32e(0x38d9d991), C32e(0x13ebebde), C32e(0xb32b2be5), C32e(0x33222277), - C32e(0xbbd2d204), C32e(0x70a9a939), C32e(0x89070787), C32e(0xa73333c1), - C32e(0xb62d2dec), C32e(0x223c3c5a), C32e(0x921515b8), C32e(0x20c9c9a9), - C32e(0x4987875c), C32e(0xffaaaab0), C32e(0x785050d8), C32e(0x7aa5a52b), - C32e(0x8f030389), C32e(0xf859594a), C32e(0x80090992), C32e(0x171a1a23), - C32e(0xda656510), C32e(0x31d7d784), C32e(0xc68484d5), C32e(0xb8d0d003), - C32e(0xc38282dc), C32e(0xb02929e2), C32e(0x775a5ac3), C32e(0x111e1e2d), - C32e(0xcb7b7b3d), C32e(0xfca8a8b7), C32e(0xd66d6d0c), C32e(0x3a2c2c62) -}; - -static const sph_u32 T2dn[] = { - C32e(0xf4a5f497), C32e(0x978497eb), C32e(0xb099b0c7), C32e(0x8c8d8cf7), - C32e(0x170d17e5), C32e(0xdcbddcb7), C32e(0xc8b1c8a7), C32e(0xfc54fc39), - C32e(0xf050f0c0), C32e(0x05030504), C32e(0xe0a9e087), C32e(0x877d87ac), - C32e(0x2b192bd5), C32e(0xa662a671), C32e(0x31e6319a), C32e(0xb59ab5c3), - C32e(0xcf45cf05), C32e(0xbc9dbc3e), C32e(0xc040c009), C32e(0x928792ef), - C32e(0x3f153fc5), C32e(0x26eb267f), C32e(0x40c94007), C32e(0x1d0b1ded), - C32e(0x2fec2f82), C32e(0xa967a97d), C32e(0x1cfd1cbe), C32e(0x25ea258a), - C32e(0xdabfda46), C32e(0x02f702a6), C32e(0xa196a1d3), C32e(0xed5bed2d), - C32e(0x5dc25dea), C32e(0x241c24d9), C32e(0xe9aee97a), C32e(0xbe6abe98), - C32e(0xee5aeed8), C32e(0xc341c3fc), C32e(0x060206f1), C32e(0xd14fd11d), - C32e(0xe45ce4d0), C32e(0x07f407a2), C32e(0x5c345cb9), C32e(0x180818e9), - C32e(0xae93aedf), C32e(0x9573954d), C32e(0xf553f5c4), C32e(0x413f4154), - C32e(0x140c1410), C32e(0xf652f631), C32e(0xaf65af8c), C32e(0xe25ee221), - C32e(0x78287860), C32e(0xf8a1f86e), C32e(0x110f1114), C32e(0xc4b5c45e), - C32e(0x1b091b1c), C32e(0x5a365a48), C32e(0xb69bb636), C32e(0x473d47a5), - C32e(0x6a266a81), C32e(0xbb69bb9c), C32e(0x4ccd4cfe), C32e(0xba9fbacf), - C32e(0x2d1b2d24), C32e(0xb99eb93a), C32e(0x9c749cb0), C32e(0x722e7268), - C32e(0x772d776c), C32e(0xcdb2cda3), C32e(0x29ee2973), C32e(0x16fb16b6), - C32e(0x01f60153), C32e(0xd74dd7ec), C32e(0xa361a375), C32e(0x49ce49fa), - C32e(0x8d7b8da4), C32e(0x423e42a1), C32e(0x937193bc), C32e(0xa297a226), - C32e(0x04f50457), C32e(0xb868b869), C32e(0x00000000), C32e(0x742c7499), - C32e(0xa060a080), C32e(0x211f21dd), C32e(0x43c843f2), C32e(0x2ced2c77), - C32e(0xd9bed9b3), C32e(0xca46ca01), C32e(0x70d970ce), C32e(0xdd4bdde4), - C32e(0x79de7933), C32e(0x67d4672b), C32e(0x23e8237b), C32e(0xde4ade11), - C32e(0xbd6bbd6d), C32e(0x7e2a7e91), C32e(0x34e5349e), C32e(0x3a163ac1), - C32e(0x54c55417), C32e(0x62d7622f), C32e(0xff55ffcc), C32e(0xa794a722), - C32e(0x4acf4a0f), C32e(0x301030c9), C32e(0x0a060a08), C32e(0x988198e7), - C32e(0x0bf00b5b), C32e(0xcc44ccf0), C32e(0xd5bad54a), C32e(0x3ee33e96), - C32e(0x0ef30e5f), C32e(0x19fe19ba), C32e(0x5bc05b1b), C32e(0x858a850a), - C32e(0xecadec7e), C32e(0xdfbcdf42), C32e(0xd848d8e0), C32e(0x0c040cf9), - C32e(0x7adf7ac6), C32e(0x58c158ee), C32e(0x9f759f45), C32e(0xa563a584), - C32e(0x50305040), C32e(0x2e1a2ed1), C32e(0x120e12e1), C32e(0xb76db765), - C32e(0xd44cd419), C32e(0x3c143c30), C32e(0x5f355f4c), C32e(0x712f719d), - C32e(0x38e13867), C32e(0xfda2fd6a), C32e(0x4fcc4f0b), C32e(0x4b394b5c), - C32e(0xf957f93d), C32e(0x0df20daa), C32e(0x9d829de3), C32e(0xc947c9f4), - C32e(0xefacef8b), C32e(0x32e7326f), C32e(0x7d2b7d64), C32e(0xa495a4d7), - C32e(0xfba0fb9b), C32e(0xb398b332), C32e(0x68d16827), C32e(0x817f815d), - C32e(0xaa66aa88), C32e(0x827e82a8), C32e(0xe6abe676), C32e(0x9e839e16), - C32e(0x45ca4503), C32e(0x7b297b95), C32e(0x6ed36ed6), C32e(0x443c4450), - C32e(0x8b798b55), C32e(0x3de23d63), C32e(0x271d272c), C32e(0x9a769a41), - C32e(0x4d3b4dad), C32e(0xfa56fac8), C32e(0xd24ed2e8), C32e(0x221e2228), - C32e(0x76db763f), C32e(0x1e0a1e18), C32e(0xb46cb490), C32e(0x37e4376b), - C32e(0xe75de725), C32e(0xb26eb261), C32e(0x2aef2a86), C32e(0xf1a6f193), - C32e(0xe3a8e372), C32e(0xf7a4f762), C32e(0x593759bd), C32e(0x868b86ff), - C32e(0x563256b1), C32e(0xc543c50d), C32e(0xeb59ebdc), C32e(0xc2b7c2af), - C32e(0x8f8c8f02), C32e(0xac64ac79), C32e(0x6dd26d23), C32e(0x3be03b92), - C32e(0xc7b4c7ab), C32e(0x15fa1543), C32e(0x090709fd), C32e(0x6f256f85), - C32e(0xeaafea8f), C32e(0x898e89f3), C32e(0x20e9208e), C32e(0x28182820), - C32e(0x64d564de), C32e(0x838883fb), C32e(0xb16fb194), C32e(0x967296b8), - C32e(0x6c246c70), C32e(0x08f108ae), C32e(0x52c752e6), C32e(0xf351f335), - C32e(0x6523658d), C32e(0x847c8459), C32e(0xbf9cbfcb), C32e(0x6321637c), - C32e(0x7cdd7c37), C32e(0x7fdc7fc2), C32e(0x9186911a), C32e(0x9485941e), - C32e(0xab90abdb), C32e(0xc642c6f8), C32e(0x57c457e2), C32e(0xe5aae583), - C32e(0x73d8733b), C32e(0x0f050f0c), C32e(0x030103f5), C32e(0x36123638), - C32e(0xfea3fe9f), C32e(0xe15fe1d4), C32e(0x10f91047), C32e(0x6bd06bd2), - C32e(0xa891a82e), C32e(0xe858e829), C32e(0x69276974), C32e(0xd0b9d04e), - C32e(0x483848a9), C32e(0x351335cd), C32e(0xceb3ce56), C32e(0x55335544), - C32e(0xd6bbd6bf), C32e(0x90709049), C32e(0x8089800e), C32e(0xf2a7f266), - C32e(0xc1b6c15a), C32e(0x66226678), C32e(0xad92ad2a), C32e(0x60206089), - C32e(0xdb49db15), C32e(0x1aff1a4f), C32e(0x887888a0), C32e(0x8e7a8e51), - C32e(0x8a8f8a06), C32e(0x13f813b2), C32e(0x9b809b12), C32e(0x39173934), - C32e(0x75da75ca), C32e(0x533153b5), C32e(0x51c65113), C32e(0xd3b8d3bb), - C32e(0x5ec35e1f), C32e(0xcbb0cb52), C32e(0x997799b4), C32e(0x3311333c), - C32e(0x46cb46f6), C32e(0x1ffc1f4b), C32e(0x61d661da), C32e(0x4e3a4e58) -}; - -static const sph_u32 T3up[] = { - C32e(0x97a5c6c6), C32e(0xeb84f8f8), C32e(0xc799eeee), C32e(0xf78df6f6), - C32e(0xe50dffff), C32e(0xb7bdd6d6), C32e(0xa7b1dede), C32e(0x39549191), - C32e(0xc0506060), C32e(0x04030202), C32e(0x87a9cece), C32e(0xac7d5656), - C32e(0xd519e7e7), C32e(0x7162b5b5), C32e(0x9ae64d4d), C32e(0xc39aecec), - C32e(0x05458f8f), C32e(0x3e9d1f1f), C32e(0x09408989), C32e(0xef87fafa), - C32e(0xc515efef), C32e(0x7febb2b2), C32e(0x07c98e8e), C32e(0xed0bfbfb), - C32e(0x82ec4141), C32e(0x7d67b3b3), C32e(0xbefd5f5f), C32e(0x8aea4545), - C32e(0x46bf2323), C32e(0xa6f75353), C32e(0xd396e4e4), C32e(0x2d5b9b9b), - C32e(0xeac27575), C32e(0xd91ce1e1), C32e(0x7aae3d3d), C32e(0x986a4c4c), - C32e(0xd85a6c6c), C32e(0xfc417e7e), C32e(0xf102f5f5), C32e(0x1d4f8383), - C32e(0xd05c6868), C32e(0xa2f45151), C32e(0xb934d1d1), C32e(0xe908f9f9), - C32e(0xdf93e2e2), C32e(0x4d73abab), C32e(0xc4536262), C32e(0x543f2a2a), - C32e(0x100c0808), C32e(0x31529595), C32e(0x8c654646), C32e(0x215e9d9d), - C32e(0x60283030), C32e(0x6ea13737), C32e(0x140f0a0a), C32e(0x5eb52f2f), - C32e(0x1c090e0e), C32e(0x48362424), C32e(0x369b1b1b), C32e(0xa53ddfdf), - C32e(0x8126cdcd), C32e(0x9c694e4e), C32e(0xfecd7f7f), C32e(0xcf9feaea), - C32e(0x241b1212), C32e(0x3a9e1d1d), C32e(0xb0745858), C32e(0x682e3434), - C32e(0x6c2d3636), C32e(0xa3b2dcdc), C32e(0x73eeb4b4), C32e(0xb6fb5b5b), - C32e(0x53f6a4a4), C32e(0xec4d7676), C32e(0x7561b7b7), C32e(0xface7d7d), - C32e(0xa47b5252), C32e(0xa13edddd), C32e(0xbc715e5e), C32e(0x26971313), - C32e(0x57f5a6a6), C32e(0x6968b9b9), C32e(0x00000000), C32e(0x992cc1c1), - C32e(0x80604040), C32e(0xdd1fe3e3), C32e(0xf2c87979), C32e(0x77edb6b6), - C32e(0xb3bed4d4), C32e(0x01468d8d), C32e(0xced96767), C32e(0xe44b7272), - C32e(0x33de9494), C32e(0x2bd49898), C32e(0x7be8b0b0), C32e(0x114a8585), - C32e(0x6d6bbbbb), C32e(0x912ac5c5), C32e(0x9ee54f4f), C32e(0xc116eded), - C32e(0x17c58686), C32e(0x2fd79a9a), C32e(0xcc556666), C32e(0x22941111), - C32e(0x0fcf8a8a), C32e(0xc910e9e9), C32e(0x08060404), C32e(0xe781fefe), - C32e(0x5bf0a0a0), C32e(0xf0447878), C32e(0x4aba2525), C32e(0x96e34b4b), - C32e(0x5ff3a2a2), C32e(0xbafe5d5d), C32e(0x1bc08080), C32e(0x0a8a0505), - C32e(0x7ead3f3f), C32e(0x42bc2121), C32e(0xe0487070), C32e(0xf904f1f1), - C32e(0xc6df6363), C32e(0xeec17777), C32e(0x4575afaf), C32e(0x84634242), - C32e(0x40302020), C32e(0xd11ae5e5), C32e(0xe10efdfd), C32e(0x656dbfbf), - C32e(0x194c8181), C32e(0x30141818), C32e(0x4c352626), C32e(0x9d2fc3c3), - C32e(0x67e1bebe), C32e(0x6aa23535), C32e(0x0bcc8888), C32e(0x5c392e2e), - C32e(0x3d579393), C32e(0xaaf25555), C32e(0xe382fcfc), C32e(0xf4477a7a), - C32e(0x8bacc8c8), C32e(0x6fe7baba), C32e(0x642b3232), C32e(0xd795e6e6), - C32e(0x9ba0c0c0), C32e(0x32981919), C32e(0x27d19e9e), C32e(0x5d7fa3a3), - C32e(0x88664444), C32e(0xa87e5454), C32e(0x76ab3b3b), C32e(0x16830b0b), - C32e(0x03ca8c8c), C32e(0x9529c7c7), C32e(0xd6d36b6b), C32e(0x503c2828), - C32e(0x5579a7a7), C32e(0x63e2bcbc), C32e(0x2c1d1616), C32e(0x4176adad), - C32e(0xad3bdbdb), C32e(0xc8566464), C32e(0xe84e7474), C32e(0x281e1414), - C32e(0x3fdb9292), C32e(0x180a0c0c), C32e(0x906c4848), C32e(0x6be4b8b8), - C32e(0x255d9f9f), C32e(0x616ebdbd), C32e(0x86ef4343), C32e(0x93a6c4c4), - C32e(0x72a83939), C32e(0x62a43131), C32e(0xbd37d3d3), C32e(0xff8bf2f2), - C32e(0xb132d5d5), C32e(0x0d438b8b), C32e(0xdc596e6e), C32e(0xafb7dada), - C32e(0x028c0101), C32e(0x7964b1b1), C32e(0x23d29c9c), C32e(0x92e04949), - C32e(0xabb4d8d8), C32e(0x43faacac), C32e(0xfd07f3f3), C32e(0x8525cfcf), - C32e(0x8fafcaca), C32e(0xf38ef4f4), C32e(0x8ee94747), C32e(0x20181010), - C32e(0xded56f6f), C32e(0xfb88f0f0), C32e(0x946f4a4a), C32e(0xb8725c5c), - C32e(0x70243838), C32e(0xaef15757), C32e(0xe6c77373), C32e(0x35519797), - C32e(0x8d23cbcb), C32e(0x597ca1a1), C32e(0xcb9ce8e8), C32e(0x7c213e3e), - C32e(0x37dd9696), C32e(0xc2dc6161), C32e(0x1a860d0d), C32e(0x1e850f0f), - C32e(0xdb90e0e0), C32e(0xf8427c7c), C32e(0xe2c47171), C32e(0x83aacccc), - C32e(0x3bd89090), C32e(0x0c050606), C32e(0xf501f7f7), C32e(0x38121c1c), - C32e(0x9fa3c2c2), C32e(0xd45f6a6a), C32e(0x47f9aeae), C32e(0xd2d06969), - C32e(0x2e911717), C32e(0x29589999), C32e(0x74273a3a), C32e(0x4eb92727), - C32e(0xa938d9d9), C32e(0xcd13ebeb), C32e(0x56b32b2b), C32e(0x44332222), - C32e(0xbfbbd2d2), C32e(0x4970a9a9), C32e(0x0e890707), C32e(0x66a73333), - C32e(0x5ab62d2d), C32e(0x78223c3c), C32e(0x2a921515), C32e(0x8920c9c9), - C32e(0x15498787), C32e(0x4fffaaaa), C32e(0xa0785050), C32e(0x517aa5a5), - C32e(0x068f0303), C32e(0xb2f85959), C32e(0x12800909), C32e(0x34171a1a), - C32e(0xcada6565), C32e(0xb531d7d7), C32e(0x13c68484), C32e(0xbbb8d0d0), - C32e(0x1fc38282), C32e(0x52b02929), C32e(0xb4775a5a), C32e(0x3c111e1e), - C32e(0xf6cb7b7b), C32e(0x4bfca8a8), C32e(0xdad66d6d), C32e(0x583a2c2c) -}; - -static const sph_u32 T3dn[] = { - C32e(0x32f4a5f4), C32e(0x6f978497), C32e(0x5eb099b0), C32e(0x7a8c8d8c), - C32e(0xe8170d17), C32e(0x0adcbddc), C32e(0x16c8b1c8), C32e(0x6dfc54fc), - C32e(0x90f050f0), C32e(0x07050305), C32e(0x2ee0a9e0), C32e(0xd1877d87), - C32e(0xcc2b192b), C32e(0x13a662a6), C32e(0x7c31e631), C32e(0x59b59ab5), - C32e(0x40cf45cf), C32e(0xa3bc9dbc), C32e(0x49c040c0), C32e(0x68928792), - C32e(0xd03f153f), C32e(0x9426eb26), C32e(0xce40c940), C32e(0xe61d0b1d), - C32e(0x6e2fec2f), C32e(0x1aa967a9), C32e(0x431cfd1c), C32e(0x6025ea25), - C32e(0xf9dabfda), C32e(0x5102f702), C32e(0x45a196a1), C32e(0x76ed5bed), - C32e(0x285dc25d), C32e(0xc5241c24), C32e(0xd4e9aee9), C32e(0xf2be6abe), - C32e(0x82ee5aee), C32e(0xbdc341c3), C32e(0xf3060206), C32e(0x52d14fd1), - C32e(0x8ce45ce4), C32e(0x5607f407), C32e(0x8d5c345c), C32e(0xe1180818), - C32e(0x4cae93ae), C32e(0x3e957395), C32e(0x97f553f5), C32e(0x6b413f41), - C32e(0x1c140c14), C32e(0x63f652f6), C32e(0xe9af65af), C32e(0x7fe25ee2), - C32e(0x48782878), C32e(0xcff8a1f8), C32e(0x1b110f11), C32e(0xebc4b5c4), - C32e(0x151b091b), C32e(0x7e5a365a), C32e(0xadb69bb6), C32e(0x98473d47), - C32e(0xa76a266a), C32e(0xf5bb69bb), C32e(0x334ccd4c), C32e(0x50ba9fba), - C32e(0x3f2d1b2d), C32e(0xa4b99eb9), C32e(0xc49c749c), C32e(0x46722e72), - C32e(0x41772d77), C32e(0x11cdb2cd), C32e(0x9d29ee29), C32e(0x4d16fb16), - C32e(0xa501f601), C32e(0xa1d74dd7), C32e(0x14a361a3), C32e(0x3449ce49), - C32e(0xdf8d7b8d), C32e(0x9f423e42), C32e(0xcd937193), C32e(0xb1a297a2), - C32e(0xa204f504), C32e(0x01b868b8), C32e(0x00000000), C32e(0xb5742c74), - C32e(0xe0a060a0), C32e(0xc2211f21), C32e(0x3a43c843), C32e(0x9a2ced2c), - C32e(0x0dd9bed9), C32e(0x47ca46ca), C32e(0x1770d970), C32e(0xafdd4bdd), - C32e(0xed79de79), C32e(0xff67d467), C32e(0x9323e823), C32e(0x5bde4ade), - C32e(0x06bd6bbd), C32e(0xbb7e2a7e), C32e(0x7b34e534), C32e(0xd73a163a), - C32e(0xd254c554), C32e(0xf862d762), C32e(0x99ff55ff), C32e(0xb6a794a7), - C32e(0xc04acf4a), C32e(0xd9301030), C32e(0x0e0a060a), C32e(0x66988198), - C32e(0xab0bf00b), C32e(0xb4cc44cc), C32e(0xf0d5bad5), C32e(0x753ee33e), - C32e(0xac0ef30e), C32e(0x4419fe19), C32e(0xdb5bc05b), C32e(0x80858a85), - C32e(0xd3ecadec), C32e(0xfedfbcdf), C32e(0xa8d848d8), C32e(0xfd0c040c), - C32e(0x197adf7a), C32e(0x2f58c158), C32e(0x309f759f), C32e(0xe7a563a5), - C32e(0x70503050), C32e(0xcb2e1a2e), C32e(0xef120e12), C32e(0x08b76db7), - C32e(0x55d44cd4), C32e(0x243c143c), C32e(0x795f355f), C32e(0xb2712f71), - C32e(0x8638e138), C32e(0xc8fda2fd), C32e(0xc74fcc4f), C32e(0x654b394b), - C32e(0x6af957f9), C32e(0x580df20d), C32e(0x619d829d), C32e(0xb3c947c9), - C32e(0x27efacef), C32e(0x8832e732), C32e(0x4f7d2b7d), C32e(0x42a495a4), - C32e(0x3bfba0fb), C32e(0xaab398b3), C32e(0xf668d168), C32e(0x22817f81), - C32e(0xeeaa66aa), C32e(0xd6827e82), C32e(0xdde6abe6), C32e(0x959e839e), - C32e(0xc945ca45), C32e(0xbc7b297b), C32e(0x056ed36e), C32e(0x6c443c44), - C32e(0x2c8b798b), C32e(0x813de23d), C32e(0x31271d27), C32e(0x379a769a), - C32e(0x964d3b4d), C32e(0x9efa56fa), C32e(0xa6d24ed2), C32e(0x36221e22), - C32e(0xe476db76), C32e(0x121e0a1e), C32e(0xfcb46cb4), C32e(0x8f37e437), - C32e(0x78e75de7), C32e(0x0fb26eb2), C32e(0x692aef2a), C32e(0x35f1a6f1), - C32e(0xdae3a8e3), C32e(0xc6f7a4f7), C32e(0x8a593759), C32e(0x74868b86), - C32e(0x83563256), C32e(0x4ec543c5), C32e(0x85eb59eb), C32e(0x18c2b7c2), - C32e(0x8e8f8c8f), C32e(0x1dac64ac), C32e(0xf16dd26d), C32e(0x723be03b), - C32e(0x1fc7b4c7), C32e(0xb915fa15), C32e(0xfa090709), C32e(0xa06f256f), - C32e(0x20eaafea), C32e(0x7d898e89), C32e(0x6720e920), C32e(0x38281828), - C32e(0x0b64d564), C32e(0x73838883), C32e(0xfbb16fb1), C32e(0xca967296), - C32e(0x546c246c), C32e(0x5f08f108), C32e(0x2152c752), C32e(0x64f351f3), - C32e(0xae652365), C32e(0x25847c84), C32e(0x57bf9cbf), C32e(0x5d632163), - C32e(0xea7cdd7c), C32e(0x1e7fdc7f), C32e(0x9c918691), C32e(0x9b948594), - C32e(0x4bab90ab), C32e(0xbac642c6), C32e(0x2657c457), C32e(0x29e5aae5), - C32e(0xe373d873), C32e(0x090f050f), C32e(0xf4030103), C32e(0x2a361236), - C32e(0x3cfea3fe), C32e(0x8be15fe1), C32e(0xbe10f910), C32e(0x026bd06b), - C32e(0xbfa891a8), C32e(0x71e858e8), C32e(0x53692769), C32e(0xf7d0b9d0), - C32e(0x91483848), C32e(0xde351335), C32e(0xe5ceb3ce), C32e(0x77553355), - C32e(0x04d6bbd6), C32e(0x39907090), C32e(0x87808980), C32e(0xc1f2a7f2), - C32e(0xecc1b6c1), C32e(0x5a662266), C32e(0xb8ad92ad), C32e(0xa9602060), - C32e(0x5cdb49db), C32e(0xb01aff1a), C32e(0xd8887888), C32e(0x2b8e7a8e), - C32e(0x898a8f8a), C32e(0x4a13f813), C32e(0x929b809b), C32e(0x23391739), - C32e(0x1075da75), C32e(0x84533153), C32e(0xd551c651), C32e(0x03d3b8d3), - C32e(0xdc5ec35e), C32e(0xe2cbb0cb), C32e(0xc3997799), C32e(0x2d331133), - C32e(0x3d46cb46), C32e(0xb71ffc1f), C32e(0x0c61d661), C32e(0x624e3a4e) -}; - -#define DECL_STATE_SMALL \ - sph_u32 H[16]; - -#define READ_STATE_SMALL(sc) do { \ - memcpy(H, (sc)->state.narrow, sizeof H); \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - memcpy((sc)->state.narrow, H, sizeof H); \ - } while (0) - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#define RSTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d0] = T0up[B32_0(a[b0])] \ - ^ T1up[B32_1(a[b1])] \ - ^ T2up[B32_2(a[b2])] \ - ^ T3up[B32_3(a[b3])] \ - ^ T0dn[B32_0(a[b4])] \ - ^ T1dn[B32_1(a[b5])] \ - ^ T2dn[B32_2(a[b6])] \ - ^ T3dn[B32_3(a[b7])]; \ - t[d1] = T0dn[B32_0(a[b0])] \ - ^ T1dn[B32_1(a[b1])] \ - ^ T2dn[B32_2(a[b2])] \ - ^ T3dn[B32_3(a[b3])] \ - ^ T0up[B32_0(a[b4])] \ - ^ T1up[B32_1(a[b5])] \ - ^ T2up[B32_2(a[b6])] \ - ^ T3up[B32_3(a[b7])]; \ - } while (0) - -#define ROUND_SMALL_P(a, r) do { \ - sph_u32 t[16]; \ - a[0x0] ^= PC32up(0x00, r); \ - a[0x1] ^= PC32dn(0x00, r); \ - a[0x2] ^= PC32up(0x10, r); \ - a[0x3] ^= PC32dn(0x10, r); \ - a[0x4] ^= PC32up(0x20, r); \ - a[0x5] ^= PC32dn(0x20, r); \ - a[0x6] ^= PC32up(0x30, r); \ - a[0x7] ^= PC32dn(0x30, r); \ - a[0x8] ^= PC32up(0x40, r); \ - a[0x9] ^= PC32dn(0x40, r); \ - a[0xA] ^= PC32up(0x50, r); \ - a[0xB] ^= PC32dn(0x50, r); \ - a[0xC] ^= PC32up(0x60, r); \ - a[0xD] ^= PC32dn(0x60, r); \ - a[0xE] ^= PC32up(0x70, r); \ - a[0xF] ^= PC32dn(0x70, r); \ - RSTT(0x0, 0x1, a, 0x0, 0x2, 0x4, 0x6, 0x9, 0xB, 0xD, 0xF); \ - RSTT(0x2, 0x3, a, 0x2, 0x4, 0x6, 0x8, 0xB, 0xD, 0xF, 0x1); \ - RSTT(0x4, 0x5, a, 0x4, 0x6, 0x8, 0xA, 0xD, 0xF, 0x1, 0x3); \ - RSTT(0x6, 0x7, a, 0x6, 0x8, 0xA, 0xC, 0xF, 0x1, 0x3, 0x5); \ - RSTT(0x8, 0x9, a, 0x8, 0xA, 0xC, 0xE, 0x1, 0x3, 0x5, 0x7); \ - RSTT(0xA, 0xB, a, 0xA, 0xC, 0xE, 0x0, 0x3, 0x5, 0x7, 0x9); \ - RSTT(0xC, 0xD, a, 0xC, 0xE, 0x0, 0x2, 0x5, 0x7, 0x9, 0xB); \ - RSTT(0xE, 0xF, a, 0xE, 0x0, 0x2, 0x4, 0x7, 0x9, 0xB, 0xD); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_SMALL_Q(a, r) do { \ - sph_u32 t[16]; \ - a[0x0] ^= QC32up(0x00, r); \ - a[0x1] ^= QC32dn(0x00, r); \ - a[0x2] ^= QC32up(0x10, r); \ - a[0x3] ^= QC32dn(0x10, r); \ - a[0x4] ^= QC32up(0x20, r); \ - a[0x5] ^= QC32dn(0x20, r); \ - a[0x6] ^= QC32up(0x30, r); \ - a[0x7] ^= QC32dn(0x30, r); \ - a[0x8] ^= QC32up(0x40, r); \ - a[0x9] ^= QC32dn(0x40, r); \ - a[0xA] ^= QC32up(0x50, r); \ - a[0xB] ^= QC32dn(0x50, r); \ - a[0xC] ^= QC32up(0x60, r); \ - a[0xD] ^= QC32dn(0x60, r); \ - a[0xE] ^= QC32up(0x70, r); \ - a[0xF] ^= QC32dn(0x70, r); \ - RSTT(0x0, 0x1, a, 0x2, 0x6, 0xA, 0xE, 0x1, 0x5, 0x9, 0xD); \ - RSTT(0x2, 0x3, a, 0x4, 0x8, 0xC, 0x0, 0x3, 0x7, 0xB, 0xF); \ - RSTT(0x4, 0x5, a, 0x6, 0xA, 0xE, 0x2, 0x5, 0x9, 0xD, 0x1); \ - RSTT(0x6, 0x7, a, 0x8, 0xC, 0x0, 0x4, 0x7, 0xB, 0xF, 0x3); \ - RSTT(0x8, 0x9, a, 0xA, 0xE, 0x2, 0x6, 0x9, 0xD, 0x1, 0x5); \ - RSTT(0xA, 0xB, a, 0xC, 0x0, 0x4, 0x8, 0xB, 0xF, 0x3, 0x7); \ - RSTT(0xC, 0xD, a, 0xE, 0x2, 0x6, 0xA, 0xD, 0x1, 0x5, 0x9); \ - RSTT(0xE, 0xF, a, 0x0, 0x4, 0x8, 0xC, 0xF, 0x3, 0x7, 0xB); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_P(a, r); \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r ++) \ - ROUND_SMALL_Q(a, r); \ - } while (0) - -#else - -#define PERM_SMALL_P(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_P(a, r + 0); \ - ROUND_SMALL_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_SMALL_Q(a) do { \ - int r; \ - for (r = 0; r < 10; r += 2) { \ - ROUND_SMALL_Q(a, r + 0); \ - ROUND_SMALL_Q(a, r + 1); \ - } \ - } while (0) - -#endif - -#define COMPRESS_SMALL do { \ - sph_u32 g[16], m[16]; \ - size_t u; \ - for (u = 0; u < 16; u ++) { \ - m[u] = dec32e_aligned(buf + (u << 2)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_SMALL_P(g); \ - PERM_SMALL_Q(m); \ - for (u = 0; u < 16; u ++) \ - H[u] ^= g[u] ^ m[u]; \ - } while (0) - -#define FINAL_SMALL do { \ - sph_u32 x[16]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_SMALL_P(x); \ - for (u = 0; u < 16; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#define DECL_STATE_BIG \ - sph_u32 H[32]; - -#define READ_STATE_BIG(sc) do { \ - memcpy(H, (sc)->state.narrow, sizeof H); \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - memcpy((sc)->state.narrow, H, sizeof H); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define RBTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - sph_u32 fu2 = T0up[B32_2(a[b2])]; \ - sph_u32 fd2 = T0dn[B32_2(a[b2])]; \ - sph_u32 fu3 = T1up[B32_3(a[b3])]; \ - sph_u32 fd3 = T1dn[B32_3(a[b3])]; \ - sph_u32 fu6 = T0up[B32_2(a[b6])]; \ - sph_u32 fd6 = T0dn[B32_2(a[b6])]; \ - sph_u32 fu7 = T1up[B32_3(a[b7])]; \ - sph_u32 fd7 = T1dn[B32_3(a[b7])]; \ - t[d0] = T0up[B32_0(a[b0])] \ - ^ T1up[B32_1(a[b1])] \ - ^ R32u(fu2, fd2) \ - ^ R32u(fu3, fd3) \ - ^ T0dn[B32_0(a[b4])] \ - ^ T1dn[B32_1(a[b5])] \ - ^ R32d(fu6, fd6) \ - ^ R32d(fu7, fd7); \ - t[d1] = T0dn[B32_0(a[b0])] \ - ^ T1dn[B32_1(a[b1])] \ - ^ R32d(fu2, fd2) \ - ^ R32d(fu3, fd3) \ - ^ T0up[B32_0(a[b4])] \ - ^ T1up[B32_1(a[b5])] \ - ^ R32u(fu6, fd6) \ - ^ R32u(fu7, fd7); \ - } while (0) - -#else - -#define RBTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \ - t[d0] = T0up[B32_0(a[b0])] \ - ^ T1up[B32_1(a[b1])] \ - ^ T2up[B32_2(a[b2])] \ - ^ T3up[B32_3(a[b3])] \ - ^ T0dn[B32_0(a[b4])] \ - ^ T1dn[B32_1(a[b5])] \ - ^ T2dn[B32_2(a[b6])] \ - ^ T3dn[B32_3(a[b7])]; \ - t[d1] = T0dn[B32_0(a[b0])] \ - ^ T1dn[B32_1(a[b1])] \ - ^ T2dn[B32_2(a[b2])] \ - ^ T3dn[B32_3(a[b3])] \ - ^ T0up[B32_0(a[b4])] \ - ^ T1up[B32_1(a[b5])] \ - ^ T2up[B32_2(a[b6])] \ - ^ T3up[B32_3(a[b7])]; \ - } while (0) - -#endif - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define ROUND_BIG_P(a, r) do { \ - sph_u32 t[32]; \ - size_t u; \ - a[0x00] ^= PC32up(0x00, r); \ - a[0x01] ^= PC32dn(0x00, r); \ - a[0x02] ^= PC32up(0x10, r); \ - a[0x03] ^= PC32dn(0x10, r); \ - a[0x04] ^= PC32up(0x20, r); \ - a[0x05] ^= PC32dn(0x20, r); \ - a[0x06] ^= PC32up(0x30, r); \ - a[0x07] ^= PC32dn(0x30, r); \ - a[0x08] ^= PC32up(0x40, r); \ - a[0x09] ^= PC32dn(0x40, r); \ - a[0x0A] ^= PC32up(0x50, r); \ - a[0x0B] ^= PC32dn(0x50, r); \ - a[0x0C] ^= PC32up(0x60, r); \ - a[0x0D] ^= PC32dn(0x60, r); \ - a[0x0E] ^= PC32up(0x70, r); \ - a[0x0F] ^= PC32dn(0x70, r); \ - a[0x10] ^= PC32up(0x80, r); \ - a[0x11] ^= PC32dn(0x80, r); \ - a[0x12] ^= PC32up(0x90, r); \ - a[0x13] ^= PC32dn(0x90, r); \ - a[0x14] ^= PC32up(0xA0, r); \ - a[0x15] ^= PC32dn(0xA0, r); \ - a[0x16] ^= PC32up(0xB0, r); \ - a[0x17] ^= PC32dn(0xB0, r); \ - a[0x18] ^= PC32up(0xC0, r); \ - a[0x19] ^= PC32dn(0xC0, r); \ - a[0x1A] ^= PC32up(0xD0, r); \ - a[0x1B] ^= PC32dn(0xD0, r); \ - a[0x1C] ^= PC32up(0xE0, r); \ - a[0x1D] ^= PC32dn(0xE0, r); \ - a[0x1E] ^= PC32up(0xF0, r); \ - a[0x1F] ^= PC32dn(0xF0, r); \ - for (u = 0; u < 32; u += 8) { \ - RBTT(u + 0x00, (u + 0x01) & 0x1F, a, \ - u + 0x00, (u + 0x02) & 0x1F, \ - (u + 0x04) & 0x1F, (u + 0x06) & 0x1F, \ - (u + 0x09) & 0x1F, (u + 0x0B) & 0x1F, \ - (u + 0x0D) & 0x1F, (u + 0x17) & 0x1F); \ - RBTT(u + 0x02, (u + 0x03) & 0x1F, a, \ - u + 0x02, (u + 0x04) & 0x1F, \ - (u + 0x06) & 0x1F, (u + 0x08) & 0x1F, \ - (u + 0x0B) & 0x1F, (u + 0x0D) & 0x1F, \ - (u + 0x0F) & 0x1F, (u + 0x19) & 0x1F); \ - RBTT(u + 0x04, (u + 0x05) & 0x1F, a, \ - u + 0x04, (u + 0x06) & 0x1F, \ - (u + 0x08) & 0x1F, (u + 0x0A) & 0x1F, \ - (u + 0x0D) & 0x1F, (u + 0x0F) & 0x1F, \ - (u + 0x11) & 0x1F, (u + 0x1B) & 0x1F); \ - RBTT(u + 0x06, (u + 0x07) & 0x1F, a, \ - u + 0x06, (u + 0x08) & 0x1F, \ - (u + 0x0A) & 0x1F, (u + 0x0C) & 0x1F, \ - (u + 0x0F) & 0x1F, (u + 0x11) & 0x1F, \ - (u + 0x13) & 0x1F, (u + 0x1D) & 0x1F); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u32 t[32]; \ - size_t u; \ - a[0x00] ^= QC32up(0x00, r); \ - a[0x01] ^= QC32dn(0x00, r); \ - a[0x02] ^= QC32up(0x10, r); \ - a[0x03] ^= QC32dn(0x10, r); \ - a[0x04] ^= QC32up(0x20, r); \ - a[0x05] ^= QC32dn(0x20, r); \ - a[0x06] ^= QC32up(0x30, r); \ - a[0x07] ^= QC32dn(0x30, r); \ - a[0x08] ^= QC32up(0x40, r); \ - a[0x09] ^= QC32dn(0x40, r); \ - a[0x0A] ^= QC32up(0x50, r); \ - a[0x0B] ^= QC32dn(0x50, r); \ - a[0x0C] ^= QC32up(0x60, r); \ - a[0x0D] ^= QC32dn(0x60, r); \ - a[0x0E] ^= QC32up(0x70, r); \ - a[0x0F] ^= QC32dn(0x70, r); \ - a[0x10] ^= QC32up(0x80, r); \ - a[0x11] ^= QC32dn(0x80, r); \ - a[0x12] ^= QC32up(0x90, r); \ - a[0x13] ^= QC32dn(0x90, r); \ - a[0x14] ^= QC32up(0xA0, r); \ - a[0x15] ^= QC32dn(0xA0, r); \ - a[0x16] ^= QC32up(0xB0, r); \ - a[0x17] ^= QC32dn(0xB0, r); \ - a[0x18] ^= QC32up(0xC0, r); \ - a[0x19] ^= QC32dn(0xC0, r); \ - a[0x1A] ^= QC32up(0xD0, r); \ - a[0x1B] ^= QC32dn(0xD0, r); \ - a[0x1C] ^= QC32up(0xE0, r); \ - a[0x1D] ^= QC32dn(0xE0, r); \ - a[0x1E] ^= QC32up(0xF0, r); \ - a[0x1F] ^= QC32dn(0xF0, r); \ - for (u = 0; u < 32; u += 8) { \ - RBTT(u + 0x00, (u + 0x01) & 0x1F, a, \ - (u + 0x02) & 0x1F, (u + 0x06) & 0x1F, \ - (u + 0x0A) & 0x1F, (u + 0x16) & 0x1F, \ - (u + 0x01) & 0x1F, (u + 0x05) & 0x1F, \ - (u + 0x09) & 0x1F, (u + 0x0D) & 0x1F); \ - RBTT(u + 0x02, (u + 0x03) & 0x1F, a, \ - (u + 0x04) & 0x1F, (u + 0x08) & 0x1F, \ - (u + 0x0C) & 0x1F, (u + 0x18) & 0x1F, \ - (u + 0x03) & 0x1F, (u + 0x07) & 0x1F, \ - (u + 0x0B) & 0x1F, (u + 0x0F) & 0x1F); \ - RBTT(u + 0x04, (u + 0x05) & 0x1F, a, \ - (u + 0x06) & 0x1F, (u + 0x0A) & 0x1F, \ - (u + 0x0E) & 0x1F, (u + 0x1A) & 0x1F, \ - (u + 0x05) & 0x1F, (u + 0x09) & 0x1F, \ - (u + 0x0D) & 0x1F, (u + 0x11) & 0x1F); \ - RBTT(u + 0x06, (u + 0x07) & 0x1F, a, \ - (u + 0x08) & 0x1F, (u + 0x0C) & 0x1F, \ - (u + 0x10) & 0x1F, (u + 0x1C) & 0x1F, \ - (u + 0x07) & 0x1F, (u + 0x0B) & 0x1F, \ - (u + 0x0F) & 0x1F, (u + 0x13) & 0x1F); \ - } \ - memcpy(a, t, sizeof t); \ - } while (0) - -#else - -#define ROUND_BIG_P(a, r) do { \ - sph_u32 t[32]; \ - a[0x00] ^= PC32up(0x00, r); \ - a[0x01] ^= PC32dn(0x00, r); \ - a[0x02] ^= PC32up(0x10, r); \ - a[0x03] ^= PC32dn(0x10, r); \ - a[0x04] ^= PC32up(0x20, r); \ - a[0x05] ^= PC32dn(0x20, r); \ - a[0x06] ^= PC32up(0x30, r); \ - a[0x07] ^= PC32dn(0x30, r); \ - a[0x08] ^= PC32up(0x40, r); \ - a[0x09] ^= PC32dn(0x40, r); \ - a[0x0A] ^= PC32up(0x50, r); \ - a[0x0B] ^= PC32dn(0x50, r); \ - a[0x0C] ^= PC32up(0x60, r); \ - a[0x0D] ^= PC32dn(0x60, r); \ - a[0x0E] ^= PC32up(0x70, r); \ - a[0x0F] ^= PC32dn(0x70, r); \ - a[0x10] ^= PC32up(0x80, r); \ - a[0x11] ^= PC32dn(0x80, r); \ - a[0x12] ^= PC32up(0x90, r); \ - a[0x13] ^= PC32dn(0x90, r); \ - a[0x14] ^= PC32up(0xA0, r); \ - a[0x15] ^= PC32dn(0xA0, r); \ - a[0x16] ^= PC32up(0xB0, r); \ - a[0x17] ^= PC32dn(0xB0, r); \ - a[0x18] ^= PC32up(0xC0, r); \ - a[0x19] ^= PC32dn(0xC0, r); \ - a[0x1A] ^= PC32up(0xD0, r); \ - a[0x1B] ^= PC32dn(0xD0, r); \ - a[0x1C] ^= PC32up(0xE0, r); \ - a[0x1D] ^= PC32dn(0xE0, r); \ - a[0x1E] ^= PC32up(0xF0, r); \ - a[0x1F] ^= PC32dn(0xF0, r); \ - RBTT(0x00, 0x01, a, \ - 0x00, 0x02, 0x04, 0x06, 0x09, 0x0B, 0x0D, 0x17); \ - RBTT(0x02, 0x03, a, \ - 0x02, 0x04, 0x06, 0x08, 0x0B, 0x0D, 0x0F, 0x19); \ - RBTT(0x04, 0x05, a, \ - 0x04, 0x06, 0x08, 0x0A, 0x0D, 0x0F, 0x11, 0x1B); \ - RBTT(0x06, 0x07, a, \ - 0x06, 0x08, 0x0A, 0x0C, 0x0F, 0x11, 0x13, 0x1D); \ - RBTT(0x08, 0x09, a, \ - 0x08, 0x0A, 0x0C, 0x0E, 0x11, 0x13, 0x15, 0x1F); \ - RBTT(0x0A, 0x0B, a, \ - 0x0A, 0x0C, 0x0E, 0x10, 0x13, 0x15, 0x17, 0x01); \ - RBTT(0x0C, 0x0D, a, \ - 0x0C, 0x0E, 0x10, 0x12, 0x15, 0x17, 0x19, 0x03); \ - RBTT(0x0E, 0x0F, a, \ - 0x0E, 0x10, 0x12, 0x14, 0x17, 0x19, 0x1B, 0x05); \ - RBTT(0x10, 0x11, a, \ - 0x10, 0x12, 0x14, 0x16, 0x19, 0x1B, 0x1D, 0x07); \ - RBTT(0x12, 0x13, a, \ - 0x12, 0x14, 0x16, 0x18, 0x1B, 0x1D, 0x1F, 0x09); \ - RBTT(0x14, 0x15, a, \ - 0x14, 0x16, 0x18, 0x1A, 0x1D, 0x1F, 0x01, 0x0B); \ - RBTT(0x16, 0x17, a, \ - 0x16, 0x18, 0x1A, 0x1C, 0x1F, 0x01, 0x03, 0x0D); \ - RBTT(0x18, 0x19, a, \ - 0x18, 0x1A, 0x1C, 0x1E, 0x01, 0x03, 0x05, 0x0F); \ - RBTT(0x1A, 0x1B, a, \ - 0x1A, 0x1C, 0x1E, 0x00, 0x03, 0x05, 0x07, 0x11); \ - RBTT(0x1C, 0x1D, a, \ - 0x1C, 0x1E, 0x00, 0x02, 0x05, 0x07, 0x09, 0x13); \ - RBTT(0x1E, 0x1F, a, \ - 0x1E, 0x00, 0x02, 0x04, 0x07, 0x09, 0x0B, 0x15); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#define ROUND_BIG_Q(a, r) do { \ - sph_u32 t[32]; \ - a[0x00] ^= QC32up(0x00, r); \ - a[0x01] ^= QC32dn(0x00, r); \ - a[0x02] ^= QC32up(0x10, r); \ - a[0x03] ^= QC32dn(0x10, r); \ - a[0x04] ^= QC32up(0x20, r); \ - a[0x05] ^= QC32dn(0x20, r); \ - a[0x06] ^= QC32up(0x30, r); \ - a[0x07] ^= QC32dn(0x30, r); \ - a[0x08] ^= QC32up(0x40, r); \ - a[0x09] ^= QC32dn(0x40, r); \ - a[0x0A] ^= QC32up(0x50, r); \ - a[0x0B] ^= QC32dn(0x50, r); \ - a[0x0C] ^= QC32up(0x60, r); \ - a[0x0D] ^= QC32dn(0x60, r); \ - a[0x0E] ^= QC32up(0x70, r); \ - a[0x0F] ^= QC32dn(0x70, r); \ - a[0x10] ^= QC32up(0x80, r); \ - a[0x11] ^= QC32dn(0x80, r); \ - a[0x12] ^= QC32up(0x90, r); \ - a[0x13] ^= QC32dn(0x90, r); \ - a[0x14] ^= QC32up(0xA0, r); \ - a[0x15] ^= QC32dn(0xA0, r); \ - a[0x16] ^= QC32up(0xB0, r); \ - a[0x17] ^= QC32dn(0xB0, r); \ - a[0x18] ^= QC32up(0xC0, r); \ - a[0x19] ^= QC32dn(0xC0, r); \ - a[0x1A] ^= QC32up(0xD0, r); \ - a[0x1B] ^= QC32dn(0xD0, r); \ - a[0x1C] ^= QC32up(0xE0, r); \ - a[0x1D] ^= QC32dn(0xE0, r); \ - a[0x1E] ^= QC32up(0xF0, r); \ - a[0x1F] ^= QC32dn(0xF0, r); \ - RBTT(0x00, 0x01, a, \ - 0x02, 0x06, 0x0A, 0x16, 0x01, 0x05, 0x09, 0x0D); \ - RBTT(0x02, 0x03, a, \ - 0x04, 0x08, 0x0C, 0x18, 0x03, 0x07, 0x0B, 0x0F); \ - RBTT(0x04, 0x05, a, \ - 0x06, 0x0A, 0x0E, 0x1A, 0x05, 0x09, 0x0D, 0x11); \ - RBTT(0x06, 0x07, a, \ - 0x08, 0x0C, 0x10, 0x1C, 0x07, 0x0B, 0x0F, 0x13); \ - RBTT(0x08, 0x09, a, \ - 0x0A, 0x0E, 0x12, 0x1E, 0x09, 0x0D, 0x11, 0x15); \ - RBTT(0x0A, 0x0B, a, \ - 0x0C, 0x10, 0x14, 0x00, 0x0B, 0x0F, 0x13, 0x17); \ - RBTT(0x0C, 0x0D, a, \ - 0x0E, 0x12, 0x16, 0x02, 0x0D, 0x11, 0x15, 0x19); \ - RBTT(0x0E, 0x0F, a, \ - 0x10, 0x14, 0x18, 0x04, 0x0F, 0x13, 0x17, 0x1B); \ - RBTT(0x10, 0x11, a, \ - 0x12, 0x16, 0x1A, 0x06, 0x11, 0x15, 0x19, 0x1D); \ - RBTT(0x12, 0x13, a, \ - 0x14, 0x18, 0x1C, 0x08, 0x13, 0x17, 0x1B, 0x1F); \ - RBTT(0x14, 0x15, a, \ - 0x16, 0x1A, 0x1E, 0x0A, 0x15, 0x19, 0x1D, 0x01); \ - RBTT(0x16, 0x17, a, \ - 0x18, 0x1C, 0x00, 0x0C, 0x17, 0x1B, 0x1F, 0x03); \ - RBTT(0x18, 0x19, a, \ - 0x1A, 0x1E, 0x02, 0x0E, 0x19, 0x1D, 0x01, 0x05); \ - RBTT(0x1A, 0x1B, a, \ - 0x1C, 0x00, 0x04, 0x10, 0x1B, 0x1F, 0x03, 0x07); \ - RBTT(0x1C, 0x1D, a, \ - 0x1E, 0x02, 0x06, 0x12, 0x1D, 0x01, 0x05, 0x09); \ - RBTT(0x1E, 0x1F, a, \ - 0x00, 0x04, 0x08, 0x14, 0x1F, 0x03, 0x07, 0x0B); \ - memcpy(a, t, sizeof t); \ - } while (0) - -#endif - -#if SPH_SMALL_FOOTPRINT_GROESTL - -#define PERM_BIG_P(a) do { \ - int r; \ - for (r = 0; r < 14; r ++) \ - ROUND_BIG_P(a, r); \ - } while (0) - -#define PERM_BIG_Q(a) do { \ - int r; \ - for (r = 0; r < 14; r ++) \ - ROUND_BIG_Q(a, r); \ - } while (0) - -#else - -#define PERM_BIG_P(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_P(a, r + 0); \ - ROUND_BIG_P(a, r + 1); \ - } \ - } while (0) - -#define PERM_BIG_Q(a) do { \ - int r; \ - for (r = 0; r < 14; r += 2) { \ - ROUND_BIG_Q(a, r + 0); \ - ROUND_BIG_Q(a, r + 1); \ - } \ - } while (0) - -#endif - -#define COMPRESS_BIG do { \ - sph_u32 g[32], m[32]; \ - size_t u; \ - for (u = 0; u < 32; u ++) { \ - m[u] = dec32e_aligned(buf + (u << 2)); \ - g[u] = m[u] ^ H[u]; \ - } \ - PERM_BIG_P(g); \ - PERM_BIG_Q(m); \ - for (u = 0; u < 32; u ++) \ - H[u] ^= g[u] ^ m[u]; \ - } while (0) - -#define FINAL_BIG do { \ - sph_u32 x[32]; \ - size_t u; \ - memcpy(x, H, sizeof x); \ - PERM_BIG_P(x); \ - for (u = 0; u < 32; u ++) \ - H[u] ^= x[u]; \ - } while (0) - -#endif - -static void -groestl_small_init(sph_groestl_small_context *sc, unsigned out_size) -{ - size_t u; - - sc->ptr = 0; -#if SPH_GROESTL_64 - for (u = 0; u < 7; u ++) - sc->state.wide[u] = 0; -#if USE_LE - sc->state.wide[7] = ((sph_u64)(out_size & 0xFF) << 56) - | ((sph_u64)(out_size & 0xFF00) << 40); -#else - sc->state.wide[7] = (sph_u64)out_size; -#endif -#else - for (u = 0; u < 15; u ++) - sc->state.narrow[u] = 0; -#if USE_LE - sc->state.narrow[15] = ((sph_u32)(out_size & 0xFF) << 24) - | ((sph_u32)(out_size & 0xFF00) << 8); -#else - sc->state.narrow[15] = (sph_u32)out_size; -#endif -#endif -#if SPH_64 - sc->count = 0; -#else - sc->count_high = 0; - sc->count_low = 0; -#endif -} - -static void -groestl_small_core(sph_groestl_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE_SMALL - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE_SMALL(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - COMPRESS_SMALL; -#if SPH_64 - sc->count ++; -#else - if ((sc->count_low = SPH_T32(sc->count_low + 1)) == 0) - sc->count_high = SPH_T32(sc->count_high + 1); -#endif - ptr = 0; - } - } - WRITE_STATE_SMALL(sc); - sc->ptr = ptr; -} - -static void -groestl_small_close(sph_groestl_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_len) -{ - unsigned char *buf; - unsigned char pad[72]; - size_t u, ptr, pad_len; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif - unsigned z; - DECL_STATE_SMALL - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - pad[0] = ((ub & -z) | z) & 0xFF; - if (ptr < 56) { - pad_len = 64 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 1); -#else - count_low = SPH_T32(sc->count_low + 1); - count_high = SPH_T32(sc->count_high); - if (count_low == 0) - count_high = SPH_T32(count_high + 1); -#endif - } else { - pad_len = 128 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 2); -#else - count_low = SPH_T32(sc->count_low + 2); - count_high = SPH_T32(sc->count_high); - if (count_low <= 1) - count_high = SPH_T32(count_high + 1); -#endif - } - memset(pad + 1, 0, pad_len - 9); -#if SPH_64 - sph_enc64be(pad + pad_len - 8, count); -#else - sph_enc64be(pad + pad_len - 8, count_high); - sph_enc64be(pad + pad_len - 4, count_low); -#endif - groestl_small_core(sc, pad, pad_len); - READ_STATE_SMALL(sc); - FINAL_SMALL; -#if SPH_GROESTL_64 - for (u = 0; u < 4; u ++) - enc64e(pad + (u << 3), H[u + 4]); -#else - for (u = 0; u < 8; u ++) - enc32e(pad + (u << 2), H[u + 8]); -#endif - memcpy(dst, pad + 32 - out_len, out_len); - groestl_small_init(sc, (unsigned)out_len << 3); -} - -static void -groestl_big_init(sph_groestl_big_context *sc, unsigned out_size) -{ - size_t u; - - sc->ptr = 0; -#if SPH_GROESTL_64 - for (u = 0; u < 15; u ++) - sc->state.wide[u] = 0; -#if USE_LE - sc->state.wide[15] = ((sph_u64)(out_size & 0xFF) << 56) - | ((sph_u64)(out_size & 0xFF00) << 40); -#else - sc->state.wide[15] = (sph_u64)out_size; -#endif -#else - for (u = 0; u < 31; u ++) - sc->state.narrow[u] = 0; -#if USE_LE - sc->state.narrow[31] = ((sph_u32)(out_size & 0xFF) << 24) - | ((sph_u32)(out_size & 0xFF00) << 8); -#else - sc->state.narrow[31] = (sph_u32)out_size; -#endif -#endif -#if SPH_64 - sc->count = 0; -#else - sc->count_high = 0; - sc->count_low = 0; -#endif -} - -static void -groestl_big_core(sph_groestl_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE_BIG - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE_BIG(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - COMPRESS_BIG; -#if SPH_64 - sc->count ++; -#else - if ((sc->count_low = SPH_T32(sc->count_low + 1)) == 0) - sc->count_high = SPH_T32(sc->count_high + 1); -#endif - ptr = 0; - } - } - WRITE_STATE_BIG(sc); - sc->ptr = ptr; -} - -static void -groestl_big_close(sph_groestl_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_len) -{ - unsigned char *buf; - unsigned char pad[136]; - size_t ptr, pad_len, u; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif - unsigned z; - DECL_STATE_BIG - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - pad[0] = ((ub & -z) | z) & 0xFF; - if (ptr < 120) { - pad_len = 128 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 1); -#else - count_low = SPH_T32(sc->count_low + 1); - count_high = SPH_T32(sc->count_high); - if (count_low == 0) - count_high = SPH_T32(count_high + 1); -#endif - } else { - pad_len = 256 - ptr; -#if SPH_64 - count = SPH_T64(sc->count + 2); -#else - count_low = SPH_T32(sc->count_low + 2); - count_high = SPH_T32(sc->count_high); - if (count_low <= 1) - count_high = SPH_T32(count_high + 1); -#endif - } - memset(pad + 1, 0, pad_len - 9); -#if SPH_64 - sph_enc64be(pad + pad_len - 8, count); -#else - sph_enc64be(pad + pad_len - 8, count_high); - sph_enc64be(pad + pad_len - 4, count_low); -#endif - groestl_big_core(sc, pad, pad_len); - READ_STATE_BIG(sc); - FINAL_BIG; -#if SPH_GROESTL_64 - for (u = 0; u < 8; u ++) - enc64e(pad + (u << 3), H[u + 8]); -#else - for (u = 0; u < 16; u ++) - enc32e(pad + (u << 2), H[u + 16]); -#endif - memcpy(dst, pad + 64 - out_len, out_len); - groestl_big_init(sc, (unsigned)out_len << 3); -} - -/* see sph_groestl.h */ -void -sph_groestl224_init(void *cc) -{ - groestl_small_init(cc, 224); -} - -/* see sph_groestl.h */ -void -sph_groestl224(void *cc, const void *data, size_t len) -{ - groestl_small_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl224_close(void *cc, void *dst) -{ - groestl_small_close(cc, 0, 0, dst, 28); -} - -/* see sph_groestl.h */ -void -sph_groestl224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_small_close(cc, ub, n, dst, 28); -} - -/* see sph_groestl.h */ -void -sph_groestl256_init(void *cc) -{ - groestl_small_init(cc, 256); -} - -/* see sph_groestl.h */ -void -sph_groestl256(void *cc, const void *data, size_t len) -{ - groestl_small_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl256_close(void *cc, void *dst) -{ - groestl_small_close(cc, 0, 0, dst, 32); -} - -/* see sph_groestl.h */ -void -sph_groestl256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_small_close(cc, ub, n, dst, 32); -} - -/* see sph_groestl.h */ -void -sph_groestl384_init(void *cc) -{ - groestl_big_init(cc, 384); -} - -/* see sph_groestl.h */ -void -sph_groestl384(void *cc, const void *data, size_t len) -{ - groestl_big_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl384_close(void *cc, void *dst) -{ - groestl_big_close(cc, 0, 0, dst, 48); -} - -/* see sph_groestl.h */ -void -sph_groestl384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_big_close(cc, ub, n, dst, 48); -} - -/* see sph_groestl.h */ -void -sph_groestl512_init(void *cc) -{ - groestl_big_init(cc, 512); -} - -/* see sph_groestl.h */ -void -sph_groestl512(void *cc, const void *data, size_t len) -{ - groestl_big_core(cc, data, len); -} - -/* see sph_groestl.h */ -void -sph_groestl512_close(void *cc, void *dst) -{ - groestl_big_close(cc, 0, 0, dst, 64); -} - -/* see sph_groestl.h */ -void -sph_groestl512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - groestl_big_close(cc, ub, n, dst, 64); -} - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/hmac_sha256.cpp b/src/crypto/hmac_sha256.cpp deleted file mode 100644 index b3f36bdda..000000000 --- a/src/crypto/hmac_sha256.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "hmac_sha256.h" - -#include - -CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen) -{ - unsigned char rkey[64]; - if (keylen <= 64) { - memcpy(rkey, key, keylen); - memset(rkey + keylen, 0, 64 - keylen); - } else { - CSHA256().Write(key, keylen).Finalize(rkey); - memset(rkey + 32, 0, 32); - } - - for (int n = 0; n < 64; n++) - rkey[n] ^= 0x5c; - outer.Write(rkey, 64); - - for (int n = 0; n < 64; n++) - rkey[n] ^= 0x5c ^ 0x36; - inner.Write(rkey, 64); -} - -void CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) -{ - unsigned char temp[32]; - inner.Finalize(temp); - outer.Write(temp, 32).Finalize(hash); -} diff --git a/src/crypto/hmac_sha256.h b/src/crypto/hmac_sha256.h deleted file mode 100644 index 0a3f5c43c..000000000 --- a/src/crypto/hmac_sha256.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_HMAC_SHA256_H -#define BITCOIN_CRYPTO_HMAC_SHA256_H - -#include "sha256.h" - -#include -#include - -/** A hasher class for HMAC-SHA-512. */ -class CHMAC_SHA256 -{ -private: - CSHA256 outer; - CSHA256 inner; - -public: - static const size_t OUTPUT_SIZE = 32; - - CHMAC_SHA256(const unsigned char* key, size_t keylen); - CHMAC_SHA256& Write(const unsigned char* data, size_t len) - { - inner.Write(data, len); - return *this; - } - void Finalize(unsigned char hash[OUTPUT_SIZE]); -}; - -#endif // BITCOIN_CRYPTO_HMAC_SHA256_H diff --git a/src/crypto/jh.c b/src/crypto/jh.c deleted file mode 100644 index 41487a530..000000000 --- a/src/crypto/jh.c +++ /dev/null @@ -1,1116 +0,0 @@ -/* $Id: jh.c 255 2011-06-07 19:50:20Z tp $ */ -/* - * JH implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_jh.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_JH -#define SPH_SMALL_FOOTPRINT_JH 1 -#endif - -#if !defined SPH_JH_64 && SPH_64_TRUE -#define SPH_JH_64 1 -#endif - -#if !SPH_64 -#undef SPH_JH_64 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -/* - * The internal bitslice representation may use either big-endian or - * little-endian (true bitslice operations do not care about the bit - * ordering, and the bit-swapping linear operations in JH happen to - * be invariant through endianness-swapping). The constants must be - * defined according to the chosen endianness; we use some - * byte-swapping macros for that. - */ - -#if SPH_LITTLE_ENDIAN - -#define C32e(x) ((SPH_C32(x) >> 24) \ - | ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \ - | ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \ - | ((SPH_C32(x) << 24) & SPH_C32(0xFF000000))) -#define dec32e_aligned sph_dec32le_aligned -#define enc32e sph_enc32le - -#if SPH_64 -#define C64e(x) ((SPH_C64(x) >> 56) \ - | ((SPH_C64(x) >> 40) & SPH_C64(0x000000000000FF00)) \ - | ((SPH_C64(x) >> 24) & SPH_C64(0x0000000000FF0000)) \ - | ((SPH_C64(x) >> 8) & SPH_C64(0x00000000FF000000)) \ - | ((SPH_C64(x) << 8) & SPH_C64(0x000000FF00000000)) \ - | ((SPH_C64(x) << 24) & SPH_C64(0x0000FF0000000000)) \ - | ((SPH_C64(x) << 40) & SPH_C64(0x00FF000000000000)) \ - | ((SPH_C64(x) << 56) & SPH_C64(0xFF00000000000000))) -#define dec64e_aligned sph_dec64le_aligned -#define enc64e sph_enc64le -#endif - -#else - -#define C32e(x) SPH_C32(x) -#define dec32e_aligned sph_dec32be_aligned -#define enc32e sph_enc32be -#if SPH_64 -#define C64e(x) SPH_C64(x) -#define dec64e_aligned sph_dec64be_aligned -#define enc64e sph_enc64be -#endif - -#endif - -#define Sb(x0, x1, x2, x3, c) do { \ - x3 = ~x3; \ - x0 ^= (c) & ~x2; \ - tmp = (c) ^ (x0 & x1); \ - x0 ^= x2 & x3; \ - x3 ^= ~x1 & x2; \ - x1 ^= x0 & x2; \ - x2 ^= x0 & ~x3; \ - x0 ^= x1 | x3; \ - x3 ^= x1 & x2; \ - x1 ^= tmp & x0; \ - x2 ^= tmp; \ - } while (0) - -#define Lb(x0, x1, x2, x3, x4, x5, x6, x7) do { \ - x4 ^= x1; \ - x5 ^= x2; \ - x6 ^= x3 ^ x0; \ - x7 ^= x0; \ - x0 ^= x5; \ - x1 ^= x6; \ - x2 ^= x7 ^ x4; \ - x3 ^= x4; \ - } while (0) - -#if SPH_JH_64 - -static const sph_u64 C[] = { - C64e(0x72d5dea2df15f867), C64e(0x7b84150ab7231557), - C64e(0x81abd6904d5a87f6), C64e(0x4e9f4fc5c3d12b40), - C64e(0xea983ae05c45fa9c), C64e(0x03c5d29966b2999a), - C64e(0x660296b4f2bb538a), C64e(0xb556141a88dba231), - C64e(0x03a35a5c9a190edb), C64e(0x403fb20a87c14410), - C64e(0x1c051980849e951d), C64e(0x6f33ebad5ee7cddc), - C64e(0x10ba139202bf6b41), C64e(0xdc786515f7bb27d0), - C64e(0x0a2c813937aa7850), C64e(0x3f1abfd2410091d3), - C64e(0x422d5a0df6cc7e90), C64e(0xdd629f9c92c097ce), - C64e(0x185ca70bc72b44ac), C64e(0xd1df65d663c6fc23), - C64e(0x976e6c039ee0b81a), C64e(0x2105457e446ceca8), - C64e(0xeef103bb5d8e61fa), C64e(0xfd9697b294838197), - C64e(0x4a8e8537db03302f), C64e(0x2a678d2dfb9f6a95), - C64e(0x8afe7381f8b8696c), C64e(0x8ac77246c07f4214), - C64e(0xc5f4158fbdc75ec4), C64e(0x75446fa78f11bb80), - C64e(0x52de75b7aee488bc), C64e(0x82b8001e98a6a3f4), - C64e(0x8ef48f33a9a36315), C64e(0xaa5f5624d5b7f989), - C64e(0xb6f1ed207c5ae0fd), C64e(0x36cae95a06422c36), - C64e(0xce2935434efe983d), C64e(0x533af974739a4ba7), - C64e(0xd0f51f596f4e8186), C64e(0x0e9dad81afd85a9f), - C64e(0xa7050667ee34626a), C64e(0x8b0b28be6eb91727), - C64e(0x47740726c680103f), C64e(0xe0a07e6fc67e487b), - C64e(0x0d550aa54af8a4c0), C64e(0x91e3e79f978ef19e), - C64e(0x8676728150608dd4), C64e(0x7e9e5a41f3e5b062), - C64e(0xfc9f1fec4054207a), C64e(0xe3e41a00cef4c984), - C64e(0x4fd794f59dfa95d8), C64e(0x552e7e1124c354a5), - C64e(0x5bdf7228bdfe6e28), C64e(0x78f57fe20fa5c4b2), - C64e(0x05897cefee49d32e), C64e(0x447e9385eb28597f), - C64e(0x705f6937b324314a), C64e(0x5e8628f11dd6e465), - C64e(0xc71b770451b920e7), C64e(0x74fe43e823d4878a), - C64e(0x7d29e8a3927694f2), C64e(0xddcb7a099b30d9c1), - C64e(0x1d1b30fb5bdc1be0), C64e(0xda24494ff29c82bf), - C64e(0xa4e7ba31b470bfff), C64e(0x0d324405def8bc48), - C64e(0x3baefc3253bbd339), C64e(0x459fc3c1e0298ba0), - C64e(0xe5c905fdf7ae090f), C64e(0x947034124290f134), - C64e(0xa271b701e344ed95), C64e(0xe93b8e364f2f984a), - C64e(0x88401d63a06cf615), C64e(0x47c1444b8752afff), - C64e(0x7ebb4af1e20ac630), C64e(0x4670b6c5cc6e8ce6), - C64e(0xa4d5a456bd4fca00), C64e(0xda9d844bc83e18ae), - C64e(0x7357ce453064d1ad), C64e(0xe8a6ce68145c2567), - C64e(0xa3da8cf2cb0ee116), C64e(0x33e906589a94999a), - C64e(0x1f60b220c26f847b), C64e(0xd1ceac7fa0d18518), - C64e(0x32595ba18ddd19d3), C64e(0x509a1cc0aaa5b446), - C64e(0x9f3d6367e4046bba), C64e(0xf6ca19ab0b56ee7e), - C64e(0x1fb179eaa9282174), C64e(0xe9bdf7353b3651ee), - C64e(0x1d57ac5a7550d376), C64e(0x3a46c2fea37d7001), - C64e(0xf735c1af98a4d842), C64e(0x78edec209e6b6779), - C64e(0x41836315ea3adba8), C64e(0xfac33b4d32832c83), - C64e(0xa7403b1f1c2747f3), C64e(0x5940f034b72d769a), - C64e(0xe73e4e6cd2214ffd), C64e(0xb8fd8d39dc5759ef), - C64e(0x8d9b0c492b49ebda), C64e(0x5ba2d74968f3700d), - C64e(0x7d3baed07a8d5584), C64e(0xf5a5e9f0e4f88e65), - C64e(0xa0b8a2f436103b53), C64e(0x0ca8079e753eec5a), - C64e(0x9168949256e8884f), C64e(0x5bb05c55f8babc4c), - C64e(0xe3bb3b99f387947b), C64e(0x75daf4d6726b1c5d), - C64e(0x64aeac28dc34b36d), C64e(0x6c34a550b828db71), - C64e(0xf861e2f2108d512a), C64e(0xe3db643359dd75fc), - C64e(0x1cacbcf143ce3fa2), C64e(0x67bbd13c02e843b0), - C64e(0x330a5bca8829a175), C64e(0x7f34194db416535c), - C64e(0x923b94c30e794d1e), C64e(0x797475d7b6eeaf3f), - C64e(0xeaa8d4f7be1a3921), C64e(0x5cf47e094c232751), - C64e(0x26a32453ba323cd2), C64e(0x44a3174a6da6d5ad), - C64e(0xb51d3ea6aff2c908), C64e(0x83593d98916b3c56), - C64e(0x4cf87ca17286604d), C64e(0x46e23ecc086ec7f6), - C64e(0x2f9833b3b1bc765e), C64e(0x2bd666a5efc4e62a), - C64e(0x06f4b6e8bec1d436), C64e(0x74ee8215bcef2163), - C64e(0xfdc14e0df453c969), C64e(0xa77d5ac406585826), - C64e(0x7ec1141606e0fa16), C64e(0x7e90af3d28639d3f), - C64e(0xd2c9f2e3009bd20c), C64e(0x5faace30b7d40c30), - C64e(0x742a5116f2e03298), C64e(0x0deb30d8e3cef89a), - C64e(0x4bc59e7bb5f17992), C64e(0xff51e66e048668d3), - C64e(0x9b234d57e6966731), C64e(0xcce6a6f3170a7505), - C64e(0xb17681d913326cce), C64e(0x3c175284f805a262), - C64e(0xf42bcbb378471547), C64e(0xff46548223936a48), - C64e(0x38df58074e5e6565), C64e(0xf2fc7c89fc86508e), - C64e(0x31702e44d00bca86), C64e(0xf04009a23078474e), - C64e(0x65a0ee39d1f73883), C64e(0xf75ee937e42c3abd), - C64e(0x2197b2260113f86f), C64e(0xa344edd1ef9fdee7), - C64e(0x8ba0df15762592d9), C64e(0x3c85f7f612dc42be), - C64e(0xd8a7ec7cab27b07e), C64e(0x538d7ddaaa3ea8de), - C64e(0xaa25ce93bd0269d8), C64e(0x5af643fd1a7308f9), - C64e(0xc05fefda174a19a5), C64e(0x974d66334cfd216a), - C64e(0x35b49831db411570), C64e(0xea1e0fbbedcd549b), - C64e(0x9ad063a151974072), C64e(0xf6759dbf91476fe2) -}; - -#define Ceven_hi(r) (C[((r) << 2) + 0]) -#define Ceven_lo(r) (C[((r) << 2) + 1]) -#define Codd_hi(r) (C[((r) << 2) + 2]) -#define Codd_lo(r) (C[((r) << 2) + 3]) - -#define S(x0, x1, x2, x3, cb, r) do { \ - Sb(x0 ## h, x1 ## h, x2 ## h, x3 ## h, cb ## hi(r)); \ - Sb(x0 ## l, x1 ## l, x2 ## l, x3 ## l, cb ## lo(r)); \ - } while (0) - -#define L(x0, x1, x2, x3, x4, x5, x6, x7) do { \ - Lb(x0 ## h, x1 ## h, x2 ## h, x3 ## h, \ - x4 ## h, x5 ## h, x6 ## h, x7 ## h); \ - Lb(x0 ## l, x1 ## l, x2 ## l, x3 ## l, \ - x4 ## l, x5 ## l, x6 ## l, x7 ## l); \ - } while (0) - -#define Wz(x, c, n) do { \ - sph_u64 t = (x ## h & (c)) << (n); \ - x ## h = ((x ## h >> (n)) & (c)) | t; \ - t = (x ## l & (c)) << (n); \ - x ## l = ((x ## l >> (n)) & (c)) | t; \ - } while (0) - -#define W0(x) Wz(x, SPH_C64(0x5555555555555555), 1) -#define W1(x) Wz(x, SPH_C64(0x3333333333333333), 2) -#define W2(x) Wz(x, SPH_C64(0x0F0F0F0F0F0F0F0F), 4) -#define W3(x) Wz(x, SPH_C64(0x00FF00FF00FF00FF), 8) -#define W4(x) Wz(x, SPH_C64(0x0000FFFF0000FFFF), 16) -#define W5(x) Wz(x, SPH_C64(0x00000000FFFFFFFF), 32) -#define W6(x) do { \ - sph_u64 t = x ## h; \ - x ## h = x ## l; \ - x ## l = t; \ - } while (0) - -#define DECL_STATE \ - sph_u64 h0h, h1h, h2h, h3h, h4h, h5h, h6h, h7h; \ - sph_u64 h0l, h1l, h2l, h3l, h4l, h5l, h6l, h7l; \ - sph_u64 tmp; - -#define READ_STATE(state) do { \ - h0h = (state)->H.wide[ 0]; \ - h0l = (state)->H.wide[ 1]; \ - h1h = (state)->H.wide[ 2]; \ - h1l = (state)->H.wide[ 3]; \ - h2h = (state)->H.wide[ 4]; \ - h2l = (state)->H.wide[ 5]; \ - h3h = (state)->H.wide[ 6]; \ - h3l = (state)->H.wide[ 7]; \ - h4h = (state)->H.wide[ 8]; \ - h4l = (state)->H.wide[ 9]; \ - h5h = (state)->H.wide[10]; \ - h5l = (state)->H.wide[11]; \ - h6h = (state)->H.wide[12]; \ - h6l = (state)->H.wide[13]; \ - h7h = (state)->H.wide[14]; \ - h7l = (state)->H.wide[15]; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->H.wide[ 0] = h0h; \ - (state)->H.wide[ 1] = h0l; \ - (state)->H.wide[ 2] = h1h; \ - (state)->H.wide[ 3] = h1l; \ - (state)->H.wide[ 4] = h2h; \ - (state)->H.wide[ 5] = h2l; \ - (state)->H.wide[ 6] = h3h; \ - (state)->H.wide[ 7] = h3l; \ - (state)->H.wide[ 8] = h4h; \ - (state)->H.wide[ 9] = h4l; \ - (state)->H.wide[10] = h5h; \ - (state)->H.wide[11] = h5l; \ - (state)->H.wide[12] = h6h; \ - (state)->H.wide[13] = h6l; \ - (state)->H.wide[14] = h7h; \ - (state)->H.wide[15] = h7l; \ - } while (0) - -#define INPUT_BUF1 \ - sph_u64 m0h = dec64e_aligned(buf + 0); \ - sph_u64 m0l = dec64e_aligned(buf + 8); \ - sph_u64 m1h = dec64e_aligned(buf + 16); \ - sph_u64 m1l = dec64e_aligned(buf + 24); \ - sph_u64 m2h = dec64e_aligned(buf + 32); \ - sph_u64 m2l = dec64e_aligned(buf + 40); \ - sph_u64 m3h = dec64e_aligned(buf + 48); \ - sph_u64 m3l = dec64e_aligned(buf + 56); \ - h0h ^= m0h; \ - h0l ^= m0l; \ - h1h ^= m1h; \ - h1l ^= m1l; \ - h2h ^= m2h; \ - h2l ^= m2l; \ - h3h ^= m3h; \ - h3l ^= m3l; - -#define INPUT_BUF2 \ - h4h ^= m0h; \ - h4l ^= m0l; \ - h5h ^= m1h; \ - h5l ^= m1l; \ - h6h ^= m2h; \ - h6l ^= m2l; \ - h7h ^= m3h; \ - h7l ^= m3l; - -static const sph_u64 IV224[] = { - C64e(0x2dfedd62f99a98ac), C64e(0xae7cacd619d634e7), - C64e(0xa4831005bc301216), C64e(0xb86038c6c9661494), - C64e(0x66d9899f2580706f), C64e(0xce9ea31b1d9b1adc), - C64e(0x11e8325f7b366e10), C64e(0xf994857f02fa06c1), - C64e(0x1b4f1b5cd8c840b3), C64e(0x97f6a17f6e738099), - C64e(0xdcdf93a5adeaa3d3), C64e(0xa431e8dec9539a68), - C64e(0x22b4a98aec86a1e4), C64e(0xd574ac959ce56cf0), - C64e(0x15960deab5ab2bbf), C64e(0x9611dcf0dd64ea6e) -}; - -static const sph_u64 IV256[] = { - C64e(0xeb98a3412c20d3eb), C64e(0x92cdbe7b9cb245c1), - C64e(0x1c93519160d4c7fa), C64e(0x260082d67e508a03), - C64e(0xa4239e267726b945), C64e(0xe0fb1a48d41a9477), - C64e(0xcdb5ab26026b177a), C64e(0x56f024420fff2fa8), - C64e(0x71a396897f2e4d75), C64e(0x1d144908f77de262), - C64e(0x277695f776248f94), C64e(0x87d5b6574780296c), - C64e(0x5c5e272dac8e0d6c), C64e(0x518450c657057a0f), - C64e(0x7be4d367702412ea), C64e(0x89e3ab13d31cd769) -}; - -static const sph_u64 IV384[] = { - C64e(0x481e3bc6d813398a), C64e(0x6d3b5e894ade879b), - C64e(0x63faea68d480ad2e), C64e(0x332ccb21480f8267), - C64e(0x98aec84d9082b928), C64e(0xd455ea3041114249), - C64e(0x36f555b2924847ec), C64e(0xc7250a93baf43ce1), - C64e(0x569b7f8a27db454c), C64e(0x9efcbd496397af0e), - C64e(0x589fc27d26aa80cd), C64e(0x80c08b8c9deb2eda), - C64e(0x8a7981e8f8d5373a), C64e(0xf43967adddd17a71), - C64e(0xa9b4d3bda475d394), C64e(0x976c3fba9842737f) -}; - -static const sph_u64 IV512[] = { - C64e(0x6fd14b963e00aa17), C64e(0x636a2e057a15d543), - C64e(0x8a225e8d0c97ef0b), C64e(0xe9341259f2b3c361), - C64e(0x891da0c1536f801e), C64e(0x2aa9056bea2b6d80), - C64e(0x588eccdb2075baa6), C64e(0xa90f3a76baf83bf7), - C64e(0x0169e60541e34a69), C64e(0x46b58a8e2e6fe65a), - C64e(0x1047a7d0c1843c24), C64e(0x3b6e71b12d5ac199), - C64e(0xcf57f6ec9db1f856), C64e(0xa706887c5716b156), - C64e(0xe3c2fcdfe68517fb), C64e(0x545a4678cc8cdd4b) -}; - -#else - -static const sph_u32 C[] = { - C32e(0x72d5dea2), C32e(0xdf15f867), C32e(0x7b84150a), - C32e(0xb7231557), C32e(0x81abd690), C32e(0x4d5a87f6), - C32e(0x4e9f4fc5), C32e(0xc3d12b40), C32e(0xea983ae0), - C32e(0x5c45fa9c), C32e(0x03c5d299), C32e(0x66b2999a), - C32e(0x660296b4), C32e(0xf2bb538a), C32e(0xb556141a), - C32e(0x88dba231), C32e(0x03a35a5c), C32e(0x9a190edb), - C32e(0x403fb20a), C32e(0x87c14410), C32e(0x1c051980), - C32e(0x849e951d), C32e(0x6f33ebad), C32e(0x5ee7cddc), - C32e(0x10ba1392), C32e(0x02bf6b41), C32e(0xdc786515), - C32e(0xf7bb27d0), C32e(0x0a2c8139), C32e(0x37aa7850), - C32e(0x3f1abfd2), C32e(0x410091d3), C32e(0x422d5a0d), - C32e(0xf6cc7e90), C32e(0xdd629f9c), C32e(0x92c097ce), - C32e(0x185ca70b), C32e(0xc72b44ac), C32e(0xd1df65d6), - C32e(0x63c6fc23), C32e(0x976e6c03), C32e(0x9ee0b81a), - C32e(0x2105457e), C32e(0x446ceca8), C32e(0xeef103bb), - C32e(0x5d8e61fa), C32e(0xfd9697b2), C32e(0x94838197), - C32e(0x4a8e8537), C32e(0xdb03302f), C32e(0x2a678d2d), - C32e(0xfb9f6a95), C32e(0x8afe7381), C32e(0xf8b8696c), - C32e(0x8ac77246), C32e(0xc07f4214), C32e(0xc5f4158f), - C32e(0xbdc75ec4), C32e(0x75446fa7), C32e(0x8f11bb80), - C32e(0x52de75b7), C32e(0xaee488bc), C32e(0x82b8001e), - C32e(0x98a6a3f4), C32e(0x8ef48f33), C32e(0xa9a36315), - C32e(0xaa5f5624), C32e(0xd5b7f989), C32e(0xb6f1ed20), - C32e(0x7c5ae0fd), C32e(0x36cae95a), C32e(0x06422c36), - C32e(0xce293543), C32e(0x4efe983d), C32e(0x533af974), - C32e(0x739a4ba7), C32e(0xd0f51f59), C32e(0x6f4e8186), - C32e(0x0e9dad81), C32e(0xafd85a9f), C32e(0xa7050667), - C32e(0xee34626a), C32e(0x8b0b28be), C32e(0x6eb91727), - C32e(0x47740726), C32e(0xc680103f), C32e(0xe0a07e6f), - C32e(0xc67e487b), C32e(0x0d550aa5), C32e(0x4af8a4c0), - C32e(0x91e3e79f), C32e(0x978ef19e), C32e(0x86767281), - C32e(0x50608dd4), C32e(0x7e9e5a41), C32e(0xf3e5b062), - C32e(0xfc9f1fec), C32e(0x4054207a), C32e(0xe3e41a00), - C32e(0xcef4c984), C32e(0x4fd794f5), C32e(0x9dfa95d8), - C32e(0x552e7e11), C32e(0x24c354a5), C32e(0x5bdf7228), - C32e(0xbdfe6e28), C32e(0x78f57fe2), C32e(0x0fa5c4b2), - C32e(0x05897cef), C32e(0xee49d32e), C32e(0x447e9385), - C32e(0xeb28597f), C32e(0x705f6937), C32e(0xb324314a), - C32e(0x5e8628f1), C32e(0x1dd6e465), C32e(0xc71b7704), - C32e(0x51b920e7), C32e(0x74fe43e8), C32e(0x23d4878a), - C32e(0x7d29e8a3), C32e(0x927694f2), C32e(0xddcb7a09), - C32e(0x9b30d9c1), C32e(0x1d1b30fb), C32e(0x5bdc1be0), - C32e(0xda24494f), C32e(0xf29c82bf), C32e(0xa4e7ba31), - C32e(0xb470bfff), C32e(0x0d324405), C32e(0xdef8bc48), - C32e(0x3baefc32), C32e(0x53bbd339), C32e(0x459fc3c1), - C32e(0xe0298ba0), C32e(0xe5c905fd), C32e(0xf7ae090f), - C32e(0x94703412), C32e(0x4290f134), C32e(0xa271b701), - C32e(0xe344ed95), C32e(0xe93b8e36), C32e(0x4f2f984a), - C32e(0x88401d63), C32e(0xa06cf615), C32e(0x47c1444b), - C32e(0x8752afff), C32e(0x7ebb4af1), C32e(0xe20ac630), - C32e(0x4670b6c5), C32e(0xcc6e8ce6), C32e(0xa4d5a456), - C32e(0xbd4fca00), C32e(0xda9d844b), C32e(0xc83e18ae), - C32e(0x7357ce45), C32e(0x3064d1ad), C32e(0xe8a6ce68), - C32e(0x145c2567), C32e(0xa3da8cf2), C32e(0xcb0ee116), - C32e(0x33e90658), C32e(0x9a94999a), C32e(0x1f60b220), - C32e(0xc26f847b), C32e(0xd1ceac7f), C32e(0xa0d18518), - C32e(0x32595ba1), C32e(0x8ddd19d3), C32e(0x509a1cc0), - C32e(0xaaa5b446), C32e(0x9f3d6367), C32e(0xe4046bba), - C32e(0xf6ca19ab), C32e(0x0b56ee7e), C32e(0x1fb179ea), - C32e(0xa9282174), C32e(0xe9bdf735), C32e(0x3b3651ee), - C32e(0x1d57ac5a), C32e(0x7550d376), C32e(0x3a46c2fe), - C32e(0xa37d7001), C32e(0xf735c1af), C32e(0x98a4d842), - C32e(0x78edec20), C32e(0x9e6b6779), C32e(0x41836315), - C32e(0xea3adba8), C32e(0xfac33b4d), C32e(0x32832c83), - C32e(0xa7403b1f), C32e(0x1c2747f3), C32e(0x5940f034), - C32e(0xb72d769a), C32e(0xe73e4e6c), C32e(0xd2214ffd), - C32e(0xb8fd8d39), C32e(0xdc5759ef), C32e(0x8d9b0c49), - C32e(0x2b49ebda), C32e(0x5ba2d749), C32e(0x68f3700d), - C32e(0x7d3baed0), C32e(0x7a8d5584), C32e(0xf5a5e9f0), - C32e(0xe4f88e65), C32e(0xa0b8a2f4), C32e(0x36103b53), - C32e(0x0ca8079e), C32e(0x753eec5a), C32e(0x91689492), - C32e(0x56e8884f), C32e(0x5bb05c55), C32e(0xf8babc4c), - C32e(0xe3bb3b99), C32e(0xf387947b), C32e(0x75daf4d6), - C32e(0x726b1c5d), C32e(0x64aeac28), C32e(0xdc34b36d), - C32e(0x6c34a550), C32e(0xb828db71), C32e(0xf861e2f2), - C32e(0x108d512a), C32e(0xe3db6433), C32e(0x59dd75fc), - C32e(0x1cacbcf1), C32e(0x43ce3fa2), C32e(0x67bbd13c), - C32e(0x02e843b0), C32e(0x330a5bca), C32e(0x8829a175), - C32e(0x7f34194d), C32e(0xb416535c), C32e(0x923b94c3), - C32e(0x0e794d1e), C32e(0x797475d7), C32e(0xb6eeaf3f), - C32e(0xeaa8d4f7), C32e(0xbe1a3921), C32e(0x5cf47e09), - C32e(0x4c232751), C32e(0x26a32453), C32e(0xba323cd2), - C32e(0x44a3174a), C32e(0x6da6d5ad), C32e(0xb51d3ea6), - C32e(0xaff2c908), C32e(0x83593d98), C32e(0x916b3c56), - C32e(0x4cf87ca1), C32e(0x7286604d), C32e(0x46e23ecc), - C32e(0x086ec7f6), C32e(0x2f9833b3), C32e(0xb1bc765e), - C32e(0x2bd666a5), C32e(0xefc4e62a), C32e(0x06f4b6e8), - C32e(0xbec1d436), C32e(0x74ee8215), C32e(0xbcef2163), - C32e(0xfdc14e0d), C32e(0xf453c969), C32e(0xa77d5ac4), - C32e(0x06585826), C32e(0x7ec11416), C32e(0x06e0fa16), - C32e(0x7e90af3d), C32e(0x28639d3f), C32e(0xd2c9f2e3), - C32e(0x009bd20c), C32e(0x5faace30), C32e(0xb7d40c30), - C32e(0x742a5116), C32e(0xf2e03298), C32e(0x0deb30d8), - C32e(0xe3cef89a), C32e(0x4bc59e7b), C32e(0xb5f17992), - C32e(0xff51e66e), C32e(0x048668d3), C32e(0x9b234d57), - C32e(0xe6966731), C32e(0xcce6a6f3), C32e(0x170a7505), - C32e(0xb17681d9), C32e(0x13326cce), C32e(0x3c175284), - C32e(0xf805a262), C32e(0xf42bcbb3), C32e(0x78471547), - C32e(0xff465482), C32e(0x23936a48), C32e(0x38df5807), - C32e(0x4e5e6565), C32e(0xf2fc7c89), C32e(0xfc86508e), - C32e(0x31702e44), C32e(0xd00bca86), C32e(0xf04009a2), - C32e(0x3078474e), C32e(0x65a0ee39), C32e(0xd1f73883), - C32e(0xf75ee937), C32e(0xe42c3abd), C32e(0x2197b226), - C32e(0x0113f86f), C32e(0xa344edd1), C32e(0xef9fdee7), - C32e(0x8ba0df15), C32e(0x762592d9), C32e(0x3c85f7f6), - C32e(0x12dc42be), C32e(0xd8a7ec7c), C32e(0xab27b07e), - C32e(0x538d7dda), C32e(0xaa3ea8de), C32e(0xaa25ce93), - C32e(0xbd0269d8), C32e(0x5af643fd), C32e(0x1a7308f9), - C32e(0xc05fefda), C32e(0x174a19a5), C32e(0x974d6633), - C32e(0x4cfd216a), C32e(0x35b49831), C32e(0xdb411570), - C32e(0xea1e0fbb), C32e(0xedcd549b), C32e(0x9ad063a1), - C32e(0x51974072), C32e(0xf6759dbf), C32e(0x91476fe2) -}; - -#define Ceven_w3(r) (C[((r) << 3) + 0]) -#define Ceven_w2(r) (C[((r) << 3) + 1]) -#define Ceven_w1(r) (C[((r) << 3) + 2]) -#define Ceven_w0(r) (C[((r) << 3) + 3]) -#define Codd_w3(r) (C[((r) << 3) + 4]) -#define Codd_w2(r) (C[((r) << 3) + 5]) -#define Codd_w1(r) (C[((r) << 3) + 6]) -#define Codd_w0(r) (C[((r) << 3) + 7]) - -#define S(x0, x1, x2, x3, cb, r) do { \ - Sb(x0 ## 3, x1 ## 3, x2 ## 3, x3 ## 3, cb ## w3(r)); \ - Sb(x0 ## 2, x1 ## 2, x2 ## 2, x3 ## 2, cb ## w2(r)); \ - Sb(x0 ## 1, x1 ## 1, x2 ## 1, x3 ## 1, cb ## w1(r)); \ - Sb(x0 ## 0, x1 ## 0, x2 ## 0, x3 ## 0, cb ## w0(r)); \ - } while (0) - -#define L(x0, x1, x2, x3, x4, x5, x6, x7) do { \ - Lb(x0 ## 3, x1 ## 3, x2 ## 3, x3 ## 3, \ - x4 ## 3, x5 ## 3, x6 ## 3, x7 ## 3); \ - Lb(x0 ## 2, x1 ## 2, x2 ## 2, x3 ## 2, \ - x4 ## 2, x5 ## 2, x6 ## 2, x7 ## 2); \ - Lb(x0 ## 1, x1 ## 1, x2 ## 1, x3 ## 1, \ - x4 ## 1, x5 ## 1, x6 ## 1, x7 ## 1); \ - Lb(x0 ## 0, x1 ## 0, x2 ## 0, x3 ## 0, \ - x4 ## 0, x5 ## 0, x6 ## 0, x7 ## 0); \ - } while (0) - -#define Wz(x, c, n) do { \ - sph_u32 t = (x ## 3 & (c)) << (n); \ - x ## 3 = ((x ## 3 >> (n)) & (c)) | t; \ - t = (x ## 2 & (c)) << (n); \ - x ## 2 = ((x ## 2 >> (n)) & (c)) | t; \ - t = (x ## 1 & (c)) << (n); \ - x ## 1 = ((x ## 1 >> (n)) & (c)) | t; \ - t = (x ## 0 & (c)) << (n); \ - x ## 0 = ((x ## 0 >> (n)) & (c)) | t; \ - } while (0) - -#define W0(x) Wz(x, SPH_C32(0x55555555), 1) -#define W1(x) Wz(x, SPH_C32(0x33333333), 2) -#define W2(x) Wz(x, SPH_C32(0x0F0F0F0F), 4) -#define W3(x) Wz(x, SPH_C32(0x00FF00FF), 8) -#define W4(x) Wz(x, SPH_C32(0x0000FFFF), 16) -#define W5(x) do { \ - sph_u32 t = x ## 3; \ - x ## 3 = x ## 2; \ - x ## 2 = t; \ - t = x ## 1; \ - x ## 1 = x ## 0; \ - x ## 0 = t; \ - } while (0) -#define W6(x) do { \ - sph_u32 t = x ## 3; \ - x ## 3 = x ## 1; \ - x ## 1 = t; \ - t = x ## 2; \ - x ## 2 = x ## 0; \ - x ## 0 = t; \ - } while (0) - -#define DECL_STATE \ - sph_u32 h03, h02, h01, h00, h13, h12, h11, h10; \ - sph_u32 h23, h22, h21, h20, h33, h32, h31, h30; \ - sph_u32 h43, h42, h41, h40, h53, h52, h51, h50; \ - sph_u32 h63, h62, h61, h60, h73, h72, h71, h70; \ - sph_u32 tmp; - -#define READ_STATE(state) do { \ - h03 = (state)->H.narrow[ 0]; \ - h02 = (state)->H.narrow[ 1]; \ - h01 = (state)->H.narrow[ 2]; \ - h00 = (state)->H.narrow[ 3]; \ - h13 = (state)->H.narrow[ 4]; \ - h12 = (state)->H.narrow[ 5]; \ - h11 = (state)->H.narrow[ 6]; \ - h10 = (state)->H.narrow[ 7]; \ - h23 = (state)->H.narrow[ 8]; \ - h22 = (state)->H.narrow[ 9]; \ - h21 = (state)->H.narrow[10]; \ - h20 = (state)->H.narrow[11]; \ - h33 = (state)->H.narrow[12]; \ - h32 = (state)->H.narrow[13]; \ - h31 = (state)->H.narrow[14]; \ - h30 = (state)->H.narrow[15]; \ - h43 = (state)->H.narrow[16]; \ - h42 = (state)->H.narrow[17]; \ - h41 = (state)->H.narrow[18]; \ - h40 = (state)->H.narrow[19]; \ - h53 = (state)->H.narrow[20]; \ - h52 = (state)->H.narrow[21]; \ - h51 = (state)->H.narrow[22]; \ - h50 = (state)->H.narrow[23]; \ - h63 = (state)->H.narrow[24]; \ - h62 = (state)->H.narrow[25]; \ - h61 = (state)->H.narrow[26]; \ - h60 = (state)->H.narrow[27]; \ - h73 = (state)->H.narrow[28]; \ - h72 = (state)->H.narrow[29]; \ - h71 = (state)->H.narrow[30]; \ - h70 = (state)->H.narrow[31]; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->H.narrow[ 0] = h03; \ - (state)->H.narrow[ 1] = h02; \ - (state)->H.narrow[ 2] = h01; \ - (state)->H.narrow[ 3] = h00; \ - (state)->H.narrow[ 4] = h13; \ - (state)->H.narrow[ 5] = h12; \ - (state)->H.narrow[ 6] = h11; \ - (state)->H.narrow[ 7] = h10; \ - (state)->H.narrow[ 8] = h23; \ - (state)->H.narrow[ 9] = h22; \ - (state)->H.narrow[10] = h21; \ - (state)->H.narrow[11] = h20; \ - (state)->H.narrow[12] = h33; \ - (state)->H.narrow[13] = h32; \ - (state)->H.narrow[14] = h31; \ - (state)->H.narrow[15] = h30; \ - (state)->H.narrow[16] = h43; \ - (state)->H.narrow[17] = h42; \ - (state)->H.narrow[18] = h41; \ - (state)->H.narrow[19] = h40; \ - (state)->H.narrow[20] = h53; \ - (state)->H.narrow[21] = h52; \ - (state)->H.narrow[22] = h51; \ - (state)->H.narrow[23] = h50; \ - (state)->H.narrow[24] = h63; \ - (state)->H.narrow[25] = h62; \ - (state)->H.narrow[26] = h61; \ - (state)->H.narrow[27] = h60; \ - (state)->H.narrow[28] = h73; \ - (state)->H.narrow[29] = h72; \ - (state)->H.narrow[30] = h71; \ - (state)->H.narrow[31] = h70; \ - } while (0) - -#define INPUT_BUF1 \ - sph_u32 m03 = dec32e_aligned(buf + 0); \ - sph_u32 m02 = dec32e_aligned(buf + 4); \ - sph_u32 m01 = dec32e_aligned(buf + 8); \ - sph_u32 m00 = dec32e_aligned(buf + 12); \ - sph_u32 m13 = dec32e_aligned(buf + 16); \ - sph_u32 m12 = dec32e_aligned(buf + 20); \ - sph_u32 m11 = dec32e_aligned(buf + 24); \ - sph_u32 m10 = dec32e_aligned(buf + 28); \ - sph_u32 m23 = dec32e_aligned(buf + 32); \ - sph_u32 m22 = dec32e_aligned(buf + 36); \ - sph_u32 m21 = dec32e_aligned(buf + 40); \ - sph_u32 m20 = dec32e_aligned(buf + 44); \ - sph_u32 m33 = dec32e_aligned(buf + 48); \ - sph_u32 m32 = dec32e_aligned(buf + 52); \ - sph_u32 m31 = dec32e_aligned(buf + 56); \ - sph_u32 m30 = dec32e_aligned(buf + 60); \ - h03 ^= m03; \ - h02 ^= m02; \ - h01 ^= m01; \ - h00 ^= m00; \ - h13 ^= m13; \ - h12 ^= m12; \ - h11 ^= m11; \ - h10 ^= m10; \ - h23 ^= m23; \ - h22 ^= m22; \ - h21 ^= m21; \ - h20 ^= m20; \ - h33 ^= m33; \ - h32 ^= m32; \ - h31 ^= m31; \ - h30 ^= m30; - -#define INPUT_BUF2 \ - h43 ^= m03; \ - h42 ^= m02; \ - h41 ^= m01; \ - h40 ^= m00; \ - h53 ^= m13; \ - h52 ^= m12; \ - h51 ^= m11; \ - h50 ^= m10; \ - h63 ^= m23; \ - h62 ^= m22; \ - h61 ^= m21; \ - h60 ^= m20; \ - h73 ^= m33; \ - h72 ^= m32; \ - h71 ^= m31; \ - h70 ^= m30; - -static const sph_u32 IV224[] = { - C32e(0x2dfedd62), C32e(0xf99a98ac), C32e(0xae7cacd6), C32e(0x19d634e7), - C32e(0xa4831005), C32e(0xbc301216), C32e(0xb86038c6), C32e(0xc9661494), - C32e(0x66d9899f), C32e(0x2580706f), C32e(0xce9ea31b), C32e(0x1d9b1adc), - C32e(0x11e8325f), C32e(0x7b366e10), C32e(0xf994857f), C32e(0x02fa06c1), - C32e(0x1b4f1b5c), C32e(0xd8c840b3), C32e(0x97f6a17f), C32e(0x6e738099), - C32e(0xdcdf93a5), C32e(0xadeaa3d3), C32e(0xa431e8de), C32e(0xc9539a68), - C32e(0x22b4a98a), C32e(0xec86a1e4), C32e(0xd574ac95), C32e(0x9ce56cf0), - C32e(0x15960dea), C32e(0xb5ab2bbf), C32e(0x9611dcf0), C32e(0xdd64ea6e) -}; - -static const sph_u32 IV256[] = { - C32e(0xeb98a341), C32e(0x2c20d3eb), C32e(0x92cdbe7b), C32e(0x9cb245c1), - C32e(0x1c935191), C32e(0x60d4c7fa), C32e(0x260082d6), C32e(0x7e508a03), - C32e(0xa4239e26), C32e(0x7726b945), C32e(0xe0fb1a48), C32e(0xd41a9477), - C32e(0xcdb5ab26), C32e(0x026b177a), C32e(0x56f02442), C32e(0x0fff2fa8), - C32e(0x71a39689), C32e(0x7f2e4d75), C32e(0x1d144908), C32e(0xf77de262), - C32e(0x277695f7), C32e(0x76248f94), C32e(0x87d5b657), C32e(0x4780296c), - C32e(0x5c5e272d), C32e(0xac8e0d6c), C32e(0x518450c6), C32e(0x57057a0f), - C32e(0x7be4d367), C32e(0x702412ea), C32e(0x89e3ab13), C32e(0xd31cd769) -}; - -static const sph_u32 IV384[] = { - C32e(0x481e3bc6), C32e(0xd813398a), C32e(0x6d3b5e89), C32e(0x4ade879b), - C32e(0x63faea68), C32e(0xd480ad2e), C32e(0x332ccb21), C32e(0x480f8267), - C32e(0x98aec84d), C32e(0x9082b928), C32e(0xd455ea30), C32e(0x41114249), - C32e(0x36f555b2), C32e(0x924847ec), C32e(0xc7250a93), C32e(0xbaf43ce1), - C32e(0x569b7f8a), C32e(0x27db454c), C32e(0x9efcbd49), C32e(0x6397af0e), - C32e(0x589fc27d), C32e(0x26aa80cd), C32e(0x80c08b8c), C32e(0x9deb2eda), - C32e(0x8a7981e8), C32e(0xf8d5373a), C32e(0xf43967ad), C32e(0xddd17a71), - C32e(0xa9b4d3bd), C32e(0xa475d394), C32e(0x976c3fba), C32e(0x9842737f) -}; - -static const sph_u32 IV512[] = { - C32e(0x6fd14b96), C32e(0x3e00aa17), C32e(0x636a2e05), C32e(0x7a15d543), - C32e(0x8a225e8d), C32e(0x0c97ef0b), C32e(0xe9341259), C32e(0xf2b3c361), - C32e(0x891da0c1), C32e(0x536f801e), C32e(0x2aa9056b), C32e(0xea2b6d80), - C32e(0x588eccdb), C32e(0x2075baa6), C32e(0xa90f3a76), C32e(0xbaf83bf7), - C32e(0x0169e605), C32e(0x41e34a69), C32e(0x46b58a8e), C32e(0x2e6fe65a), - C32e(0x1047a7d0), C32e(0xc1843c24), C32e(0x3b6e71b1), C32e(0x2d5ac199), - C32e(0xcf57f6ec), C32e(0x9db1f856), C32e(0xa706887c), C32e(0x5716b156), - C32e(0xe3c2fcdf), C32e(0xe68517fb), C32e(0x545a4678), C32e(0xcc8cdd4b) -}; - -#endif - -#define SL(ro) SLu(r + ro, ro) - -#define SLu(r, ro) do { \ - S(h0, h2, h4, h6, Ceven_, r); \ - S(h1, h3, h5, h7, Codd_, r); \ - L(h0, h2, h4, h6, h1, h3, h5, h7); \ - W ## ro(h1); \ - W ## ro(h3); \ - W ## ro(h5); \ - W ## ro(h7); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_JH - -#if SPH_JH_64 - -/* - * The "small footprint" 64-bit version just uses a partially unrolled - * loop. - */ - -#define E8 do { \ - unsigned r; \ - for (r = 0; r < 42; r += 7) { \ - SL(0); \ - SL(1); \ - SL(2); \ - SL(3); \ - SL(4); \ - SL(5); \ - SL(6); \ - } \ - } while (0) - -#else - -#define E8 do { \ - unsigned r, g; \ - for (r = g = 0; r < 42; r ++) { \ - S(h0, h2, h4, h6, Ceven_, r); \ - S(h1, h3, h5, h7, Codd_, r); \ - L(h0, h2, h4, h6, h1, h3, h5, h7); \ - switch (g) { \ - case 0: \ - W0(h1); \ - W0(h3); \ - W0(h5); \ - W0(h7); \ - break; \ - case 1: \ - W1(h1); \ - W1(h3); \ - W1(h5); \ - W1(h7); \ - break; \ - case 2: \ - W2(h1); \ - W2(h3); \ - W2(h5); \ - W2(h7); \ - break; \ - case 3: \ - W3(h1); \ - W3(h3); \ - W3(h5); \ - W3(h7); \ - break; \ - case 4: \ - W4(h1); \ - W4(h3); \ - W4(h5); \ - W4(h7); \ - break; \ - case 5: \ - W5(h1); \ - W5(h3); \ - W5(h5); \ - W5(h7); \ - break; \ - case 6: \ - W6(h1); \ - W6(h3); \ - W6(h5); \ - W6(h7); \ - break; \ - } \ - if (++ g == 7) \ - g = 0; \ - } \ - } while (0) - -#endif - -#else - -#if SPH_JH_64 - -/* - * On a "true 64-bit" architecture, we can unroll at will. - */ - -#define E8 do { \ - SLu( 0, 0); \ - SLu( 1, 1); \ - SLu( 2, 2); \ - SLu( 3, 3); \ - SLu( 4, 4); \ - SLu( 5, 5); \ - SLu( 6, 6); \ - SLu( 7, 0); \ - SLu( 8, 1); \ - SLu( 9, 2); \ - SLu(10, 3); \ - SLu(11, 4); \ - SLu(12, 5); \ - SLu(13, 6); \ - SLu(14, 0); \ - SLu(15, 1); \ - SLu(16, 2); \ - SLu(17, 3); \ - SLu(18, 4); \ - SLu(19, 5); \ - SLu(20, 6); \ - SLu(21, 0); \ - SLu(22, 1); \ - SLu(23, 2); \ - SLu(24, 3); \ - SLu(25, 4); \ - SLu(26, 5); \ - SLu(27, 6); \ - SLu(28, 0); \ - SLu(29, 1); \ - SLu(30, 2); \ - SLu(31, 3); \ - SLu(32, 4); \ - SLu(33, 5); \ - SLu(34, 6); \ - SLu(35, 0); \ - SLu(36, 1); \ - SLu(37, 2); \ - SLu(38, 3); \ - SLu(39, 4); \ - SLu(40, 5); \ - SLu(41, 6); \ - } while (0) - -#else - -/* - * We are not aiming at a small footprint, but we are still using a - * 32-bit implementation. Full loop unrolling would smash the L1 - * cache on some "big" architectures (32 kB L1 cache). - */ - -#define E8 do { \ - unsigned r; \ - for (r = 0; r < 42; r += 7) { \ - SL(0); \ - SL(1); \ - SL(2); \ - SL(3); \ - SL(4); \ - SL(5); \ - SL(6); \ - } \ - } while (0) - -#endif - -#endif - -static void -jh_init(sph_jh_context *sc, const void *iv) -{ - sc->ptr = 0; -#if SPH_JH_64 - memcpy(sc->H.wide, iv, sizeof sc->H.wide); -#else - memcpy(sc->H.narrow, iv, sizeof sc->H.narrow); -#endif -#if SPH_64 - sc->block_count = 0; -#else - sc->block_count_high = 0; - sc->block_count_low = 0; -#endif -} - -static void -jh_core(sph_jh_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - INPUT_BUF1; - E8; - INPUT_BUF2; -#if SPH_64 - sc->block_count ++; -#else - if ((sc->block_count_low = SPH_T32( - sc->block_count_low + 1)) == 0) - sc->block_count_high ++; -#endif - ptr = 0; - } - } - WRITE_STATE(sc); - sc->ptr = ptr; -} - -static void -jh_close(sph_jh_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_size_w32, const void *iv) -{ - unsigned z; - unsigned char buf[128]; - size_t numz, u; -#if SPH_64 - sph_u64 l0, l1; -#else - sph_u32 l0, l1, l2, l3; -#endif - - z = 0x80 >> n; - buf[0] = ((ub & -z) | z) & 0xFF; - if (sc->ptr == 0 && n == 0) { - numz = 47; - } else { - numz = 111 - sc->ptr; - } - memset(buf + 1, 0, numz); -#if SPH_64 - l0 = SPH_T64(sc->block_count << 9) + (sc->ptr << 3) + n; - l1 = SPH_T64(sc->block_count >> 55); - sph_enc64be(buf + numz + 1, l1); - sph_enc64be(buf + numz + 9, l0); -#else - l0 = SPH_T32(sc->block_count_low << 9) + (sc->ptr << 3) + n; - l1 = SPH_T32(sc->block_count_low >> 23) - + SPH_T32(sc->block_count_high << 9); - l2 = SPH_T32(sc->block_count_high >> 23); - l3 = 0; - sph_enc32be(buf + numz + 1, l3); - sph_enc32be(buf + numz + 5, l2); - sph_enc32be(buf + numz + 9, l1); - sph_enc32be(buf + numz + 13, l0); -#endif - jh_core(sc, buf, numz + 17); -#if SPH_JH_64 - for (u = 0; u < 8; u ++) - enc64e(buf + (u << 3), sc->H.wide[u + 8]); -#else - for (u = 0; u < 16; u ++) - enc32e(buf + (u << 2), sc->H.narrow[u + 16]); -#endif - memcpy(dst, buf + ((16 - out_size_w32) << 2), out_size_w32 << 2); - jh_init(sc, iv); -} - -/* see sph_jh.h */ -void -sph_jh224_init(void *cc) -{ - jh_init(cc, IV224); -} - -/* see sph_jh.h */ -void -sph_jh224(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh224_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 7, IV224); -} - -/* see sph_jh.h */ -void -sph_jh224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 7, IV224); -} - -/* see sph_jh.h */ -void -sph_jh256_init(void *cc) -{ - jh_init(cc, IV256); -} - -/* see sph_jh.h */ -void -sph_jh256(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh256_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 8, IV256); -} - -/* see sph_jh.h */ -void -sph_jh256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 8, IV256); -} - -/* see sph_jh.h */ -void -sph_jh384_init(void *cc) -{ - jh_init(cc, IV384); -} - -/* see sph_jh.h */ -void -sph_jh384(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh384_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 12, IV384); -} - -/* see sph_jh.h */ -void -sph_jh384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 12, IV384); -} - -/* see sph_jh.h */ -void -sph_jh512_init(void *cc) -{ - jh_init(cc, IV512); -} - -/* see sph_jh.h */ -void -sph_jh512(void *cc, const void *data, size_t len) -{ - jh_core(cc, data, len); -} - -/* see sph_jh.h */ -void -sph_jh512_close(void *cc, void *dst) -{ - jh_close(cc, 0, 0, dst, 16, IV512); -} - -/* see sph_jh.h */ -void -sph_jh512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - jh_close(cc, ub, n, dst, 16, IV512); -} - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/keccak.c b/src/crypto/keccak.c deleted file mode 100644 index cff9f87da..000000000 --- a/src/crypto/keccak.c +++ /dev/null @@ -1,1824 +0,0 @@ -/* $Id: keccak.c 259 2011-07-19 22:11:27Z tp $ */ -/* - * Keccak implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_keccak.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/* - * Parameters: - * - * SPH_KECCAK_64 use a 64-bit type - * SPH_KECCAK_UNROLL number of loops to unroll (0/undef for full unroll) - * SPH_KECCAK_INTERLEAVE use bit-interleaving (32-bit type only) - * SPH_KECCAK_NOCOPY do not copy the state into local variables - * - * If there is no usable 64-bit type, the code automatically switches - * back to the 32-bit implementation. - * - * Some tests on an Intel Core2 Q6600 (both 64-bit and 32-bit, 32 kB L1 - * code cache), a PowerPC (G3, 32 kB L1 code cache), an ARM920T core - * (16 kB L1 code cache), and a small MIPS-compatible CPU (Broadcom BCM3302, - * 8 kB L1 code cache), seem to show that the following are optimal: - * - * -- x86, 64-bit: use the 64-bit implementation, unroll 8 rounds, - * do not copy the state; unrolling 2, 6 or all rounds also provides - * near-optimal performance. - * -- x86, 32-bit: use the 32-bit implementation, unroll 6 rounds, - * interleave, do not copy the state. Unrolling 1, 2, 4 or 8 rounds - * also provides near-optimal performance. - * -- PowerPC: use the 64-bit implementation, unroll 8 rounds, - * copy the state. Unrolling 4 or 6 rounds is near-optimal. - * -- ARM: use the 64-bit implementation, unroll 2 or 4 rounds, - * copy the state. - * -- MIPS: use the 64-bit implementation, unroll 2 rounds, copy - * the state. Unrolling only 1 round is also near-optimal. - * - * Also, interleaving does not always yield actual improvements when - * using a 32-bit implementation; in particular when the architecture - * does not offer a native rotation opcode (interleaving replaces one - * 64-bit rotation with two 32-bit rotations, which is a gain only if - * there is a native 32-bit rotation opcode and not a native 64-bit - * rotation opcode; also, interleaving implies a small overhead when - * processing input words). - * - * To sum up: - * -- when possible, use the 64-bit code - * -- exception: on 32-bit x86, use 32-bit code - * -- when using 32-bit code, use interleaving - * -- copy the state, except on x86 - * -- unroll 8 rounds on "big" machine, 2 rounds on "small" machines - */ - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_KECCAK -#define SPH_SMALL_FOOTPRINT_KECCAK 1 -#endif - -/* - * By default, we select the 64-bit implementation if a 64-bit type - * is available, unless a 32-bit x86 is detected. - */ -#if !defined SPH_KECCAK_64 && SPH_64 \ - && !(defined __i386__ || SPH_I386_GCC || SPH_I386_MSVC) -#define SPH_KECCAK_64 1 -#endif - -/* - * If using a 32-bit implementation, we prefer to interleave. - */ -#if !SPH_KECCAK_64 && !defined SPH_KECCAK_INTERLEAVE -#define SPH_KECCAK_INTERLEAVE 1 -#endif - -/* - * Unroll 8 rounds on big systems, 2 rounds on small systems. - */ -#ifndef SPH_KECCAK_UNROLL -#if SPH_SMALL_FOOTPRINT_KECCAK -#define SPH_KECCAK_UNROLL 2 -#else -#define SPH_KECCAK_UNROLL 8 -#endif -#endif - -/* - * We do not want to copy the state to local variables on x86 (32-bit - * and 64-bit alike). - */ -#ifndef SPH_KECCAK_NOCOPY -#if defined __i386__ || defined __x86_64 || SPH_I386_MSVC || SPH_I386_GCC -#define SPH_KECCAK_NOCOPY 1 -#else -#define SPH_KECCAK_NOCOPY 0 -#endif -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#if SPH_KECCAK_64 - -static const sph_u64 RC[] = { - SPH_C64(0x0000000000000001), SPH_C64(0x0000000000008082), - SPH_C64(0x800000000000808A), SPH_C64(0x8000000080008000), - SPH_C64(0x000000000000808B), SPH_C64(0x0000000080000001), - SPH_C64(0x8000000080008081), SPH_C64(0x8000000000008009), - SPH_C64(0x000000000000008A), SPH_C64(0x0000000000000088), - SPH_C64(0x0000000080008009), SPH_C64(0x000000008000000A), - SPH_C64(0x000000008000808B), SPH_C64(0x800000000000008B), - SPH_C64(0x8000000000008089), SPH_C64(0x8000000000008003), - SPH_C64(0x8000000000008002), SPH_C64(0x8000000000000080), - SPH_C64(0x000000000000800A), SPH_C64(0x800000008000000A), - SPH_C64(0x8000000080008081), SPH_C64(0x8000000000008080), - SPH_C64(0x0000000080000001), SPH_C64(0x8000000080008008) -}; - -#if SPH_KECCAK_NOCOPY - -#define a00 (kc->u.wide[ 0]) -#define a10 (kc->u.wide[ 1]) -#define a20 (kc->u.wide[ 2]) -#define a30 (kc->u.wide[ 3]) -#define a40 (kc->u.wide[ 4]) -#define a01 (kc->u.wide[ 5]) -#define a11 (kc->u.wide[ 6]) -#define a21 (kc->u.wide[ 7]) -#define a31 (kc->u.wide[ 8]) -#define a41 (kc->u.wide[ 9]) -#define a02 (kc->u.wide[10]) -#define a12 (kc->u.wide[11]) -#define a22 (kc->u.wide[12]) -#define a32 (kc->u.wide[13]) -#define a42 (kc->u.wide[14]) -#define a03 (kc->u.wide[15]) -#define a13 (kc->u.wide[16]) -#define a23 (kc->u.wide[17]) -#define a33 (kc->u.wide[18]) -#define a43 (kc->u.wide[19]) -#define a04 (kc->u.wide[20]) -#define a14 (kc->u.wide[21]) -#define a24 (kc->u.wide[22]) -#define a34 (kc->u.wide[23]) -#define a44 (kc->u.wide[24]) - -#define DECL_STATE -#define READ_STATE(sc) -#define WRITE_STATE(sc) - -#define INPUT_BUF(size) do { \ - size_t j; \ - for (j = 0; j < (size); j += 8) { \ - kc->u.wide[j >> 3] ^= sph_dec64le_aligned(buf + j); \ - } \ - } while (0) - -#define INPUT_BUF144 INPUT_BUF(144) -#define INPUT_BUF136 INPUT_BUF(136) -#define INPUT_BUF104 INPUT_BUF(104) -#define INPUT_BUF72 INPUT_BUF(72) - -#else - -#define DECL_STATE \ - sph_u64 a00, a01, a02, a03, a04; \ - sph_u64 a10, a11, a12, a13, a14; \ - sph_u64 a20, a21, a22, a23, a24; \ - sph_u64 a30, a31, a32, a33, a34; \ - sph_u64 a40, a41, a42, a43, a44; - -#define READ_STATE(state) do { \ - a00 = (state)->u.wide[ 0]; \ - a10 = (state)->u.wide[ 1]; \ - a20 = (state)->u.wide[ 2]; \ - a30 = (state)->u.wide[ 3]; \ - a40 = (state)->u.wide[ 4]; \ - a01 = (state)->u.wide[ 5]; \ - a11 = (state)->u.wide[ 6]; \ - a21 = (state)->u.wide[ 7]; \ - a31 = (state)->u.wide[ 8]; \ - a41 = (state)->u.wide[ 9]; \ - a02 = (state)->u.wide[10]; \ - a12 = (state)->u.wide[11]; \ - a22 = (state)->u.wide[12]; \ - a32 = (state)->u.wide[13]; \ - a42 = (state)->u.wide[14]; \ - a03 = (state)->u.wide[15]; \ - a13 = (state)->u.wide[16]; \ - a23 = (state)->u.wide[17]; \ - a33 = (state)->u.wide[18]; \ - a43 = (state)->u.wide[19]; \ - a04 = (state)->u.wide[20]; \ - a14 = (state)->u.wide[21]; \ - a24 = (state)->u.wide[22]; \ - a34 = (state)->u.wide[23]; \ - a44 = (state)->u.wide[24]; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->u.wide[ 0] = a00; \ - (state)->u.wide[ 1] = a10; \ - (state)->u.wide[ 2] = a20; \ - (state)->u.wide[ 3] = a30; \ - (state)->u.wide[ 4] = a40; \ - (state)->u.wide[ 5] = a01; \ - (state)->u.wide[ 6] = a11; \ - (state)->u.wide[ 7] = a21; \ - (state)->u.wide[ 8] = a31; \ - (state)->u.wide[ 9] = a41; \ - (state)->u.wide[10] = a02; \ - (state)->u.wide[11] = a12; \ - (state)->u.wide[12] = a22; \ - (state)->u.wide[13] = a32; \ - (state)->u.wide[14] = a42; \ - (state)->u.wide[15] = a03; \ - (state)->u.wide[16] = a13; \ - (state)->u.wide[17] = a23; \ - (state)->u.wide[18] = a33; \ - (state)->u.wide[19] = a43; \ - (state)->u.wide[20] = a04; \ - (state)->u.wide[21] = a14; \ - (state)->u.wide[22] = a24; \ - (state)->u.wide[23] = a34; \ - (state)->u.wide[24] = a44; \ - } while (0) - -#define INPUT_BUF144 do { \ - a00 ^= sph_dec64le_aligned(buf + 0); \ - a10 ^= sph_dec64le_aligned(buf + 8); \ - a20 ^= sph_dec64le_aligned(buf + 16); \ - a30 ^= sph_dec64le_aligned(buf + 24); \ - a40 ^= sph_dec64le_aligned(buf + 32); \ - a01 ^= sph_dec64le_aligned(buf + 40); \ - a11 ^= sph_dec64le_aligned(buf + 48); \ - a21 ^= sph_dec64le_aligned(buf + 56); \ - a31 ^= sph_dec64le_aligned(buf + 64); \ - a41 ^= sph_dec64le_aligned(buf + 72); \ - a02 ^= sph_dec64le_aligned(buf + 80); \ - a12 ^= sph_dec64le_aligned(buf + 88); \ - a22 ^= sph_dec64le_aligned(buf + 96); \ - a32 ^= sph_dec64le_aligned(buf + 104); \ - a42 ^= sph_dec64le_aligned(buf + 112); \ - a03 ^= sph_dec64le_aligned(buf + 120); \ - a13 ^= sph_dec64le_aligned(buf + 128); \ - a23 ^= sph_dec64le_aligned(buf + 136); \ - } while (0) - -#define INPUT_BUF136 do { \ - a00 ^= sph_dec64le_aligned(buf + 0); \ - a10 ^= sph_dec64le_aligned(buf + 8); \ - a20 ^= sph_dec64le_aligned(buf + 16); \ - a30 ^= sph_dec64le_aligned(buf + 24); \ - a40 ^= sph_dec64le_aligned(buf + 32); \ - a01 ^= sph_dec64le_aligned(buf + 40); \ - a11 ^= sph_dec64le_aligned(buf + 48); \ - a21 ^= sph_dec64le_aligned(buf + 56); \ - a31 ^= sph_dec64le_aligned(buf + 64); \ - a41 ^= sph_dec64le_aligned(buf + 72); \ - a02 ^= sph_dec64le_aligned(buf + 80); \ - a12 ^= sph_dec64le_aligned(buf + 88); \ - a22 ^= sph_dec64le_aligned(buf + 96); \ - a32 ^= sph_dec64le_aligned(buf + 104); \ - a42 ^= sph_dec64le_aligned(buf + 112); \ - a03 ^= sph_dec64le_aligned(buf + 120); \ - a13 ^= sph_dec64le_aligned(buf + 128); \ - } while (0) - -#define INPUT_BUF104 do { \ - a00 ^= sph_dec64le_aligned(buf + 0); \ - a10 ^= sph_dec64le_aligned(buf + 8); \ - a20 ^= sph_dec64le_aligned(buf + 16); \ - a30 ^= sph_dec64le_aligned(buf + 24); \ - a40 ^= sph_dec64le_aligned(buf + 32); \ - a01 ^= sph_dec64le_aligned(buf + 40); \ - a11 ^= sph_dec64le_aligned(buf + 48); \ - a21 ^= sph_dec64le_aligned(buf + 56); \ - a31 ^= sph_dec64le_aligned(buf + 64); \ - a41 ^= sph_dec64le_aligned(buf + 72); \ - a02 ^= sph_dec64le_aligned(buf + 80); \ - a12 ^= sph_dec64le_aligned(buf + 88); \ - a22 ^= sph_dec64le_aligned(buf + 96); \ - } while (0) - -#define INPUT_BUF72 do { \ - a00 ^= sph_dec64le_aligned(buf + 0); \ - a10 ^= sph_dec64le_aligned(buf + 8); \ - a20 ^= sph_dec64le_aligned(buf + 16); \ - a30 ^= sph_dec64le_aligned(buf + 24); \ - a40 ^= sph_dec64le_aligned(buf + 32); \ - a01 ^= sph_dec64le_aligned(buf + 40); \ - a11 ^= sph_dec64le_aligned(buf + 48); \ - a21 ^= sph_dec64le_aligned(buf + 56); \ - a31 ^= sph_dec64le_aligned(buf + 64); \ - } while (0) - -#define INPUT_BUF(lim) do { \ - a00 ^= sph_dec64le_aligned(buf + 0); \ - a10 ^= sph_dec64le_aligned(buf + 8); \ - a20 ^= sph_dec64le_aligned(buf + 16); \ - a30 ^= sph_dec64le_aligned(buf + 24); \ - a40 ^= sph_dec64le_aligned(buf + 32); \ - a01 ^= sph_dec64le_aligned(buf + 40); \ - a11 ^= sph_dec64le_aligned(buf + 48); \ - a21 ^= sph_dec64le_aligned(buf + 56); \ - a31 ^= sph_dec64le_aligned(buf + 64); \ - if ((lim) == 72) \ - break; \ - a41 ^= sph_dec64le_aligned(buf + 72); \ - a02 ^= sph_dec64le_aligned(buf + 80); \ - a12 ^= sph_dec64le_aligned(buf + 88); \ - a22 ^= sph_dec64le_aligned(buf + 96); \ - if ((lim) == 104) \ - break; \ - a32 ^= sph_dec64le_aligned(buf + 104); \ - a42 ^= sph_dec64le_aligned(buf + 112); \ - a03 ^= sph_dec64le_aligned(buf + 120); \ - a13 ^= sph_dec64le_aligned(buf + 128); \ - if ((lim) == 136) \ - break; \ - a23 ^= sph_dec64le_aligned(buf + 136); \ - } while (0) - -#endif - -#define DECL64(x) sph_u64 x -#define MOV64(d, s) (d = s) -#define XOR64(d, a, b) (d = a ^ b) -#define AND64(d, a, b) (d = a & b) -#define OR64(d, a, b) (d = a | b) -#define NOT64(d, s) (d = SPH_T64(~s)) -#define ROL64(d, v, n) (d = SPH_ROTL64(v, n)) -#define XOR64_IOTA XOR64 - -#else - -static const struct { - sph_u32 high, low; -} RC[] = { -#if SPH_KECCAK_INTERLEAVE - { SPH_C32(0x00000000), SPH_C32(0x00000001) }, - { SPH_C32(0x00000089), SPH_C32(0x00000000) }, - { SPH_C32(0x8000008B), SPH_C32(0x00000000) }, - { SPH_C32(0x80008080), SPH_C32(0x00000000) }, - { SPH_C32(0x0000008B), SPH_C32(0x00000001) }, - { SPH_C32(0x00008000), SPH_C32(0x00000001) }, - { SPH_C32(0x80008088), SPH_C32(0x00000001) }, - { SPH_C32(0x80000082), SPH_C32(0x00000001) }, - { SPH_C32(0x0000000B), SPH_C32(0x00000000) }, - { SPH_C32(0x0000000A), SPH_C32(0x00000000) }, - { SPH_C32(0x00008082), SPH_C32(0x00000001) }, - { SPH_C32(0x00008003), SPH_C32(0x00000000) }, - { SPH_C32(0x0000808B), SPH_C32(0x00000001) }, - { SPH_C32(0x8000000B), SPH_C32(0x00000001) }, - { SPH_C32(0x8000008A), SPH_C32(0x00000001) }, - { SPH_C32(0x80000081), SPH_C32(0x00000001) }, - { SPH_C32(0x80000081), SPH_C32(0x00000000) }, - { SPH_C32(0x80000008), SPH_C32(0x00000000) }, - { SPH_C32(0x00000083), SPH_C32(0x00000000) }, - { SPH_C32(0x80008003), SPH_C32(0x00000000) }, - { SPH_C32(0x80008088), SPH_C32(0x00000001) }, - { SPH_C32(0x80000088), SPH_C32(0x00000000) }, - { SPH_C32(0x00008000), SPH_C32(0x00000001) }, - { SPH_C32(0x80008082), SPH_C32(0x00000000) } -#else - { SPH_C32(0x00000000), SPH_C32(0x00000001) }, - { SPH_C32(0x00000000), SPH_C32(0x00008082) }, - { SPH_C32(0x80000000), SPH_C32(0x0000808A) }, - { SPH_C32(0x80000000), SPH_C32(0x80008000) }, - { SPH_C32(0x00000000), SPH_C32(0x0000808B) }, - { SPH_C32(0x00000000), SPH_C32(0x80000001) }, - { SPH_C32(0x80000000), SPH_C32(0x80008081) }, - { SPH_C32(0x80000000), SPH_C32(0x00008009) }, - { SPH_C32(0x00000000), SPH_C32(0x0000008A) }, - { SPH_C32(0x00000000), SPH_C32(0x00000088) }, - { SPH_C32(0x00000000), SPH_C32(0x80008009) }, - { SPH_C32(0x00000000), SPH_C32(0x8000000A) }, - { SPH_C32(0x00000000), SPH_C32(0x8000808B) }, - { SPH_C32(0x80000000), SPH_C32(0x0000008B) }, - { SPH_C32(0x80000000), SPH_C32(0x00008089) }, - { SPH_C32(0x80000000), SPH_C32(0x00008003) }, - { SPH_C32(0x80000000), SPH_C32(0x00008002) }, - { SPH_C32(0x80000000), SPH_C32(0x00000080) }, - { SPH_C32(0x00000000), SPH_C32(0x0000800A) }, - { SPH_C32(0x80000000), SPH_C32(0x8000000A) }, - { SPH_C32(0x80000000), SPH_C32(0x80008081) }, - { SPH_C32(0x80000000), SPH_C32(0x00008080) }, - { SPH_C32(0x00000000), SPH_C32(0x80000001) }, - { SPH_C32(0x80000000), SPH_C32(0x80008008) } -#endif -}; - -#if SPH_KECCAK_INTERLEAVE - -#define INTERLEAVE(xl, xh) do { \ - sph_u32 l, h, t; \ - l = (xl); h = (xh); \ - t = (l ^ (l >> 1)) & SPH_C32(0x22222222); l ^= t ^ (t << 1); \ - t = (h ^ (h >> 1)) & SPH_C32(0x22222222); h ^= t ^ (t << 1); \ - t = (l ^ (l >> 2)) & SPH_C32(0x0C0C0C0C); l ^= t ^ (t << 2); \ - t = (h ^ (h >> 2)) & SPH_C32(0x0C0C0C0C); h ^= t ^ (t << 2); \ - t = (l ^ (l >> 4)) & SPH_C32(0x00F000F0); l ^= t ^ (t << 4); \ - t = (h ^ (h >> 4)) & SPH_C32(0x00F000F0); h ^= t ^ (t << 4); \ - t = (l ^ (l >> 8)) & SPH_C32(0x0000FF00); l ^= t ^ (t << 8); \ - t = (h ^ (h >> 8)) & SPH_C32(0x0000FF00); h ^= t ^ (t << 8); \ - t = (l ^ SPH_T32(h << 16)) & SPH_C32(0xFFFF0000); \ - l ^= t; h ^= t >> 16; \ - (xl) = l; (xh) = h; \ - } while (0) - -#define UNINTERLEAVE(xl, xh) do { \ - sph_u32 l, h, t; \ - l = (xl); h = (xh); \ - t = (l ^ SPH_T32(h << 16)) & SPH_C32(0xFFFF0000); \ - l ^= t; h ^= t >> 16; \ - t = (l ^ (l >> 8)) & SPH_C32(0x0000FF00); l ^= t ^ (t << 8); \ - t = (h ^ (h >> 8)) & SPH_C32(0x0000FF00); h ^= t ^ (t << 8); \ - t = (l ^ (l >> 4)) & SPH_C32(0x00F000F0); l ^= t ^ (t << 4); \ - t = (h ^ (h >> 4)) & SPH_C32(0x00F000F0); h ^= t ^ (t << 4); \ - t = (l ^ (l >> 2)) & SPH_C32(0x0C0C0C0C); l ^= t ^ (t << 2); \ - t = (h ^ (h >> 2)) & SPH_C32(0x0C0C0C0C); h ^= t ^ (t << 2); \ - t = (l ^ (l >> 1)) & SPH_C32(0x22222222); l ^= t ^ (t << 1); \ - t = (h ^ (h >> 1)) & SPH_C32(0x22222222); h ^= t ^ (t << 1); \ - (xl) = l; (xh) = h; \ - } while (0) - -#else - -#define INTERLEAVE(l, h) -#define UNINTERLEAVE(l, h) - -#endif - -#if SPH_KECCAK_NOCOPY - -#define a00l (kc->u.narrow[2 * 0 + 0]) -#define a00h (kc->u.narrow[2 * 0 + 1]) -#define a10l (kc->u.narrow[2 * 1 + 0]) -#define a10h (kc->u.narrow[2 * 1 + 1]) -#define a20l (kc->u.narrow[2 * 2 + 0]) -#define a20h (kc->u.narrow[2 * 2 + 1]) -#define a30l (kc->u.narrow[2 * 3 + 0]) -#define a30h (kc->u.narrow[2 * 3 + 1]) -#define a40l (kc->u.narrow[2 * 4 + 0]) -#define a40h (kc->u.narrow[2 * 4 + 1]) -#define a01l (kc->u.narrow[2 * 5 + 0]) -#define a01h (kc->u.narrow[2 * 5 + 1]) -#define a11l (kc->u.narrow[2 * 6 + 0]) -#define a11h (kc->u.narrow[2 * 6 + 1]) -#define a21l (kc->u.narrow[2 * 7 + 0]) -#define a21h (kc->u.narrow[2 * 7 + 1]) -#define a31l (kc->u.narrow[2 * 8 + 0]) -#define a31h (kc->u.narrow[2 * 8 + 1]) -#define a41l (kc->u.narrow[2 * 9 + 0]) -#define a41h (kc->u.narrow[2 * 9 + 1]) -#define a02l (kc->u.narrow[2 * 10 + 0]) -#define a02h (kc->u.narrow[2 * 10 + 1]) -#define a12l (kc->u.narrow[2 * 11 + 0]) -#define a12h (kc->u.narrow[2 * 11 + 1]) -#define a22l (kc->u.narrow[2 * 12 + 0]) -#define a22h (kc->u.narrow[2 * 12 + 1]) -#define a32l (kc->u.narrow[2 * 13 + 0]) -#define a32h (kc->u.narrow[2 * 13 + 1]) -#define a42l (kc->u.narrow[2 * 14 + 0]) -#define a42h (kc->u.narrow[2 * 14 + 1]) -#define a03l (kc->u.narrow[2 * 15 + 0]) -#define a03h (kc->u.narrow[2 * 15 + 1]) -#define a13l (kc->u.narrow[2 * 16 + 0]) -#define a13h (kc->u.narrow[2 * 16 + 1]) -#define a23l (kc->u.narrow[2 * 17 + 0]) -#define a23h (kc->u.narrow[2 * 17 + 1]) -#define a33l (kc->u.narrow[2 * 18 + 0]) -#define a33h (kc->u.narrow[2 * 18 + 1]) -#define a43l (kc->u.narrow[2 * 19 + 0]) -#define a43h (kc->u.narrow[2 * 19 + 1]) -#define a04l (kc->u.narrow[2 * 20 + 0]) -#define a04h (kc->u.narrow[2 * 20 + 1]) -#define a14l (kc->u.narrow[2 * 21 + 0]) -#define a14h (kc->u.narrow[2 * 21 + 1]) -#define a24l (kc->u.narrow[2 * 22 + 0]) -#define a24h (kc->u.narrow[2 * 22 + 1]) -#define a34l (kc->u.narrow[2 * 23 + 0]) -#define a34h (kc->u.narrow[2 * 23 + 1]) -#define a44l (kc->u.narrow[2 * 24 + 0]) -#define a44h (kc->u.narrow[2 * 24 + 1]) - -#define DECL_STATE -#define READ_STATE(state) -#define WRITE_STATE(state) - -#define INPUT_BUF(size) do { \ - size_t j; \ - for (j = 0; j < (size); j += 8) { \ - sph_u32 tl, th; \ - tl = sph_dec32le_aligned(buf + j + 0); \ - th = sph_dec32le_aligned(buf + j + 4); \ - INTERLEAVE(tl, th); \ - kc->u.narrow[(j >> 2) + 0] ^= tl; \ - kc->u.narrow[(j >> 2) + 1] ^= th; \ - } \ - } while (0) - -#define INPUT_BUF144 INPUT_BUF(144) -#define INPUT_BUF136 INPUT_BUF(136) -#define INPUT_BUF104 INPUT_BUF(104) -#define INPUT_BUF72 INPUT_BUF(72) - -#else - -#define DECL_STATE \ - sph_u32 a00l, a00h, a01l, a01h, a02l, a02h, a03l, a03h, a04l, a04h; \ - sph_u32 a10l, a10h, a11l, a11h, a12l, a12h, a13l, a13h, a14l, a14h; \ - sph_u32 a20l, a20h, a21l, a21h, a22l, a22h, a23l, a23h, a24l, a24h; \ - sph_u32 a30l, a30h, a31l, a31h, a32l, a32h, a33l, a33h, a34l, a34h; \ - sph_u32 a40l, a40h, a41l, a41h, a42l, a42h, a43l, a43h, a44l, a44h; - -#define READ_STATE(state) do { \ - a00l = (state)->u.narrow[2 * 0 + 0]; \ - a00h = (state)->u.narrow[2 * 0 + 1]; \ - a10l = (state)->u.narrow[2 * 1 + 0]; \ - a10h = (state)->u.narrow[2 * 1 + 1]; \ - a20l = (state)->u.narrow[2 * 2 + 0]; \ - a20h = (state)->u.narrow[2 * 2 + 1]; \ - a30l = (state)->u.narrow[2 * 3 + 0]; \ - a30h = (state)->u.narrow[2 * 3 + 1]; \ - a40l = (state)->u.narrow[2 * 4 + 0]; \ - a40h = (state)->u.narrow[2 * 4 + 1]; \ - a01l = (state)->u.narrow[2 * 5 + 0]; \ - a01h = (state)->u.narrow[2 * 5 + 1]; \ - a11l = (state)->u.narrow[2 * 6 + 0]; \ - a11h = (state)->u.narrow[2 * 6 + 1]; \ - a21l = (state)->u.narrow[2 * 7 + 0]; \ - a21h = (state)->u.narrow[2 * 7 + 1]; \ - a31l = (state)->u.narrow[2 * 8 + 0]; \ - a31h = (state)->u.narrow[2 * 8 + 1]; \ - a41l = (state)->u.narrow[2 * 9 + 0]; \ - a41h = (state)->u.narrow[2 * 9 + 1]; \ - a02l = (state)->u.narrow[2 * 10 + 0]; \ - a02h = (state)->u.narrow[2 * 10 + 1]; \ - a12l = (state)->u.narrow[2 * 11 + 0]; \ - a12h = (state)->u.narrow[2 * 11 + 1]; \ - a22l = (state)->u.narrow[2 * 12 + 0]; \ - a22h = (state)->u.narrow[2 * 12 + 1]; \ - a32l = (state)->u.narrow[2 * 13 + 0]; \ - a32h = (state)->u.narrow[2 * 13 + 1]; \ - a42l = (state)->u.narrow[2 * 14 + 0]; \ - a42h = (state)->u.narrow[2 * 14 + 1]; \ - a03l = (state)->u.narrow[2 * 15 + 0]; \ - a03h = (state)->u.narrow[2 * 15 + 1]; \ - a13l = (state)->u.narrow[2 * 16 + 0]; \ - a13h = (state)->u.narrow[2 * 16 + 1]; \ - a23l = (state)->u.narrow[2 * 17 + 0]; \ - a23h = (state)->u.narrow[2 * 17 + 1]; \ - a33l = (state)->u.narrow[2 * 18 + 0]; \ - a33h = (state)->u.narrow[2 * 18 + 1]; \ - a43l = (state)->u.narrow[2 * 19 + 0]; \ - a43h = (state)->u.narrow[2 * 19 + 1]; \ - a04l = (state)->u.narrow[2 * 20 + 0]; \ - a04h = (state)->u.narrow[2 * 20 + 1]; \ - a14l = (state)->u.narrow[2 * 21 + 0]; \ - a14h = (state)->u.narrow[2 * 21 + 1]; \ - a24l = (state)->u.narrow[2 * 22 + 0]; \ - a24h = (state)->u.narrow[2 * 22 + 1]; \ - a34l = (state)->u.narrow[2 * 23 + 0]; \ - a34h = (state)->u.narrow[2 * 23 + 1]; \ - a44l = (state)->u.narrow[2 * 24 + 0]; \ - a44h = (state)->u.narrow[2 * 24 + 1]; \ - } while (0) - -#define WRITE_STATE(state) do { \ - (state)->u.narrow[2 * 0 + 0] = a00l; \ - (state)->u.narrow[2 * 0 + 1] = a00h; \ - (state)->u.narrow[2 * 1 + 0] = a10l; \ - (state)->u.narrow[2 * 1 + 1] = a10h; \ - (state)->u.narrow[2 * 2 + 0] = a20l; \ - (state)->u.narrow[2 * 2 + 1] = a20h; \ - (state)->u.narrow[2 * 3 + 0] = a30l; \ - (state)->u.narrow[2 * 3 + 1] = a30h; \ - (state)->u.narrow[2 * 4 + 0] = a40l; \ - (state)->u.narrow[2 * 4 + 1] = a40h; \ - (state)->u.narrow[2 * 5 + 0] = a01l; \ - (state)->u.narrow[2 * 5 + 1] = a01h; \ - (state)->u.narrow[2 * 6 + 0] = a11l; \ - (state)->u.narrow[2 * 6 + 1] = a11h; \ - (state)->u.narrow[2 * 7 + 0] = a21l; \ - (state)->u.narrow[2 * 7 + 1] = a21h; \ - (state)->u.narrow[2 * 8 + 0] = a31l; \ - (state)->u.narrow[2 * 8 + 1] = a31h; \ - (state)->u.narrow[2 * 9 + 0] = a41l; \ - (state)->u.narrow[2 * 9 + 1] = a41h; \ - (state)->u.narrow[2 * 10 + 0] = a02l; \ - (state)->u.narrow[2 * 10 + 1] = a02h; \ - (state)->u.narrow[2 * 11 + 0] = a12l; \ - (state)->u.narrow[2 * 11 + 1] = a12h; \ - (state)->u.narrow[2 * 12 + 0] = a22l; \ - (state)->u.narrow[2 * 12 + 1] = a22h; \ - (state)->u.narrow[2 * 13 + 0] = a32l; \ - (state)->u.narrow[2 * 13 + 1] = a32h; \ - (state)->u.narrow[2 * 14 + 0] = a42l; \ - (state)->u.narrow[2 * 14 + 1] = a42h; \ - (state)->u.narrow[2 * 15 + 0] = a03l; \ - (state)->u.narrow[2 * 15 + 1] = a03h; \ - (state)->u.narrow[2 * 16 + 0] = a13l; \ - (state)->u.narrow[2 * 16 + 1] = a13h; \ - (state)->u.narrow[2 * 17 + 0] = a23l; \ - (state)->u.narrow[2 * 17 + 1] = a23h; \ - (state)->u.narrow[2 * 18 + 0] = a33l; \ - (state)->u.narrow[2 * 18 + 1] = a33h; \ - (state)->u.narrow[2 * 19 + 0] = a43l; \ - (state)->u.narrow[2 * 19 + 1] = a43h; \ - (state)->u.narrow[2 * 20 + 0] = a04l; \ - (state)->u.narrow[2 * 20 + 1] = a04h; \ - (state)->u.narrow[2 * 21 + 0] = a14l; \ - (state)->u.narrow[2 * 21 + 1] = a14h; \ - (state)->u.narrow[2 * 22 + 0] = a24l; \ - (state)->u.narrow[2 * 22 + 1] = a24h; \ - (state)->u.narrow[2 * 23 + 0] = a34l; \ - (state)->u.narrow[2 * 23 + 1] = a34h; \ - (state)->u.narrow[2 * 24 + 0] = a44l; \ - (state)->u.narrow[2 * 24 + 1] = a44h; \ - } while (0) - -#define READ64(d, off) do { \ - sph_u32 tl, th; \ - tl = sph_dec32le_aligned(buf + (off)); \ - th = sph_dec32le_aligned(buf + (off) + 4); \ - INTERLEAVE(tl, th); \ - d ## l ^= tl; \ - d ## h ^= th; \ - } while (0) - -#define INPUT_BUF144 do { \ - READ64(a00, 0); \ - READ64(a10, 8); \ - READ64(a20, 16); \ - READ64(a30, 24); \ - READ64(a40, 32); \ - READ64(a01, 40); \ - READ64(a11, 48); \ - READ64(a21, 56); \ - READ64(a31, 64); \ - READ64(a41, 72); \ - READ64(a02, 80); \ - READ64(a12, 88); \ - READ64(a22, 96); \ - READ64(a32, 104); \ - READ64(a42, 112); \ - READ64(a03, 120); \ - READ64(a13, 128); \ - READ64(a23, 136); \ - } while (0) - -#define INPUT_BUF136 do { \ - READ64(a00, 0); \ - READ64(a10, 8); \ - READ64(a20, 16); \ - READ64(a30, 24); \ - READ64(a40, 32); \ - READ64(a01, 40); \ - READ64(a11, 48); \ - READ64(a21, 56); \ - READ64(a31, 64); \ - READ64(a41, 72); \ - READ64(a02, 80); \ - READ64(a12, 88); \ - READ64(a22, 96); \ - READ64(a32, 104); \ - READ64(a42, 112); \ - READ64(a03, 120); \ - READ64(a13, 128); \ - } while (0) - -#define INPUT_BUF104 do { \ - READ64(a00, 0); \ - READ64(a10, 8); \ - READ64(a20, 16); \ - READ64(a30, 24); \ - READ64(a40, 32); \ - READ64(a01, 40); \ - READ64(a11, 48); \ - READ64(a21, 56); \ - READ64(a31, 64); \ - READ64(a41, 72); \ - READ64(a02, 80); \ - READ64(a12, 88); \ - READ64(a22, 96); \ - } while (0) - -#define INPUT_BUF72 do { \ - READ64(a00, 0); \ - READ64(a10, 8); \ - READ64(a20, 16); \ - READ64(a30, 24); \ - READ64(a40, 32); \ - READ64(a01, 40); \ - READ64(a11, 48); \ - READ64(a21, 56); \ - READ64(a31, 64); \ - } while (0) - -#define INPUT_BUF(lim) do { \ - READ64(a00, 0); \ - READ64(a10, 8); \ - READ64(a20, 16); \ - READ64(a30, 24); \ - READ64(a40, 32); \ - READ64(a01, 40); \ - READ64(a11, 48); \ - READ64(a21, 56); \ - READ64(a31, 64); \ - if ((lim) == 72) \ - break; \ - READ64(a41, 72); \ - READ64(a02, 80); \ - READ64(a12, 88); \ - READ64(a22, 96); \ - if ((lim) == 104) \ - break; \ - READ64(a32, 104); \ - READ64(a42, 112); \ - READ64(a03, 120); \ - READ64(a13, 128); \ - if ((lim) == 136) \ - break; \ - READ64(a23, 136); \ - } while (0) - -#endif - -#define DECL64(x) sph_u64 x ## l, x ## h -#define MOV64(d, s) (d ## l = s ## l, d ## h = s ## h) -#define XOR64(d, a, b) (d ## l = a ## l ^ b ## l, d ## h = a ## h ^ b ## h) -#define AND64(d, a, b) (d ## l = a ## l & b ## l, d ## h = a ## h & b ## h) -#define OR64(d, a, b) (d ## l = a ## l | b ## l, d ## h = a ## h | b ## h) -#define NOT64(d, s) (d ## l = SPH_T32(~s ## l), d ## h = SPH_T32(~s ## h)) -#define ROL64(d, v, n) ROL64_ ## n(d, v) - -#if SPH_KECCAK_INTERLEAVE - -#define ROL64_odd1(d, v) do { \ - sph_u32 tmp; \ - tmp = v ## l; \ - d ## l = SPH_T32(v ## h << 1) | (v ## h >> 31); \ - d ## h = tmp; \ - } while (0) - -#define ROL64_odd63(d, v) do { \ - sph_u32 tmp; \ - tmp = SPH_T32(v ## l << 31) | (v ## l >> 1); \ - d ## l = v ## h; \ - d ## h = tmp; \ - } while (0) - -#define ROL64_odd(d, v, n) do { \ - sph_u32 tmp; \ - tmp = SPH_T32(v ## l << (n - 1)) | (v ## l >> (33 - n)); \ - d ## l = SPH_T32(v ## h << n) | (v ## h >> (32 - n)); \ - d ## h = tmp; \ - } while (0) - -#define ROL64_even(d, v, n) do { \ - d ## l = SPH_T32(v ## l << n) | (v ## l >> (32 - n)); \ - d ## h = SPH_T32(v ## h << n) | (v ## h >> (32 - n)); \ - } while (0) - -#define ROL64_0(d, v) -#define ROL64_1(d, v) ROL64_odd1(d, v) -#define ROL64_2(d, v) ROL64_even(d, v, 1) -#define ROL64_3(d, v) ROL64_odd( d, v, 2) -#define ROL64_4(d, v) ROL64_even(d, v, 2) -#define ROL64_5(d, v) ROL64_odd( d, v, 3) -#define ROL64_6(d, v) ROL64_even(d, v, 3) -#define ROL64_7(d, v) ROL64_odd( d, v, 4) -#define ROL64_8(d, v) ROL64_even(d, v, 4) -#define ROL64_9(d, v) ROL64_odd( d, v, 5) -#define ROL64_10(d, v) ROL64_even(d, v, 5) -#define ROL64_11(d, v) ROL64_odd( d, v, 6) -#define ROL64_12(d, v) ROL64_even(d, v, 6) -#define ROL64_13(d, v) ROL64_odd( d, v, 7) -#define ROL64_14(d, v) ROL64_even(d, v, 7) -#define ROL64_15(d, v) ROL64_odd( d, v, 8) -#define ROL64_16(d, v) ROL64_even(d, v, 8) -#define ROL64_17(d, v) ROL64_odd( d, v, 9) -#define ROL64_18(d, v) ROL64_even(d, v, 9) -#define ROL64_19(d, v) ROL64_odd( d, v, 10) -#define ROL64_20(d, v) ROL64_even(d, v, 10) -#define ROL64_21(d, v) ROL64_odd( d, v, 11) -#define ROL64_22(d, v) ROL64_even(d, v, 11) -#define ROL64_23(d, v) ROL64_odd( d, v, 12) -#define ROL64_24(d, v) ROL64_even(d, v, 12) -#define ROL64_25(d, v) ROL64_odd( d, v, 13) -#define ROL64_26(d, v) ROL64_even(d, v, 13) -#define ROL64_27(d, v) ROL64_odd( d, v, 14) -#define ROL64_28(d, v) ROL64_even(d, v, 14) -#define ROL64_29(d, v) ROL64_odd( d, v, 15) -#define ROL64_30(d, v) ROL64_even(d, v, 15) -#define ROL64_31(d, v) ROL64_odd( d, v, 16) -#define ROL64_32(d, v) ROL64_even(d, v, 16) -#define ROL64_33(d, v) ROL64_odd( d, v, 17) -#define ROL64_34(d, v) ROL64_even(d, v, 17) -#define ROL64_35(d, v) ROL64_odd( d, v, 18) -#define ROL64_36(d, v) ROL64_even(d, v, 18) -#define ROL64_37(d, v) ROL64_odd( d, v, 19) -#define ROL64_38(d, v) ROL64_even(d, v, 19) -#define ROL64_39(d, v) ROL64_odd( d, v, 20) -#define ROL64_40(d, v) ROL64_even(d, v, 20) -#define ROL64_41(d, v) ROL64_odd( d, v, 21) -#define ROL64_42(d, v) ROL64_even(d, v, 21) -#define ROL64_43(d, v) ROL64_odd( d, v, 22) -#define ROL64_44(d, v) ROL64_even(d, v, 22) -#define ROL64_45(d, v) ROL64_odd( d, v, 23) -#define ROL64_46(d, v) ROL64_even(d, v, 23) -#define ROL64_47(d, v) ROL64_odd( d, v, 24) -#define ROL64_48(d, v) ROL64_even(d, v, 24) -#define ROL64_49(d, v) ROL64_odd( d, v, 25) -#define ROL64_50(d, v) ROL64_even(d, v, 25) -#define ROL64_51(d, v) ROL64_odd( d, v, 26) -#define ROL64_52(d, v) ROL64_even(d, v, 26) -#define ROL64_53(d, v) ROL64_odd( d, v, 27) -#define ROL64_54(d, v) ROL64_even(d, v, 27) -#define ROL64_55(d, v) ROL64_odd( d, v, 28) -#define ROL64_56(d, v) ROL64_even(d, v, 28) -#define ROL64_57(d, v) ROL64_odd( d, v, 29) -#define ROL64_58(d, v) ROL64_even(d, v, 29) -#define ROL64_59(d, v) ROL64_odd( d, v, 30) -#define ROL64_60(d, v) ROL64_even(d, v, 30) -#define ROL64_61(d, v) ROL64_odd( d, v, 31) -#define ROL64_62(d, v) ROL64_even(d, v, 31) -#define ROL64_63(d, v) ROL64_odd63(d, v) - -#else - -#define ROL64_small(d, v, n) do { \ - sph_u32 tmp; \ - tmp = SPH_T32(v ## l << n) | (v ## h >> (32 - n)); \ - d ## h = SPH_T32(v ## h << n) | (v ## l >> (32 - n)); \ - d ## l = tmp; \ - } while (0) - -#define ROL64_0(d, v) 0 -#define ROL64_1(d, v) ROL64_small(d, v, 1) -#define ROL64_2(d, v) ROL64_small(d, v, 2) -#define ROL64_3(d, v) ROL64_small(d, v, 3) -#define ROL64_4(d, v) ROL64_small(d, v, 4) -#define ROL64_5(d, v) ROL64_small(d, v, 5) -#define ROL64_6(d, v) ROL64_small(d, v, 6) -#define ROL64_7(d, v) ROL64_small(d, v, 7) -#define ROL64_8(d, v) ROL64_small(d, v, 8) -#define ROL64_9(d, v) ROL64_small(d, v, 9) -#define ROL64_10(d, v) ROL64_small(d, v, 10) -#define ROL64_11(d, v) ROL64_small(d, v, 11) -#define ROL64_12(d, v) ROL64_small(d, v, 12) -#define ROL64_13(d, v) ROL64_small(d, v, 13) -#define ROL64_14(d, v) ROL64_small(d, v, 14) -#define ROL64_15(d, v) ROL64_small(d, v, 15) -#define ROL64_16(d, v) ROL64_small(d, v, 16) -#define ROL64_17(d, v) ROL64_small(d, v, 17) -#define ROL64_18(d, v) ROL64_small(d, v, 18) -#define ROL64_19(d, v) ROL64_small(d, v, 19) -#define ROL64_20(d, v) ROL64_small(d, v, 20) -#define ROL64_21(d, v) ROL64_small(d, v, 21) -#define ROL64_22(d, v) ROL64_small(d, v, 22) -#define ROL64_23(d, v) ROL64_small(d, v, 23) -#define ROL64_24(d, v) ROL64_small(d, v, 24) -#define ROL64_25(d, v) ROL64_small(d, v, 25) -#define ROL64_26(d, v) ROL64_small(d, v, 26) -#define ROL64_27(d, v) ROL64_small(d, v, 27) -#define ROL64_28(d, v) ROL64_small(d, v, 28) -#define ROL64_29(d, v) ROL64_small(d, v, 29) -#define ROL64_30(d, v) ROL64_small(d, v, 30) -#define ROL64_31(d, v) ROL64_small(d, v, 31) - -#define ROL64_32(d, v) do { \ - sph_u32 tmp; \ - tmp = v ## l; \ - d ## l = v ## h; \ - d ## h = tmp; \ - } while (0) - -#define ROL64_big(d, v, n) do { \ - sph_u32 trl, trh; \ - ROL64_small(tr, v, n); \ - d ## h = trl; \ - d ## l = trh; \ - } while (0) - -#define ROL64_33(d, v) ROL64_big(d, v, 1) -#define ROL64_34(d, v) ROL64_big(d, v, 2) -#define ROL64_35(d, v) ROL64_big(d, v, 3) -#define ROL64_36(d, v) ROL64_big(d, v, 4) -#define ROL64_37(d, v) ROL64_big(d, v, 5) -#define ROL64_38(d, v) ROL64_big(d, v, 6) -#define ROL64_39(d, v) ROL64_big(d, v, 7) -#define ROL64_40(d, v) ROL64_big(d, v, 8) -#define ROL64_41(d, v) ROL64_big(d, v, 9) -#define ROL64_42(d, v) ROL64_big(d, v, 10) -#define ROL64_43(d, v) ROL64_big(d, v, 11) -#define ROL64_44(d, v) ROL64_big(d, v, 12) -#define ROL64_45(d, v) ROL64_big(d, v, 13) -#define ROL64_46(d, v) ROL64_big(d, v, 14) -#define ROL64_47(d, v) ROL64_big(d, v, 15) -#define ROL64_48(d, v) ROL64_big(d, v, 16) -#define ROL64_49(d, v) ROL64_big(d, v, 17) -#define ROL64_50(d, v) ROL64_big(d, v, 18) -#define ROL64_51(d, v) ROL64_big(d, v, 19) -#define ROL64_52(d, v) ROL64_big(d, v, 20) -#define ROL64_53(d, v) ROL64_big(d, v, 21) -#define ROL64_54(d, v) ROL64_big(d, v, 22) -#define ROL64_55(d, v) ROL64_big(d, v, 23) -#define ROL64_56(d, v) ROL64_big(d, v, 24) -#define ROL64_57(d, v) ROL64_big(d, v, 25) -#define ROL64_58(d, v) ROL64_big(d, v, 26) -#define ROL64_59(d, v) ROL64_big(d, v, 27) -#define ROL64_60(d, v) ROL64_big(d, v, 28) -#define ROL64_61(d, v) ROL64_big(d, v, 29) -#define ROL64_62(d, v) ROL64_big(d, v, 30) -#define ROL64_63(d, v) ROL64_big(d, v, 31) - -#endif - -#define XOR64_IOTA(d, s, k) \ - (d ## l = s ## l ^ k.low, d ## h = s ## h ^ k.high) - -#endif - -#define TH_ELT(t, c0, c1, c2, c3, c4, d0, d1, d2, d3, d4) do { \ - DECL64(tt0); \ - DECL64(tt1); \ - DECL64(tt2); \ - DECL64(tt3); \ - XOR64(tt0, d0, d1); \ - XOR64(tt1, d2, d3); \ - XOR64(tt0, tt0, d4); \ - XOR64(tt0, tt0, tt1); \ - ROL64(tt0, tt0, 1); \ - XOR64(tt2, c0, c1); \ - XOR64(tt3, c2, c3); \ - XOR64(tt0, tt0, c4); \ - XOR64(tt2, tt2, tt3); \ - XOR64(t, tt0, tt2); \ - } while (0) - -#define THETA(b00, b01, b02, b03, b04, b10, b11, b12, b13, b14, \ - b20, b21, b22, b23, b24, b30, b31, b32, b33, b34, \ - b40, b41, b42, b43, b44) \ - do { \ - DECL64(t0); \ - DECL64(t1); \ - DECL64(t2); \ - DECL64(t3); \ - DECL64(t4); \ - TH_ELT(t0, b40, b41, b42, b43, b44, b10, b11, b12, b13, b14); \ - TH_ELT(t1, b00, b01, b02, b03, b04, b20, b21, b22, b23, b24); \ - TH_ELT(t2, b10, b11, b12, b13, b14, b30, b31, b32, b33, b34); \ - TH_ELT(t3, b20, b21, b22, b23, b24, b40, b41, b42, b43, b44); \ - TH_ELT(t4, b30, b31, b32, b33, b34, b00, b01, b02, b03, b04); \ - XOR64(b00, b00, t0); \ - XOR64(b01, b01, t0); \ - XOR64(b02, b02, t0); \ - XOR64(b03, b03, t0); \ - XOR64(b04, b04, t0); \ - XOR64(b10, b10, t1); \ - XOR64(b11, b11, t1); \ - XOR64(b12, b12, t1); \ - XOR64(b13, b13, t1); \ - XOR64(b14, b14, t1); \ - XOR64(b20, b20, t2); \ - XOR64(b21, b21, t2); \ - XOR64(b22, b22, t2); \ - XOR64(b23, b23, t2); \ - XOR64(b24, b24, t2); \ - XOR64(b30, b30, t3); \ - XOR64(b31, b31, t3); \ - XOR64(b32, b32, t3); \ - XOR64(b33, b33, t3); \ - XOR64(b34, b34, t3); \ - XOR64(b40, b40, t4); \ - XOR64(b41, b41, t4); \ - XOR64(b42, b42, t4); \ - XOR64(b43, b43, t4); \ - XOR64(b44, b44, t4); \ - } while (0) - -#define RHO(b00, b01, b02, b03, b04, b10, b11, b12, b13, b14, \ - b20, b21, b22, b23, b24, b30, b31, b32, b33, b34, \ - b40, b41, b42, b43, b44) \ - do { \ - /* ROL64(b00, b00, 0); */ \ - ROL64(b01, b01, 36); \ - ROL64(b02, b02, 3); \ - ROL64(b03, b03, 41); \ - ROL64(b04, b04, 18); \ - ROL64(b10, b10, 1); \ - ROL64(b11, b11, 44); \ - ROL64(b12, b12, 10); \ - ROL64(b13, b13, 45); \ - ROL64(b14, b14, 2); \ - ROL64(b20, b20, 62); \ - ROL64(b21, b21, 6); \ - ROL64(b22, b22, 43); \ - ROL64(b23, b23, 15); \ - ROL64(b24, b24, 61); \ - ROL64(b30, b30, 28); \ - ROL64(b31, b31, 55); \ - ROL64(b32, b32, 25); \ - ROL64(b33, b33, 21); \ - ROL64(b34, b34, 56); \ - ROL64(b40, b40, 27); \ - ROL64(b41, b41, 20); \ - ROL64(b42, b42, 39); \ - ROL64(b43, b43, 8); \ - ROL64(b44, b44, 14); \ - } while (0) - -/* - * The KHI macro integrates the "lane complement" optimization. On input, - * some words are complemented: - * a00 a01 a02 a04 a13 a20 a21 a22 a30 a33 a34 a43 - * On output, the following words are complemented: - * a04 a10 a20 a22 a23 a31 - * - * The (implicit) permutation and the theta expansion will bring back - * the input mask for the next round. - */ - -#define KHI_XO(d, a, b, c) do { \ - DECL64(kt); \ - OR64(kt, b, c); \ - XOR64(d, a, kt); \ - } while (0) - -#define KHI_XA(d, a, b, c) do { \ - DECL64(kt); \ - AND64(kt, b, c); \ - XOR64(d, a, kt); \ - } while (0) - -#define KHI(b00, b01, b02, b03, b04, b10, b11, b12, b13, b14, \ - b20, b21, b22, b23, b24, b30, b31, b32, b33, b34, \ - b40, b41, b42, b43, b44) \ - do { \ - DECL64(c0); \ - DECL64(c1); \ - DECL64(c2); \ - DECL64(c3); \ - DECL64(c4); \ - DECL64(bnn); \ - NOT64(bnn, b20); \ - KHI_XO(c0, b00, b10, b20); \ - KHI_XO(c1, b10, bnn, b30); \ - KHI_XA(c2, b20, b30, b40); \ - KHI_XO(c3, b30, b40, b00); \ - KHI_XA(c4, b40, b00, b10); \ - MOV64(b00, c0); \ - MOV64(b10, c1); \ - MOV64(b20, c2); \ - MOV64(b30, c3); \ - MOV64(b40, c4); \ - NOT64(bnn, b41); \ - KHI_XO(c0, b01, b11, b21); \ - KHI_XA(c1, b11, b21, b31); \ - KHI_XO(c2, b21, b31, bnn); \ - KHI_XO(c3, b31, b41, b01); \ - KHI_XA(c4, b41, b01, b11); \ - MOV64(b01, c0); \ - MOV64(b11, c1); \ - MOV64(b21, c2); \ - MOV64(b31, c3); \ - MOV64(b41, c4); \ - NOT64(bnn, b32); \ - KHI_XO(c0, b02, b12, b22); \ - KHI_XA(c1, b12, b22, b32); \ - KHI_XA(c2, b22, bnn, b42); \ - KHI_XO(c3, bnn, b42, b02); \ - KHI_XA(c4, b42, b02, b12); \ - MOV64(b02, c0); \ - MOV64(b12, c1); \ - MOV64(b22, c2); \ - MOV64(b32, c3); \ - MOV64(b42, c4); \ - NOT64(bnn, b33); \ - KHI_XA(c0, b03, b13, b23); \ - KHI_XO(c1, b13, b23, b33); \ - KHI_XO(c2, b23, bnn, b43); \ - KHI_XA(c3, bnn, b43, b03); \ - KHI_XO(c4, b43, b03, b13); \ - MOV64(b03, c0); \ - MOV64(b13, c1); \ - MOV64(b23, c2); \ - MOV64(b33, c3); \ - MOV64(b43, c4); \ - NOT64(bnn, b14); \ - KHI_XA(c0, b04, bnn, b24); \ - KHI_XO(c1, bnn, b24, b34); \ - KHI_XA(c2, b24, b34, b44); \ - KHI_XO(c3, b34, b44, b04); \ - KHI_XA(c4, b44, b04, b14); \ - MOV64(b04, c0); \ - MOV64(b14, c1); \ - MOV64(b24, c2); \ - MOV64(b34, c3); \ - MOV64(b44, c4); \ - } while (0) - -#define IOTA(r) XOR64_IOTA(a00, a00, r) - -#define P0 a00, a01, a02, a03, a04, a10, a11, a12, a13, a14, a20, a21, \ - a22, a23, a24, a30, a31, a32, a33, a34, a40, a41, a42, a43, a44 -#define P1 a00, a30, a10, a40, a20, a11, a41, a21, a01, a31, a22, a02, \ - a32, a12, a42, a33, a13, a43, a23, a03, a44, a24, a04, a34, a14 -#define P2 a00, a33, a11, a44, a22, a41, a24, a02, a30, a13, a32, a10, \ - a43, a21, a04, a23, a01, a34, a12, a40, a14, a42, a20, a03, a31 -#define P3 a00, a23, a41, a14, a32, a24, a42, a10, a33, a01, a43, a11, \ - a34, a02, a20, a12, a30, a03, a21, a44, a31, a04, a22, a40, a13 -#define P4 a00, a12, a24, a31, a43, a42, a04, a11, a23, a30, a34, a41, \ - a03, a10, a22, a21, a33, a40, a02, a14, a13, a20, a32, a44, a01 -#define P5 a00, a21, a42, a13, a34, a04, a20, a41, a12, a33, a03, a24, \ - a40, a11, a32, a02, a23, a44, a10, a31, a01, a22, a43, a14, a30 -#define P6 a00, a02, a04, a01, a03, a20, a22, a24, a21, a23, a40, a42, \ - a44, a41, a43, a10, a12, a14, a11, a13, a30, a32, a34, a31, a33 -#define P7 a00, a10, a20, a30, a40, a22, a32, a42, a02, a12, a44, a04, \ - a14, a24, a34, a11, a21, a31, a41, a01, a33, a43, a03, a13, a23 -#define P8 a00, a11, a22, a33, a44, a32, a43, a04, a10, a21, a14, a20, \ - a31, a42, a03, a41, a02, a13, a24, a30, a23, a34, a40, a01, a12 -#define P9 a00, a41, a32, a23, a14, a43, a34, a20, a11, a02, a31, a22, \ - a13, a04, a40, a24, a10, a01, a42, a33, a12, a03, a44, a30, a21 -#define P10 a00, a24, a43, a12, a31, a34, a03, a22, a41, a10, a13, a32, \ - a01, a20, a44, a42, a11, a30, a04, a23, a21, a40, a14, a33, a02 -#define P11 a00, a42, a34, a21, a13, a03, a40, a32, a24, a11, a01, a43, \ - a30, a22, a14, a04, a41, a33, a20, a12, a02, a44, a31, a23, a10 -#define P12 a00, a04, a03, a02, a01, a40, a44, a43, a42, a41, a30, a34, \ - a33, a32, a31, a20, a24, a23, a22, a21, a10, a14, a13, a12, a11 -#define P13 a00, a20, a40, a10, a30, a44, a14, a34, a04, a24, a33, a03, \ - a23, a43, a13, a22, a42, a12, a32, a02, a11, a31, a01, a21, a41 -#define P14 a00, a22, a44, a11, a33, a14, a31, a03, a20, a42, a23, a40, \ - a12, a34, a01, a32, a04, a21, a43, a10, a41, a13, a30, a02, a24 -#define P15 a00, a32, a14, a41, a23, a31, a13, a40, a22, a04, a12, a44, \ - a21, a03, a30, a43, a20, a02, a34, a11, a24, a01, a33, a10, a42 -#define P16 a00, a43, a31, a24, a12, a13, a01, a44, a32, a20, a21, a14, \ - a02, a40, a33, a34, a22, a10, a03, a41, a42, a30, a23, a11, a04 -#define P17 a00, a34, a13, a42, a21, a01, a30, a14, a43, a22, a02, a31, \ - a10, a44, a23, a03, a32, a11, a40, a24, a04, a33, a12, a41, a20 -#define P18 a00, a03, a01, a04, a02, a30, a33, a31, a34, a32, a10, a13, \ - a11, a14, a12, a40, a43, a41, a44, a42, a20, a23, a21, a24, a22 -#define P19 a00, a40, a30, a20, a10, a33, a23, a13, a03, a43, a11, a01, \ - a41, a31, a21, a44, a34, a24, a14, a04, a22, a12, a02, a42, a32 -#define P20 a00, a44, a33, a22, a11, a23, a12, a01, a40, a34, a41, a30, \ - a24, a13, a02, a14, a03, a42, a31, a20, a32, a21, a10, a04, a43 -#define P21 a00, a14, a23, a32, a41, a12, a21, a30, a44, a03, a24, a33, \ - a42, a01, a10, a31, a40, a04, a13, a22, a43, a02, a11, a20, a34 -#define P22 a00, a31, a12, a43, a24, a21, a02, a33, a14, a40, a42, a23, \ - a04, a30, a11, a13, a44, a20, a01, a32, a34, a10, a41, a22, a03 -#define P23 a00, a13, a21, a34, a42, a02, a10, a23, a31, a44, a04, a12, \ - a20, a33, a41, a01, a14, a22, a30, a43, a03, a11, a24, a32, a40 - -#define P1_TO_P0 do { \ - DECL64(t); \ - MOV64(t, a01); \ - MOV64(a01, a30); \ - MOV64(a30, a33); \ - MOV64(a33, a23); \ - MOV64(a23, a12); \ - MOV64(a12, a21); \ - MOV64(a21, a02); \ - MOV64(a02, a10); \ - MOV64(a10, a11); \ - MOV64(a11, a41); \ - MOV64(a41, a24); \ - MOV64(a24, a42); \ - MOV64(a42, a04); \ - MOV64(a04, a20); \ - MOV64(a20, a22); \ - MOV64(a22, a32); \ - MOV64(a32, a43); \ - MOV64(a43, a34); \ - MOV64(a34, a03); \ - MOV64(a03, a40); \ - MOV64(a40, a44); \ - MOV64(a44, a14); \ - MOV64(a14, a31); \ - MOV64(a31, a13); \ - MOV64(a13, t); \ - } while (0) - -#define P2_TO_P0 do { \ - DECL64(t); \ - MOV64(t, a01); \ - MOV64(a01, a33); \ - MOV64(a33, a12); \ - MOV64(a12, a02); \ - MOV64(a02, a11); \ - MOV64(a11, a24); \ - MOV64(a24, a04); \ - MOV64(a04, a22); \ - MOV64(a22, a43); \ - MOV64(a43, a03); \ - MOV64(a03, a44); \ - MOV64(a44, a31); \ - MOV64(a31, t); \ - MOV64(t, a10); \ - MOV64(a10, a41); \ - MOV64(a41, a42); \ - MOV64(a42, a20); \ - MOV64(a20, a32); \ - MOV64(a32, a34); \ - MOV64(a34, a40); \ - MOV64(a40, a14); \ - MOV64(a14, a13); \ - MOV64(a13, a30); \ - MOV64(a30, a23); \ - MOV64(a23, a21); \ - MOV64(a21, t); \ - } while (0) - -#define P4_TO_P0 do { \ - DECL64(t); \ - MOV64(t, a01); \ - MOV64(a01, a12); \ - MOV64(a12, a11); \ - MOV64(a11, a04); \ - MOV64(a04, a43); \ - MOV64(a43, a44); \ - MOV64(a44, t); \ - MOV64(t, a02); \ - MOV64(a02, a24); \ - MOV64(a24, a22); \ - MOV64(a22, a03); \ - MOV64(a03, a31); \ - MOV64(a31, a33); \ - MOV64(a33, t); \ - MOV64(t, a10); \ - MOV64(a10, a42); \ - MOV64(a42, a32); \ - MOV64(a32, a40); \ - MOV64(a40, a13); \ - MOV64(a13, a23); \ - MOV64(a23, t); \ - MOV64(t, a14); \ - MOV64(a14, a30); \ - MOV64(a30, a21); \ - MOV64(a21, a41); \ - MOV64(a41, a20); \ - MOV64(a20, a34); \ - MOV64(a34, t); \ - } while (0) - -#define P6_TO_P0 do { \ - DECL64(t); \ - MOV64(t, a01); \ - MOV64(a01, a02); \ - MOV64(a02, a04); \ - MOV64(a04, a03); \ - MOV64(a03, t); \ - MOV64(t, a10); \ - MOV64(a10, a20); \ - MOV64(a20, a40); \ - MOV64(a40, a30); \ - MOV64(a30, t); \ - MOV64(t, a11); \ - MOV64(a11, a22); \ - MOV64(a22, a44); \ - MOV64(a44, a33); \ - MOV64(a33, t); \ - MOV64(t, a12); \ - MOV64(a12, a24); \ - MOV64(a24, a43); \ - MOV64(a43, a31); \ - MOV64(a31, t); \ - MOV64(t, a13); \ - MOV64(a13, a21); \ - MOV64(a21, a42); \ - MOV64(a42, a34); \ - MOV64(a34, t); \ - MOV64(t, a14); \ - MOV64(a14, a23); \ - MOV64(a23, a41); \ - MOV64(a41, a32); \ - MOV64(a32, t); \ - } while (0) - -#define P8_TO_P0 do { \ - DECL64(t); \ - MOV64(t, a01); \ - MOV64(a01, a11); \ - MOV64(a11, a43); \ - MOV64(a43, t); \ - MOV64(t, a02); \ - MOV64(a02, a22); \ - MOV64(a22, a31); \ - MOV64(a31, t); \ - MOV64(t, a03); \ - MOV64(a03, a33); \ - MOV64(a33, a24); \ - MOV64(a24, t); \ - MOV64(t, a04); \ - MOV64(a04, a44); \ - MOV64(a44, a12); \ - MOV64(a12, t); \ - MOV64(t, a10); \ - MOV64(a10, a32); \ - MOV64(a32, a13); \ - MOV64(a13, t); \ - MOV64(t, a14); \ - MOV64(a14, a21); \ - MOV64(a21, a20); \ - MOV64(a20, t); \ - MOV64(t, a23); \ - MOV64(a23, a42); \ - MOV64(a42, a40); \ - MOV64(a40, t); \ - MOV64(t, a30); \ - MOV64(a30, a41); \ - MOV64(a41, a34); \ - MOV64(a34, t); \ - } while (0) - -#define P12_TO_P0 do { \ - DECL64(t); \ - MOV64(t, a01); \ - MOV64(a01, a04); \ - MOV64(a04, t); \ - MOV64(t, a02); \ - MOV64(a02, a03); \ - MOV64(a03, t); \ - MOV64(t, a10); \ - MOV64(a10, a40); \ - MOV64(a40, t); \ - MOV64(t, a11); \ - MOV64(a11, a44); \ - MOV64(a44, t); \ - MOV64(t, a12); \ - MOV64(a12, a43); \ - MOV64(a43, t); \ - MOV64(t, a13); \ - MOV64(a13, a42); \ - MOV64(a42, t); \ - MOV64(t, a14); \ - MOV64(a14, a41); \ - MOV64(a41, t); \ - MOV64(t, a20); \ - MOV64(a20, a30); \ - MOV64(a30, t); \ - MOV64(t, a21); \ - MOV64(a21, a34); \ - MOV64(a34, t); \ - MOV64(t, a22); \ - MOV64(a22, a33); \ - MOV64(a33, t); \ - MOV64(t, a23); \ - MOV64(a23, a32); \ - MOV64(a32, t); \ - MOV64(t, a24); \ - MOV64(a24, a31); \ - MOV64(a31, t); \ - } while (0) - -#define LPAR ( -#define RPAR ) - -#define KF_ELT(r, s, k) do { \ - THETA LPAR P ## r RPAR; \ - RHO LPAR P ## r RPAR; \ - KHI LPAR P ## s RPAR; \ - IOTA(k); \ - } while (0) - -#define DO(x) x - -#define KECCAK_F_1600 DO(KECCAK_F_1600_) - -#if SPH_KECCAK_UNROLL == 1 - -#define KECCAK_F_1600_ do { \ - int j; \ - for (j = 0; j < 24; j ++) { \ - KF_ELT( 0, 1, RC[j + 0]); \ - P1_TO_P0; \ - } \ - } while (0) - -#elif SPH_KECCAK_UNROLL == 2 - -#define KECCAK_F_1600_ do { \ - int j; \ - for (j = 0; j < 24; j += 2) { \ - KF_ELT( 0, 1, RC[j + 0]); \ - KF_ELT( 1, 2, RC[j + 1]); \ - P2_TO_P0; \ - } \ - } while (0) - -#elif SPH_KECCAK_UNROLL == 4 - -#define KECCAK_F_1600_ do { \ - int j; \ - for (j = 0; j < 24; j += 4) { \ - KF_ELT( 0, 1, RC[j + 0]); \ - KF_ELT( 1, 2, RC[j + 1]); \ - KF_ELT( 2, 3, RC[j + 2]); \ - KF_ELT( 3, 4, RC[j + 3]); \ - P4_TO_P0; \ - } \ - } while (0) - -#elif SPH_KECCAK_UNROLL == 6 - -#define KECCAK_F_1600_ do { \ - int j; \ - for (j = 0; j < 24; j += 6) { \ - KF_ELT( 0, 1, RC[j + 0]); \ - KF_ELT( 1, 2, RC[j + 1]); \ - KF_ELT( 2, 3, RC[j + 2]); \ - KF_ELT( 3, 4, RC[j + 3]); \ - KF_ELT( 4, 5, RC[j + 4]); \ - KF_ELT( 5, 6, RC[j + 5]); \ - P6_TO_P0; \ - } \ - } while (0) - -#elif SPH_KECCAK_UNROLL == 8 - -#define KECCAK_F_1600_ do { \ - int j; \ - for (j = 0; j < 24; j += 8) { \ - KF_ELT( 0, 1, RC[j + 0]); \ - KF_ELT( 1, 2, RC[j + 1]); \ - KF_ELT( 2, 3, RC[j + 2]); \ - KF_ELT( 3, 4, RC[j + 3]); \ - KF_ELT( 4, 5, RC[j + 4]); \ - KF_ELT( 5, 6, RC[j + 5]); \ - KF_ELT( 6, 7, RC[j + 6]); \ - KF_ELT( 7, 8, RC[j + 7]); \ - P8_TO_P0; \ - } \ - } while (0) - -#elif SPH_KECCAK_UNROLL == 12 - -#define KECCAK_F_1600_ do { \ - int j; \ - for (j = 0; j < 24; j += 12) { \ - KF_ELT( 0, 1, RC[j + 0]); \ - KF_ELT( 1, 2, RC[j + 1]); \ - KF_ELT( 2, 3, RC[j + 2]); \ - KF_ELT( 3, 4, RC[j + 3]); \ - KF_ELT( 4, 5, RC[j + 4]); \ - KF_ELT( 5, 6, RC[j + 5]); \ - KF_ELT( 6, 7, RC[j + 6]); \ - KF_ELT( 7, 8, RC[j + 7]); \ - KF_ELT( 8, 9, RC[j + 8]); \ - KF_ELT( 9, 10, RC[j + 9]); \ - KF_ELT(10, 11, RC[j + 10]); \ - KF_ELT(11, 12, RC[j + 11]); \ - P12_TO_P0; \ - } \ - } while (0) - -#elif SPH_KECCAK_UNROLL == 0 - -#define KECCAK_F_1600_ do { \ - KF_ELT( 0, 1, RC[ 0]); \ - KF_ELT( 1, 2, RC[ 1]); \ - KF_ELT( 2, 3, RC[ 2]); \ - KF_ELT( 3, 4, RC[ 3]); \ - KF_ELT( 4, 5, RC[ 4]); \ - KF_ELT( 5, 6, RC[ 5]); \ - KF_ELT( 6, 7, RC[ 6]); \ - KF_ELT( 7, 8, RC[ 7]); \ - KF_ELT( 8, 9, RC[ 8]); \ - KF_ELT( 9, 10, RC[ 9]); \ - KF_ELT(10, 11, RC[10]); \ - KF_ELT(11, 12, RC[11]); \ - KF_ELT(12, 13, RC[12]); \ - KF_ELT(13, 14, RC[13]); \ - KF_ELT(14, 15, RC[14]); \ - KF_ELT(15, 16, RC[15]); \ - KF_ELT(16, 17, RC[16]); \ - KF_ELT(17, 18, RC[17]); \ - KF_ELT(18, 19, RC[18]); \ - KF_ELT(19, 20, RC[19]); \ - KF_ELT(20, 21, RC[20]); \ - KF_ELT(21, 22, RC[21]); \ - KF_ELT(22, 23, RC[22]); \ - KF_ELT(23, 0, RC[23]); \ - } while (0) - -#else - -#error Unimplemented unroll count for Keccak. - -#endif - -static void -keccak_init(sph_keccak_context *kc, unsigned out_size) -{ - int i; - -#if SPH_KECCAK_64 - for (i = 0; i < 25; i ++) - kc->u.wide[i] = 0; - /* - * Initialization for the "lane complement". - */ - kc->u.wide[ 1] = SPH_C64(0xFFFFFFFFFFFFFFFF); - kc->u.wide[ 2] = SPH_C64(0xFFFFFFFFFFFFFFFF); - kc->u.wide[ 8] = SPH_C64(0xFFFFFFFFFFFFFFFF); - kc->u.wide[12] = SPH_C64(0xFFFFFFFFFFFFFFFF); - kc->u.wide[17] = SPH_C64(0xFFFFFFFFFFFFFFFF); - kc->u.wide[20] = SPH_C64(0xFFFFFFFFFFFFFFFF); -#else - - for (i = 0; i < 50; i ++) - kc->u.narrow[i] = 0; - /* - * Initialization for the "lane complement". - * Note: since we set to all-one full 64-bit words, - * interleaving (if applicable) is a no-op. - */ - kc->u.narrow[ 2] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[ 3] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[ 4] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[ 5] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[16] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[17] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[24] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[25] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[34] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[35] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[40] = SPH_C32(0xFFFFFFFF); - kc->u.narrow[41] = SPH_C32(0xFFFFFFFF); -#endif - kc->ptr = 0; - kc->lim = 200 - (out_size >> 2); -} - -static void -keccak_core(sph_keccak_context *kc, const void *data, size_t len, size_t lim) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE - - buf = kc->buf; - ptr = kc->ptr; - - if (len < (lim - ptr)) { - memcpy(buf + ptr, data, len); - kc->ptr = ptr + len; - return; - } - - READ_STATE(kc); - while (len > 0) { - size_t clen; - - clen = (lim - ptr); - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == lim) { - INPUT_BUF(lim); - KECCAK_F_1600; - ptr = 0; - } - } - WRITE_STATE(kc); - kc->ptr = ptr; -} - -#if SPH_KECCAK_64 - -#define DEFCLOSE(d, lim) \ - static void keccak_close ## d( \ - sph_keccak_context *kc, unsigned ub, unsigned n, void *dst) \ - { \ - unsigned eb; \ - union { \ - unsigned char tmp[lim + 1]; \ - sph_u64 dummy; /* for alignment */ \ - } u; \ - size_t j; \ - \ - eb = (0x100 | (ub & 0xFF)) >> (8 - n); \ - if (kc->ptr == (lim - 1)) { \ - if (n == 7) { \ - u.tmp[0] = eb; \ - memset(u.tmp + 1, 0, lim - 1); \ - u.tmp[lim] = 0x80; \ - j = 1 + lim; \ - } else { \ - u.tmp[0] = eb | 0x80; \ - j = 1; \ - } \ - } else { \ - j = lim - kc->ptr; \ - u.tmp[0] = eb; \ - memset(u.tmp + 1, 0, j - 2); \ - u.tmp[j - 1] = 0x80; \ - } \ - keccak_core(kc, u.tmp, j, lim); \ - /* Finalize the "lane complement" */ \ - kc->u.wide[ 1] = ~kc->u.wide[ 1]; \ - kc->u.wide[ 2] = ~kc->u.wide[ 2]; \ - kc->u.wide[ 8] = ~kc->u.wide[ 8]; \ - kc->u.wide[12] = ~kc->u.wide[12]; \ - kc->u.wide[17] = ~kc->u.wide[17]; \ - kc->u.wide[20] = ~kc->u.wide[20]; \ - for (j = 0; j < d; j += 8) \ - sph_enc64le_aligned(u.tmp + j, kc->u.wide[j >> 3]); \ - memcpy(dst, u.tmp, d); \ - keccak_init(kc, (unsigned)d << 3); \ - } \ - -#else - -#define DEFCLOSE(d, lim) \ - static void keccak_close ## d( \ - sph_keccak_context *kc, unsigned ub, unsigned n, void *dst) \ - { \ - unsigned eb; \ - union { \ - unsigned char tmp[lim + 1]; \ - sph_u64 dummy; /* for alignment */ \ - } u; \ - size_t j; \ - \ - eb = (0x100 | (ub & 0xFF)) >> (8 - n); \ - if (kc->ptr == (lim - 1)) { \ - if (n == 7) { \ - u.tmp[0] = eb; \ - memset(u.tmp + 1, 0, lim - 1); \ - u.tmp[lim] = 0x80; \ - j = 1 + lim; \ - } else { \ - u.tmp[0] = eb | 0x80; \ - j = 1; \ - } \ - } else { \ - j = lim - kc->ptr; \ - u.tmp[0] = eb; \ - memset(u.tmp + 1, 0, j - 2); \ - u.tmp[j - 1] = 0x80; \ - } \ - keccak_core(kc, u.tmp, j, lim); \ - /* Finalize the "lane complement" */ \ - kc->u.narrow[ 2] = ~kc->u.narrow[ 2]; \ - kc->u.narrow[ 3] = ~kc->u.narrow[ 3]; \ - kc->u.narrow[ 4] = ~kc->u.narrow[ 4]; \ - kc->u.narrow[ 5] = ~kc->u.narrow[ 5]; \ - kc->u.narrow[16] = ~kc->u.narrow[16]; \ - kc->u.narrow[17] = ~kc->u.narrow[17]; \ - kc->u.narrow[24] = ~kc->u.narrow[24]; \ - kc->u.narrow[25] = ~kc->u.narrow[25]; \ - kc->u.narrow[34] = ~kc->u.narrow[34]; \ - kc->u.narrow[35] = ~kc->u.narrow[35]; \ - kc->u.narrow[40] = ~kc->u.narrow[40]; \ - kc->u.narrow[41] = ~kc->u.narrow[41]; \ - /* un-interleave */ \ - for (j = 0; j < 50; j += 2) \ - UNINTERLEAVE(kc->u.narrow[j], kc->u.narrow[j + 1]); \ - for (j = 0; j < d; j += 4) \ - sph_enc32le_aligned(u.tmp + j, kc->u.narrow[j >> 2]); \ - memcpy(dst, u.tmp, d); \ - keccak_init(kc, (unsigned)d << 3); \ - } \ - -#endif - -DEFCLOSE(28, 144) -DEFCLOSE(32, 136) -DEFCLOSE(48, 104) -DEFCLOSE(64, 72) - -/* see sph_keccak.h */ -void -sph_keccak224_init(void *cc) -{ - keccak_init(cc, 224); -} - -/* see sph_keccak.h */ -void -sph_keccak224(void *cc, const void *data, size_t len) -{ - keccak_core(cc, data, len, 144); -} - -/* see sph_keccak.h */ -void -sph_keccak224_close(void *cc, void *dst) -{ - sph_keccak224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - keccak_close28(cc, ub, n, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak256_init(void *cc) -{ - keccak_init(cc, 256); -} - -/* see sph_keccak.h */ -void -sph_keccak256(void *cc, const void *data, size_t len) -{ - keccak_core(cc, data, len, 136); -} - -/* see sph_keccak.h */ -void -sph_keccak256_close(void *cc, void *dst) -{ - sph_keccak256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - keccak_close32(cc, ub, n, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak384_init(void *cc) -{ - keccak_init(cc, 384); -} - -/* see sph_keccak.h */ -void -sph_keccak384(void *cc, const void *data, size_t len) -{ - keccak_core(cc, data, len, 104); -} - -/* see sph_keccak.h */ -void -sph_keccak384_close(void *cc, void *dst) -{ - sph_keccak384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - keccak_close48(cc, ub, n, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak512_init(void *cc) -{ - keccak_init(cc, 512); -} - -/* see sph_keccak.h */ -void -sph_keccak512(void *cc, const void *data, size_t len) -{ - keccak_core(cc, data, len, 72); -} - -/* see sph_keccak.h */ -void -sph_keccak512_close(void *cc, void *dst) -{ - sph_keccak512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_keccak.h */ -void -sph_keccak512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - keccak_close64(cc, ub, n, dst); -} - - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/luffa.c b/src/crypto/luffa.c deleted file mode 100644 index a761bea0a..000000000 --- a/src/crypto/luffa.c +++ /dev/null @@ -1,1426 +0,0 @@ -/* $Id: luffa.c 219 2010-06-08 17:24:41Z tp $ */ -/* - * Luffa implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_luffa.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_64_TRUE && !defined SPH_LUFFA_PARALLEL -#define SPH_LUFFA_PARALLEL 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -static const sph_u32 V_INIT[5][8] = { - { - SPH_C32(0x6d251e69), SPH_C32(0x44b051e0), - SPH_C32(0x4eaa6fb4), SPH_C32(0xdbf78465), - SPH_C32(0x6e292011), SPH_C32(0x90152df4), - SPH_C32(0xee058139), SPH_C32(0xdef610bb) - }, { - SPH_C32(0xc3b44b95), SPH_C32(0xd9d2f256), - SPH_C32(0x70eee9a0), SPH_C32(0xde099fa3), - SPH_C32(0x5d9b0557), SPH_C32(0x8fc944b3), - SPH_C32(0xcf1ccf0e), SPH_C32(0x746cd581) - }, { - SPH_C32(0xf7efc89d), SPH_C32(0x5dba5781), - SPH_C32(0x04016ce5), SPH_C32(0xad659c05), - SPH_C32(0x0306194f), SPH_C32(0x666d1836), - SPH_C32(0x24aa230a), SPH_C32(0x8b264ae7) - }, { - SPH_C32(0x858075d5), SPH_C32(0x36d79cce), - SPH_C32(0xe571f7d7), SPH_C32(0x204b1f67), - SPH_C32(0x35870c6a), SPH_C32(0x57e9e923), - SPH_C32(0x14bcb808), SPH_C32(0x7cde72ce) - }, { - SPH_C32(0x6c68e9be), SPH_C32(0x5ec41e22), - SPH_C32(0xc825b7c7), SPH_C32(0xaffb4363), - SPH_C32(0xf5df3999), SPH_C32(0x0fc688f1), - SPH_C32(0xb07224cc), SPH_C32(0x03e86cea) - } -}; - -static const sph_u32 RC00[8] = { - SPH_C32(0x303994a6), SPH_C32(0xc0e65299), - SPH_C32(0x6cc33a12), SPH_C32(0xdc56983e), - SPH_C32(0x1e00108f), SPH_C32(0x7800423d), - SPH_C32(0x8f5b7882), SPH_C32(0x96e1db12) -}; - -static const sph_u32 RC04[8] = { - SPH_C32(0xe0337818), SPH_C32(0x441ba90d), - SPH_C32(0x7f34d442), SPH_C32(0x9389217f), - SPH_C32(0xe5a8bce6), SPH_C32(0x5274baf4), - SPH_C32(0x26889ba7), SPH_C32(0x9a226e9d) -}; - -static const sph_u32 RC10[8] = { - SPH_C32(0xb6de10ed), SPH_C32(0x70f47aae), - SPH_C32(0x0707a3d4), SPH_C32(0x1c1e8f51), - SPH_C32(0x707a3d45), SPH_C32(0xaeb28562), - SPH_C32(0xbaca1589), SPH_C32(0x40a46f3e) -}; - -static const sph_u32 RC14[8] = { - SPH_C32(0x01685f3d), SPH_C32(0x05a17cf4), - SPH_C32(0xbd09caca), SPH_C32(0xf4272b28), - SPH_C32(0x144ae5cc), SPH_C32(0xfaa7ae2b), - SPH_C32(0x2e48f1c1), SPH_C32(0xb923c704) -}; - -#if SPH_LUFFA_PARALLEL - -static const sph_u64 RCW010[8] = { - SPH_C64(0xb6de10ed303994a6), SPH_C64(0x70f47aaec0e65299), - SPH_C64(0x0707a3d46cc33a12), SPH_C64(0x1c1e8f51dc56983e), - SPH_C64(0x707a3d451e00108f), SPH_C64(0xaeb285627800423d), - SPH_C64(0xbaca15898f5b7882), SPH_C64(0x40a46f3e96e1db12) -}; - -static const sph_u64 RCW014[8] = { - SPH_C64(0x01685f3de0337818), SPH_C64(0x05a17cf4441ba90d), - SPH_C64(0xbd09caca7f34d442), SPH_C64(0xf4272b289389217f), - SPH_C64(0x144ae5cce5a8bce6), SPH_C64(0xfaa7ae2b5274baf4), - SPH_C64(0x2e48f1c126889ba7), SPH_C64(0xb923c7049a226e9d) -}; - -#endif - -static const sph_u32 RC20[8] = { - SPH_C32(0xfc20d9d2), SPH_C32(0x34552e25), - SPH_C32(0x7ad8818f), SPH_C32(0x8438764a), - SPH_C32(0xbb6de032), SPH_C32(0xedb780c8), - SPH_C32(0xd9847356), SPH_C32(0xa2c78434) -}; - -static const sph_u32 RC24[8] = { - SPH_C32(0xe25e72c1), SPH_C32(0xe623bb72), - SPH_C32(0x5c58a4a4), SPH_C32(0x1e38e2e7), - SPH_C32(0x78e38b9d), SPH_C32(0x27586719), - SPH_C32(0x36eda57f), SPH_C32(0x703aace7) -}; - -static const sph_u32 RC30[8] = { - SPH_C32(0xb213afa5), SPH_C32(0xc84ebe95), - SPH_C32(0x4e608a22), SPH_C32(0x56d858fe), - SPH_C32(0x343b138f), SPH_C32(0xd0ec4e3d), - SPH_C32(0x2ceb4882), SPH_C32(0xb3ad2208) -}; - -static const sph_u32 RC34[8] = { - SPH_C32(0xe028c9bf), SPH_C32(0x44756f91), - SPH_C32(0x7e8fce32), SPH_C32(0x956548be), - SPH_C32(0xfe191be2), SPH_C32(0x3cb226e5), - SPH_C32(0x5944a28e), SPH_C32(0xa1c4c355) -}; - -#if SPH_LUFFA_PARALLEL - -static const sph_u64 RCW230[8] = { - SPH_C64(0xb213afa5fc20d9d2), SPH_C64(0xc84ebe9534552e25), - SPH_C64(0x4e608a227ad8818f), SPH_C64(0x56d858fe8438764a), - SPH_C64(0x343b138fbb6de032), SPH_C64(0xd0ec4e3dedb780c8), - SPH_C64(0x2ceb4882d9847356), SPH_C64(0xb3ad2208a2c78434) -}; - - -static const sph_u64 RCW234[8] = { - SPH_C64(0xe028c9bfe25e72c1), SPH_C64(0x44756f91e623bb72), - SPH_C64(0x7e8fce325c58a4a4), SPH_C64(0x956548be1e38e2e7), - SPH_C64(0xfe191be278e38b9d), SPH_C64(0x3cb226e527586719), - SPH_C64(0x5944a28e36eda57f), SPH_C64(0xa1c4c355703aace7) -}; - -#endif - -static const sph_u32 RC40[8] = { - SPH_C32(0xf0d2e9e3), SPH_C32(0xac11d7fa), - SPH_C32(0x1bcb66f2), SPH_C32(0x6f2d9bc9), - SPH_C32(0x78602649), SPH_C32(0x8edae952), - SPH_C32(0x3b6ba548), SPH_C32(0xedae9520) -}; - -static const sph_u32 RC44[8] = { - SPH_C32(0x5090d577), SPH_C32(0x2d1925ab), - SPH_C32(0xb46496ac), SPH_C32(0xd1925ab0), - SPH_C32(0x29131ab6), SPH_C32(0x0fc053c3), - SPH_C32(0x3f014f0c), SPH_C32(0xfc053c31) -}; - -#define DECL_TMP8(w) \ - sph_u32 w ## 0, w ## 1, w ## 2, w ## 3, w ## 4, w ## 5, w ## 6, w ## 7; - -#define M2(d, s) do { \ - sph_u32 tmp = s ## 7; \ - d ## 7 = s ## 6; \ - d ## 6 = s ## 5; \ - d ## 5 = s ## 4; \ - d ## 4 = s ## 3 ^ tmp; \ - d ## 3 = s ## 2 ^ tmp; \ - d ## 2 = s ## 1; \ - d ## 1 = s ## 0 ^ tmp; \ - d ## 0 = tmp; \ - } while (0) - -#define XOR(d, s1, s2) do { \ - d ## 0 = s1 ## 0 ^ s2 ## 0; \ - d ## 1 = s1 ## 1 ^ s2 ## 1; \ - d ## 2 = s1 ## 2 ^ s2 ## 2; \ - d ## 3 = s1 ## 3 ^ s2 ## 3; \ - d ## 4 = s1 ## 4 ^ s2 ## 4; \ - d ## 5 = s1 ## 5 ^ s2 ## 5; \ - d ## 6 = s1 ## 6 ^ s2 ## 6; \ - d ## 7 = s1 ## 7 ^ s2 ## 7; \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define SUB_CRUMB_GEN(a0, a1, a2, a3, width) do { \ - sph_u ## width tmp; \ - tmp = (a0); \ - (a0) |= (a1); \ - (a2) ^= (a3); \ - (a1) = SPH_T ## width(~(a1)); \ - (a0) ^= (a3); \ - (a3) &= tmp; \ - (a1) ^= (a3); \ - (a3) ^= (a2); \ - (a2) &= (a0); \ - (a0) = SPH_T ## width(~(a0)); \ - (a2) ^= (a1); \ - (a1) |= (a3); \ - tmp ^= (a1); \ - (a3) ^= (a2); \ - (a2) &= (a1); \ - (a1) ^= (a0); \ - (a0) = tmp; \ - } while (0) - -#define SUB_CRUMB(a0, a1, a2, a3) SUB_CRUMB_GEN(a0, a1, a2, a3, 32) -#define SUB_CRUMBW(a0, a1, a2, a3) SUB_CRUMB_GEN(a0, a1, a2, a3, 64) - - -#if 0 - -#define ROL32W(x, n) SPH_T64( \ - (((x) << (n)) \ - & ~((SPH_C64(0xFFFFFFFF) >> (32 - (n))) << 32)) \ - | (((x) >> (32 - (n))) \ - & ~((SPH_C64(0xFFFFFFFF) >> (n)) << (n)))) - -#define MIX_WORDW(u, v) do { \ - (v) ^= (u); \ - (u) = ROL32W((u), 2) ^ (v); \ - (v) = ROL32W((v), 14) ^ (u); \ - (u) = ROL32W((u), 10) ^ (v); \ - (v) = ROL32W((v), 1); \ - } while (0) - -#endif - -#define MIX_WORDW(u, v) do { \ - sph_u32 ul, uh, vl, vh; \ - (v) ^= (u); \ - ul = SPH_T32((sph_u32)(u)); \ - uh = SPH_T32((sph_u32)((u) >> 32)); \ - vl = SPH_T32((sph_u32)(v)); \ - vh = SPH_T32((sph_u32)((v) >> 32)); \ - ul = SPH_ROTL32(ul, 2) ^ vl; \ - vl = SPH_ROTL32(vl, 14) ^ ul; \ - ul = SPH_ROTL32(ul, 10) ^ vl; \ - vl = SPH_ROTL32(vl, 1); \ - uh = SPH_ROTL32(uh, 2) ^ vh; \ - vh = SPH_ROTL32(vh, 14) ^ uh; \ - uh = SPH_ROTL32(uh, 10) ^ vh; \ - vh = SPH_ROTL32(vh, 1); \ - (u) = (sph_u64)ul | ((sph_u64)uh << 32); \ - (v) = (sph_u64)vl | ((sph_u64)vh << 32); \ - } while (0) - -#else - -#define SUB_CRUMB(a0, a1, a2, a3) do { \ - sph_u32 tmp; \ - tmp = (a0); \ - (a0) |= (a1); \ - (a2) ^= (a3); \ - (a1) = SPH_T32(~(a1)); \ - (a0) ^= (a3); \ - (a3) &= tmp; \ - (a1) ^= (a3); \ - (a3) ^= (a2); \ - (a2) &= (a0); \ - (a0) = SPH_T32(~(a0)); \ - (a2) ^= (a1); \ - (a1) |= (a3); \ - tmp ^= (a1); \ - (a3) ^= (a2); \ - (a2) &= (a1); \ - (a1) ^= (a0); \ - (a0) = tmp; \ - } while (0) - -#endif - -#define MIX_WORD(u, v) do { \ - (v) ^= (u); \ - (u) = SPH_ROTL32((u), 2) ^ (v); \ - (v) = SPH_ROTL32((v), 14) ^ (u); \ - (u) = SPH_ROTL32((u), 10) ^ (v); \ - (v) = SPH_ROTL32((v), 1); \ - } while (0) - -#define DECL_STATE3 \ - sph_u32 V00, V01, V02, V03, V04, V05, V06, V07; \ - sph_u32 V10, V11, V12, V13, V14, V15, V16, V17; \ - sph_u32 V20, V21, V22, V23, V24, V25, V26, V27; - -#define READ_STATE3(state) do { \ - V00 = (state)->V[0][0]; \ - V01 = (state)->V[0][1]; \ - V02 = (state)->V[0][2]; \ - V03 = (state)->V[0][3]; \ - V04 = (state)->V[0][4]; \ - V05 = (state)->V[0][5]; \ - V06 = (state)->V[0][6]; \ - V07 = (state)->V[0][7]; \ - V10 = (state)->V[1][0]; \ - V11 = (state)->V[1][1]; \ - V12 = (state)->V[1][2]; \ - V13 = (state)->V[1][3]; \ - V14 = (state)->V[1][4]; \ - V15 = (state)->V[1][5]; \ - V16 = (state)->V[1][6]; \ - V17 = (state)->V[1][7]; \ - V20 = (state)->V[2][0]; \ - V21 = (state)->V[2][1]; \ - V22 = (state)->V[2][2]; \ - V23 = (state)->V[2][3]; \ - V24 = (state)->V[2][4]; \ - V25 = (state)->V[2][5]; \ - V26 = (state)->V[2][6]; \ - V27 = (state)->V[2][7]; \ - } while (0) - -#define WRITE_STATE3(state) do { \ - (state)->V[0][0] = V00; \ - (state)->V[0][1] = V01; \ - (state)->V[0][2] = V02; \ - (state)->V[0][3] = V03; \ - (state)->V[0][4] = V04; \ - (state)->V[0][5] = V05; \ - (state)->V[0][6] = V06; \ - (state)->V[0][7] = V07; \ - (state)->V[1][0] = V10; \ - (state)->V[1][1] = V11; \ - (state)->V[1][2] = V12; \ - (state)->V[1][3] = V13; \ - (state)->V[1][4] = V14; \ - (state)->V[1][5] = V15; \ - (state)->V[1][6] = V16; \ - (state)->V[1][7] = V17; \ - (state)->V[2][0] = V20; \ - (state)->V[2][1] = V21; \ - (state)->V[2][2] = V22; \ - (state)->V[2][3] = V23; \ - (state)->V[2][4] = V24; \ - (state)->V[2][5] = V25; \ - (state)->V[2][6] = V26; \ - (state)->V[2][7] = V27; \ - } while (0) - -#define MI3 do { \ - DECL_TMP8(M) \ - DECL_TMP8(a) \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - XOR(a, V0, V1); \ - XOR(a, a, V2); \ - M2(a, a); \ - XOR(V0, a, V0); \ - XOR(V0, M, V0); \ - M2(M, M); \ - XOR(V1, a, V1); \ - XOR(V1, M, V1); \ - M2(M, M); \ - XOR(V2, a, V2); \ - XOR(V2, M, V2); \ - } while (0) - -#define TWEAK3 do { \ - V14 = SPH_ROTL32(V14, 1); \ - V15 = SPH_ROTL32(V15, 1); \ - V16 = SPH_ROTL32(V16, 1); \ - V17 = SPH_ROTL32(V17, 1); \ - V24 = SPH_ROTL32(V24, 2); \ - V25 = SPH_ROTL32(V25, 2); \ - V26 = SPH_ROTL32(V26, 2); \ - V27 = SPH_ROTL32(V27, 2); \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define P3 do { \ - int r; \ - sph_u64 W0, W1, W2, W3, W4, W5, W6, W7; \ - TWEAK3; \ - W0 = (sph_u64)V00 | ((sph_u64)V10 << 32); \ - W1 = (sph_u64)V01 | ((sph_u64)V11 << 32); \ - W2 = (sph_u64)V02 | ((sph_u64)V12 << 32); \ - W3 = (sph_u64)V03 | ((sph_u64)V13 << 32); \ - W4 = (sph_u64)V04 | ((sph_u64)V14 << 32); \ - W5 = (sph_u64)V05 | ((sph_u64)V15 << 32); \ - W6 = (sph_u64)V06 | ((sph_u64)V16 << 32); \ - W7 = (sph_u64)V07 | ((sph_u64)V17 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW010[r]; \ - W4 ^= RCW014[r]; \ - } \ - V00 = SPH_T32((sph_u32)W0); \ - V10 = SPH_T32((sph_u32)(W0 >> 32)); \ - V01 = SPH_T32((sph_u32)W1); \ - V11 = SPH_T32((sph_u32)(W1 >> 32)); \ - V02 = SPH_T32((sph_u32)W2); \ - V12 = SPH_T32((sph_u32)(W2 >> 32)); \ - V03 = SPH_T32((sph_u32)W3); \ - V13 = SPH_T32((sph_u32)(W3 >> 32)); \ - V04 = SPH_T32((sph_u32)W4); \ - V14 = SPH_T32((sph_u32)(W4 >> 32)); \ - V05 = SPH_T32((sph_u32)W5); \ - V15 = SPH_T32((sph_u32)(W5 >> 32)); \ - V06 = SPH_T32((sph_u32)W6); \ - V16 = SPH_T32((sph_u32)(W6 >> 32)); \ - V07 = SPH_T32((sph_u32)W7); \ - V17 = SPH_T32((sph_u32)(W7 >> 32)); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - } while (0) - -#else - -#define P3 do { \ - int r; \ - TWEAK3; \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V00, V01, V02, V03); \ - SUB_CRUMB(V05, V06, V07, V04); \ - MIX_WORD(V00, V04); \ - MIX_WORD(V01, V05); \ - MIX_WORD(V02, V06); \ - MIX_WORD(V03, V07); \ - V00 ^= RC00[r]; \ - V04 ^= RC04[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V10, V11, V12, V13); \ - SUB_CRUMB(V15, V16, V17, V14); \ - MIX_WORD(V10, V14); \ - MIX_WORD(V11, V15); \ - MIX_WORD(V12, V16); \ - MIX_WORD(V13, V17); \ - V10 ^= RC10[r]; \ - V14 ^= RC14[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - } while (0) - -#endif - -#define DECL_STATE4 \ - sph_u32 V00, V01, V02, V03, V04, V05, V06, V07; \ - sph_u32 V10, V11, V12, V13, V14, V15, V16, V17; \ - sph_u32 V20, V21, V22, V23, V24, V25, V26, V27; \ - sph_u32 V30, V31, V32, V33, V34, V35, V36, V37; - -#define READ_STATE4(state) do { \ - V00 = (state)->V[0][0]; \ - V01 = (state)->V[0][1]; \ - V02 = (state)->V[0][2]; \ - V03 = (state)->V[0][3]; \ - V04 = (state)->V[0][4]; \ - V05 = (state)->V[0][5]; \ - V06 = (state)->V[0][6]; \ - V07 = (state)->V[0][7]; \ - V10 = (state)->V[1][0]; \ - V11 = (state)->V[1][1]; \ - V12 = (state)->V[1][2]; \ - V13 = (state)->V[1][3]; \ - V14 = (state)->V[1][4]; \ - V15 = (state)->V[1][5]; \ - V16 = (state)->V[1][6]; \ - V17 = (state)->V[1][7]; \ - V20 = (state)->V[2][0]; \ - V21 = (state)->V[2][1]; \ - V22 = (state)->V[2][2]; \ - V23 = (state)->V[2][3]; \ - V24 = (state)->V[2][4]; \ - V25 = (state)->V[2][5]; \ - V26 = (state)->V[2][6]; \ - V27 = (state)->V[2][7]; \ - V30 = (state)->V[3][0]; \ - V31 = (state)->V[3][1]; \ - V32 = (state)->V[3][2]; \ - V33 = (state)->V[3][3]; \ - V34 = (state)->V[3][4]; \ - V35 = (state)->V[3][5]; \ - V36 = (state)->V[3][6]; \ - V37 = (state)->V[3][7]; \ - } while (0) - -#define WRITE_STATE4(state) do { \ - (state)->V[0][0] = V00; \ - (state)->V[0][1] = V01; \ - (state)->V[0][2] = V02; \ - (state)->V[0][3] = V03; \ - (state)->V[0][4] = V04; \ - (state)->V[0][5] = V05; \ - (state)->V[0][6] = V06; \ - (state)->V[0][7] = V07; \ - (state)->V[1][0] = V10; \ - (state)->V[1][1] = V11; \ - (state)->V[1][2] = V12; \ - (state)->V[1][3] = V13; \ - (state)->V[1][4] = V14; \ - (state)->V[1][5] = V15; \ - (state)->V[1][6] = V16; \ - (state)->V[1][7] = V17; \ - (state)->V[2][0] = V20; \ - (state)->V[2][1] = V21; \ - (state)->V[2][2] = V22; \ - (state)->V[2][3] = V23; \ - (state)->V[2][4] = V24; \ - (state)->V[2][5] = V25; \ - (state)->V[2][6] = V26; \ - (state)->V[2][7] = V27; \ - (state)->V[3][0] = V30; \ - (state)->V[3][1] = V31; \ - (state)->V[3][2] = V32; \ - (state)->V[3][3] = V33; \ - (state)->V[3][4] = V34; \ - (state)->V[3][5] = V35; \ - (state)->V[3][6] = V36; \ - (state)->V[3][7] = V37; \ - } while (0) - -#define MI4 do { \ - DECL_TMP8(M) \ - DECL_TMP8(a) \ - DECL_TMP8(b) \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - XOR(a, V0, V1); \ - XOR(b, V2, V3); \ - XOR(a, a, b); \ - M2(a, a); \ - XOR(V0, a, V0); \ - XOR(V1, a, V1); \ - XOR(V2, a, V2); \ - XOR(V3, a, V3); \ - M2(b, V0); \ - XOR(b, b, V3); \ - M2(V3, V3); \ - XOR(V3, V3, V2); \ - M2(V2, V2); \ - XOR(V2, V2, V1); \ - M2(V1, V1); \ - XOR(V1, V1, V0); \ - XOR(V0, b, M); \ - M2(M, M); \ - XOR(V1, V1, M); \ - M2(M, M); \ - XOR(V2, V2, M); \ - M2(M, M); \ - XOR(V3, V3, M); \ - } while (0) - -#define TWEAK4 do { \ - V14 = SPH_ROTL32(V14, 1); \ - V15 = SPH_ROTL32(V15, 1); \ - V16 = SPH_ROTL32(V16, 1); \ - V17 = SPH_ROTL32(V17, 1); \ - V24 = SPH_ROTL32(V24, 2); \ - V25 = SPH_ROTL32(V25, 2); \ - V26 = SPH_ROTL32(V26, 2); \ - V27 = SPH_ROTL32(V27, 2); \ - V34 = SPH_ROTL32(V34, 3); \ - V35 = SPH_ROTL32(V35, 3); \ - V36 = SPH_ROTL32(V36, 3); \ - V37 = SPH_ROTL32(V37, 3); \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define P4 do { \ - int r; \ - sph_u64 W0, W1, W2, W3, W4, W5, W6, W7; \ - TWEAK4; \ - W0 = (sph_u64)V00 | ((sph_u64)V10 << 32); \ - W1 = (sph_u64)V01 | ((sph_u64)V11 << 32); \ - W2 = (sph_u64)V02 | ((sph_u64)V12 << 32); \ - W3 = (sph_u64)V03 | ((sph_u64)V13 << 32); \ - W4 = (sph_u64)V04 | ((sph_u64)V14 << 32); \ - W5 = (sph_u64)V05 | ((sph_u64)V15 << 32); \ - W6 = (sph_u64)V06 | ((sph_u64)V16 << 32); \ - W7 = (sph_u64)V07 | ((sph_u64)V17 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW010[r]; \ - W4 ^= RCW014[r]; \ - } \ - V00 = SPH_T32((sph_u32)W0); \ - V10 = SPH_T32((sph_u32)(W0 >> 32)); \ - V01 = SPH_T32((sph_u32)W1); \ - V11 = SPH_T32((sph_u32)(W1 >> 32)); \ - V02 = SPH_T32((sph_u32)W2); \ - V12 = SPH_T32((sph_u32)(W2 >> 32)); \ - V03 = SPH_T32((sph_u32)W3); \ - V13 = SPH_T32((sph_u32)(W3 >> 32)); \ - V04 = SPH_T32((sph_u32)W4); \ - V14 = SPH_T32((sph_u32)(W4 >> 32)); \ - V05 = SPH_T32((sph_u32)W5); \ - V15 = SPH_T32((sph_u32)(W5 >> 32)); \ - V06 = SPH_T32((sph_u32)W6); \ - V16 = SPH_T32((sph_u32)(W6 >> 32)); \ - V07 = SPH_T32((sph_u32)W7); \ - V17 = SPH_T32((sph_u32)(W7 >> 32)); \ - W0 = (sph_u64)V20 | ((sph_u64)V30 << 32); \ - W1 = (sph_u64)V21 | ((sph_u64)V31 << 32); \ - W2 = (sph_u64)V22 | ((sph_u64)V32 << 32); \ - W3 = (sph_u64)V23 | ((sph_u64)V33 << 32); \ - W4 = (sph_u64)V24 | ((sph_u64)V34 << 32); \ - W5 = (sph_u64)V25 | ((sph_u64)V35 << 32); \ - W6 = (sph_u64)V26 | ((sph_u64)V36 << 32); \ - W7 = (sph_u64)V27 | ((sph_u64)V37 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW230[r]; \ - W4 ^= RCW234[r]; \ - } \ - V20 = SPH_T32((sph_u32)W0); \ - V30 = SPH_T32((sph_u32)(W0 >> 32)); \ - V21 = SPH_T32((sph_u32)W1); \ - V31 = SPH_T32((sph_u32)(W1 >> 32)); \ - V22 = SPH_T32((sph_u32)W2); \ - V32 = SPH_T32((sph_u32)(W2 >> 32)); \ - V23 = SPH_T32((sph_u32)W3); \ - V33 = SPH_T32((sph_u32)(W3 >> 32)); \ - V24 = SPH_T32((sph_u32)W4); \ - V34 = SPH_T32((sph_u32)(W4 >> 32)); \ - V25 = SPH_T32((sph_u32)W5); \ - V35 = SPH_T32((sph_u32)(W5 >> 32)); \ - V26 = SPH_T32((sph_u32)W6); \ - V36 = SPH_T32((sph_u32)(W6 >> 32)); \ - V27 = SPH_T32((sph_u32)W7); \ - V37 = SPH_T32((sph_u32)(W7 >> 32)); \ - } while (0) - -#else - -#define P4 do { \ - int r; \ - TWEAK4; \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V00, V01, V02, V03); \ - SUB_CRUMB(V05, V06, V07, V04); \ - MIX_WORD(V00, V04); \ - MIX_WORD(V01, V05); \ - MIX_WORD(V02, V06); \ - MIX_WORD(V03, V07); \ - V00 ^= RC00[r]; \ - V04 ^= RC04[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V10, V11, V12, V13); \ - SUB_CRUMB(V15, V16, V17, V14); \ - MIX_WORD(V10, V14); \ - MIX_WORD(V11, V15); \ - MIX_WORD(V12, V16); \ - MIX_WORD(V13, V17); \ - V10 ^= RC10[r]; \ - V14 ^= RC14[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V30, V31, V32, V33); \ - SUB_CRUMB(V35, V36, V37, V34); \ - MIX_WORD(V30, V34); \ - MIX_WORD(V31, V35); \ - MIX_WORD(V32, V36); \ - MIX_WORD(V33, V37); \ - V30 ^= RC30[r]; \ - V34 ^= RC34[r]; \ - } \ - } while (0) - -#endif - -#define DECL_STATE5 \ - sph_u32 V00, V01, V02, V03, V04, V05, V06, V07; \ - sph_u32 V10, V11, V12, V13, V14, V15, V16, V17; \ - sph_u32 V20, V21, V22, V23, V24, V25, V26, V27; \ - sph_u32 V30, V31, V32, V33, V34, V35, V36, V37; \ - sph_u32 V40, V41, V42, V43, V44, V45, V46, V47; - -#define READ_STATE5(state) do { \ - V00 = (state)->V[0][0]; \ - V01 = (state)->V[0][1]; \ - V02 = (state)->V[0][2]; \ - V03 = (state)->V[0][3]; \ - V04 = (state)->V[0][4]; \ - V05 = (state)->V[0][5]; \ - V06 = (state)->V[0][6]; \ - V07 = (state)->V[0][7]; \ - V10 = (state)->V[1][0]; \ - V11 = (state)->V[1][1]; \ - V12 = (state)->V[1][2]; \ - V13 = (state)->V[1][3]; \ - V14 = (state)->V[1][4]; \ - V15 = (state)->V[1][5]; \ - V16 = (state)->V[1][6]; \ - V17 = (state)->V[1][7]; \ - V20 = (state)->V[2][0]; \ - V21 = (state)->V[2][1]; \ - V22 = (state)->V[2][2]; \ - V23 = (state)->V[2][3]; \ - V24 = (state)->V[2][4]; \ - V25 = (state)->V[2][5]; \ - V26 = (state)->V[2][6]; \ - V27 = (state)->V[2][7]; \ - V30 = (state)->V[3][0]; \ - V31 = (state)->V[3][1]; \ - V32 = (state)->V[3][2]; \ - V33 = (state)->V[3][3]; \ - V34 = (state)->V[3][4]; \ - V35 = (state)->V[3][5]; \ - V36 = (state)->V[3][6]; \ - V37 = (state)->V[3][7]; \ - V40 = (state)->V[4][0]; \ - V41 = (state)->V[4][1]; \ - V42 = (state)->V[4][2]; \ - V43 = (state)->V[4][3]; \ - V44 = (state)->V[4][4]; \ - V45 = (state)->V[4][5]; \ - V46 = (state)->V[4][6]; \ - V47 = (state)->V[4][7]; \ - } while (0) - -#define WRITE_STATE5(state) do { \ - (state)->V[0][0] = V00; \ - (state)->V[0][1] = V01; \ - (state)->V[0][2] = V02; \ - (state)->V[0][3] = V03; \ - (state)->V[0][4] = V04; \ - (state)->V[0][5] = V05; \ - (state)->V[0][6] = V06; \ - (state)->V[0][7] = V07; \ - (state)->V[1][0] = V10; \ - (state)->V[1][1] = V11; \ - (state)->V[1][2] = V12; \ - (state)->V[1][3] = V13; \ - (state)->V[1][4] = V14; \ - (state)->V[1][5] = V15; \ - (state)->V[1][6] = V16; \ - (state)->V[1][7] = V17; \ - (state)->V[2][0] = V20; \ - (state)->V[2][1] = V21; \ - (state)->V[2][2] = V22; \ - (state)->V[2][3] = V23; \ - (state)->V[2][4] = V24; \ - (state)->V[2][5] = V25; \ - (state)->V[2][6] = V26; \ - (state)->V[2][7] = V27; \ - (state)->V[3][0] = V30; \ - (state)->V[3][1] = V31; \ - (state)->V[3][2] = V32; \ - (state)->V[3][3] = V33; \ - (state)->V[3][4] = V34; \ - (state)->V[3][5] = V35; \ - (state)->V[3][6] = V36; \ - (state)->V[3][7] = V37; \ - (state)->V[4][0] = V40; \ - (state)->V[4][1] = V41; \ - (state)->V[4][2] = V42; \ - (state)->V[4][3] = V43; \ - (state)->V[4][4] = V44; \ - (state)->V[4][5] = V45; \ - (state)->V[4][6] = V46; \ - (state)->V[4][7] = V47; \ - } while (0) - -#define MI5 do { \ - DECL_TMP8(M) \ - DECL_TMP8(a) \ - DECL_TMP8(b) \ - M0 = sph_dec32be_aligned(buf + 0); \ - M1 = sph_dec32be_aligned(buf + 4); \ - M2 = sph_dec32be_aligned(buf + 8); \ - M3 = sph_dec32be_aligned(buf + 12); \ - M4 = sph_dec32be_aligned(buf + 16); \ - M5 = sph_dec32be_aligned(buf + 20); \ - M6 = sph_dec32be_aligned(buf + 24); \ - M7 = sph_dec32be_aligned(buf + 28); \ - XOR(a, V0, V1); \ - XOR(b, V2, V3); \ - XOR(a, a, b); \ - XOR(a, a, V4); \ - M2(a, a); \ - XOR(V0, a, V0); \ - XOR(V1, a, V1); \ - XOR(V2, a, V2); \ - XOR(V3, a, V3); \ - XOR(V4, a, V4); \ - M2(b, V0); \ - XOR(b, b, V1); \ - M2(V1, V1); \ - XOR(V1, V1, V2); \ - M2(V2, V2); \ - XOR(V2, V2, V3); \ - M2(V3, V3); \ - XOR(V3, V3, V4); \ - M2(V4, V4); \ - XOR(V4, V4, V0); \ - M2(V0, b); \ - XOR(V0, V0, V4); \ - M2(V4, V4); \ - XOR(V4, V4, V3); \ - M2(V3, V3); \ - XOR(V3, V3, V2); \ - M2(V2, V2); \ - XOR(V2, V2, V1); \ - M2(V1, V1); \ - XOR(V1, V1, b); \ - XOR(V0, V0, M); \ - M2(M, M); \ - XOR(V1, V1, M); \ - M2(M, M); \ - XOR(V2, V2, M); \ - M2(M, M); \ - XOR(V3, V3, M); \ - M2(M, M); \ - XOR(V4, V4, M); \ - } while (0) - -#define TWEAK5 do { \ - V14 = SPH_ROTL32(V14, 1); \ - V15 = SPH_ROTL32(V15, 1); \ - V16 = SPH_ROTL32(V16, 1); \ - V17 = SPH_ROTL32(V17, 1); \ - V24 = SPH_ROTL32(V24, 2); \ - V25 = SPH_ROTL32(V25, 2); \ - V26 = SPH_ROTL32(V26, 2); \ - V27 = SPH_ROTL32(V27, 2); \ - V34 = SPH_ROTL32(V34, 3); \ - V35 = SPH_ROTL32(V35, 3); \ - V36 = SPH_ROTL32(V36, 3); \ - V37 = SPH_ROTL32(V37, 3); \ - V44 = SPH_ROTL32(V44, 4); \ - V45 = SPH_ROTL32(V45, 4); \ - V46 = SPH_ROTL32(V46, 4); \ - V47 = SPH_ROTL32(V47, 4); \ - } while (0) - -#if SPH_LUFFA_PARALLEL - -#define P5 do { \ - int r; \ - sph_u64 W0, W1, W2, W3, W4, W5, W6, W7; \ - TWEAK5; \ - W0 = (sph_u64)V00 | ((sph_u64)V10 << 32); \ - W1 = (sph_u64)V01 | ((sph_u64)V11 << 32); \ - W2 = (sph_u64)V02 | ((sph_u64)V12 << 32); \ - W3 = (sph_u64)V03 | ((sph_u64)V13 << 32); \ - W4 = (sph_u64)V04 | ((sph_u64)V14 << 32); \ - W5 = (sph_u64)V05 | ((sph_u64)V15 << 32); \ - W6 = (sph_u64)V06 | ((sph_u64)V16 << 32); \ - W7 = (sph_u64)V07 | ((sph_u64)V17 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW010[r]; \ - W4 ^= RCW014[r]; \ - } \ - V00 = SPH_T32((sph_u32)W0); \ - V10 = SPH_T32((sph_u32)(W0 >> 32)); \ - V01 = SPH_T32((sph_u32)W1); \ - V11 = SPH_T32((sph_u32)(W1 >> 32)); \ - V02 = SPH_T32((sph_u32)W2); \ - V12 = SPH_T32((sph_u32)(W2 >> 32)); \ - V03 = SPH_T32((sph_u32)W3); \ - V13 = SPH_T32((sph_u32)(W3 >> 32)); \ - V04 = SPH_T32((sph_u32)W4); \ - V14 = SPH_T32((sph_u32)(W4 >> 32)); \ - V05 = SPH_T32((sph_u32)W5); \ - V15 = SPH_T32((sph_u32)(W5 >> 32)); \ - V06 = SPH_T32((sph_u32)W6); \ - V16 = SPH_T32((sph_u32)(W6 >> 32)); \ - V07 = SPH_T32((sph_u32)W7); \ - V17 = SPH_T32((sph_u32)(W7 >> 32)); \ - W0 = (sph_u64)V20 | ((sph_u64)V30 << 32); \ - W1 = (sph_u64)V21 | ((sph_u64)V31 << 32); \ - W2 = (sph_u64)V22 | ((sph_u64)V32 << 32); \ - W3 = (sph_u64)V23 | ((sph_u64)V33 << 32); \ - W4 = (sph_u64)V24 | ((sph_u64)V34 << 32); \ - W5 = (sph_u64)V25 | ((sph_u64)V35 << 32); \ - W6 = (sph_u64)V26 | ((sph_u64)V36 << 32); \ - W7 = (sph_u64)V27 | ((sph_u64)V37 << 32); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMBW(W0, W1, W2, W3); \ - SUB_CRUMBW(W5, W6, W7, W4); \ - MIX_WORDW(W0, W4); \ - MIX_WORDW(W1, W5); \ - MIX_WORDW(W2, W6); \ - MIX_WORDW(W3, W7); \ - W0 ^= RCW230[r]; \ - W4 ^= RCW234[r]; \ - } \ - V20 = SPH_T32((sph_u32)W0); \ - V30 = SPH_T32((sph_u32)(W0 >> 32)); \ - V21 = SPH_T32((sph_u32)W1); \ - V31 = SPH_T32((sph_u32)(W1 >> 32)); \ - V22 = SPH_T32((sph_u32)W2); \ - V32 = SPH_T32((sph_u32)(W2 >> 32)); \ - V23 = SPH_T32((sph_u32)W3); \ - V33 = SPH_T32((sph_u32)(W3 >> 32)); \ - V24 = SPH_T32((sph_u32)W4); \ - V34 = SPH_T32((sph_u32)(W4 >> 32)); \ - V25 = SPH_T32((sph_u32)W5); \ - V35 = SPH_T32((sph_u32)(W5 >> 32)); \ - V26 = SPH_T32((sph_u32)W6); \ - V36 = SPH_T32((sph_u32)(W6 >> 32)); \ - V27 = SPH_T32((sph_u32)W7); \ - V37 = SPH_T32((sph_u32)(W7 >> 32)); \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V40, V41, V42, V43); \ - SUB_CRUMB(V45, V46, V47, V44); \ - MIX_WORD(V40, V44); \ - MIX_WORD(V41, V45); \ - MIX_WORD(V42, V46); \ - MIX_WORD(V43, V47); \ - V40 ^= RC40[r]; \ - V44 ^= RC44[r]; \ - } \ - } while (0) - -#else - -#define P5 do { \ - int r; \ - TWEAK5; \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V00, V01, V02, V03); \ - SUB_CRUMB(V05, V06, V07, V04); \ - MIX_WORD(V00, V04); \ - MIX_WORD(V01, V05); \ - MIX_WORD(V02, V06); \ - MIX_WORD(V03, V07); \ - V00 ^= RC00[r]; \ - V04 ^= RC04[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V10, V11, V12, V13); \ - SUB_CRUMB(V15, V16, V17, V14); \ - MIX_WORD(V10, V14); \ - MIX_WORD(V11, V15); \ - MIX_WORD(V12, V16); \ - MIX_WORD(V13, V17); \ - V10 ^= RC10[r]; \ - V14 ^= RC14[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V20, V21, V22, V23); \ - SUB_CRUMB(V25, V26, V27, V24); \ - MIX_WORD(V20, V24); \ - MIX_WORD(V21, V25); \ - MIX_WORD(V22, V26); \ - MIX_WORD(V23, V27); \ - V20 ^= RC20[r]; \ - V24 ^= RC24[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V30, V31, V32, V33); \ - SUB_CRUMB(V35, V36, V37, V34); \ - MIX_WORD(V30, V34); \ - MIX_WORD(V31, V35); \ - MIX_WORD(V32, V36); \ - MIX_WORD(V33, V37); \ - V30 ^= RC30[r]; \ - V34 ^= RC34[r]; \ - } \ - for (r = 0; r < 8; r ++) { \ - SUB_CRUMB(V40, V41, V42, V43); \ - SUB_CRUMB(V45, V46, V47, V44); \ - MIX_WORD(V40, V44); \ - MIX_WORD(V41, V45); \ - MIX_WORD(V42, V46); \ - MIX_WORD(V43, V47); \ - V40 ^= RC40[r]; \ - V44 ^= RC44[r]; \ - } \ - } while (0) - -#endif - -static void -luffa3(sph_luffa224_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE3 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE3(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - MI3; - P3; - ptr = 0; - } - } - WRITE_STATE3(sc); - sc->ptr = ptr; -} - -static void -luffa3_close(sph_luffa224_context *sc, unsigned ub, unsigned n, - void *dst, unsigned out_size_w32) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE3 - - buf = sc->buf; - ptr = sc->ptr; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE3(sc); - for (i = 0; i < 2; i ++) { - MI3; - P3; - memset(buf, 0, sizeof sc->buf); - } - out = dst; - sph_enc32be(out + 0, V00 ^ V10 ^ V20); - sph_enc32be(out + 4, V01 ^ V11 ^ V21); - sph_enc32be(out + 8, V02 ^ V12 ^ V22); - sph_enc32be(out + 12, V03 ^ V13 ^ V23); - sph_enc32be(out + 16, V04 ^ V14 ^ V24); - sph_enc32be(out + 20, V05 ^ V15 ^ V25); - sph_enc32be(out + 24, V06 ^ V16 ^ V26); - if (out_size_w32 > 7) - sph_enc32be(out + 28, V07 ^ V17 ^ V27); -} - -static void -luffa4(sph_luffa384_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE4 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE4(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - MI4; - P4; - ptr = 0; - } - } - WRITE_STATE4(sc); - sc->ptr = ptr; -} - -static void -luffa4_close(sph_luffa384_context *sc, unsigned ub, unsigned n, void *dst) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE4 - - buf = sc->buf; - ptr = sc->ptr; - out = dst; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE4(sc); - for (i = 0; i < 3; i ++) { - MI4; - P4; - switch (i) { - case 0: - memset(buf, 0, sizeof sc->buf); - break; - case 1: - sph_enc32be(out + 0, V00 ^ V10 ^ V20 ^ V30); - sph_enc32be(out + 4, V01 ^ V11 ^ V21 ^ V31); - sph_enc32be(out + 8, V02 ^ V12 ^ V22 ^ V32); - sph_enc32be(out + 12, V03 ^ V13 ^ V23 ^ V33); - sph_enc32be(out + 16, V04 ^ V14 ^ V24 ^ V34); - sph_enc32be(out + 20, V05 ^ V15 ^ V25 ^ V35); - sph_enc32be(out + 24, V06 ^ V16 ^ V26 ^ V36); - sph_enc32be(out + 28, V07 ^ V17 ^ V27 ^ V37); - break; - case 2: - sph_enc32be(out + 32, V00 ^ V10 ^ V20 ^ V30); - sph_enc32be(out + 36, V01 ^ V11 ^ V21 ^ V31); - sph_enc32be(out + 40, V02 ^ V12 ^ V22 ^ V32); - sph_enc32be(out + 44, V03 ^ V13 ^ V23 ^ V33); - break; - } - } -} - -static void -luffa5(sph_luffa512_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - DECL_STATE5 - - buf = sc->buf; - ptr = sc->ptr; - if (len < (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE5(sc); - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - if (ptr == sizeof sc->buf) { - MI5; - P5; - ptr = 0; - } - } - WRITE_STATE5(sc); - sc->ptr = ptr; -} - -static void -luffa5_close(sph_luffa512_context *sc, unsigned ub, unsigned n, void *dst) -{ - unsigned char *buf, *out; - size_t ptr; - unsigned z; - int i; - DECL_STATE5 - - buf = sc->buf; - ptr = sc->ptr; - out = dst; - z = 0x80 >> n; - buf[ptr ++] = ((ub & -z) | z) & 0xFF; - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - READ_STATE5(sc); - for (i = 0; i < 3; i ++) { - MI5; - P5; - switch (i) { - case 0: - memset(buf, 0, sizeof sc->buf); - break; - case 1: - sph_enc32be(out + 0, V00 ^ V10 ^ V20 ^ V30 ^ V40); - sph_enc32be(out + 4, V01 ^ V11 ^ V21 ^ V31 ^ V41); - sph_enc32be(out + 8, V02 ^ V12 ^ V22 ^ V32 ^ V42); - sph_enc32be(out + 12, V03 ^ V13 ^ V23 ^ V33 ^ V43); - sph_enc32be(out + 16, V04 ^ V14 ^ V24 ^ V34 ^ V44); - sph_enc32be(out + 20, V05 ^ V15 ^ V25 ^ V35 ^ V45); - sph_enc32be(out + 24, V06 ^ V16 ^ V26 ^ V36 ^ V46); - sph_enc32be(out + 28, V07 ^ V17 ^ V27 ^ V37 ^ V47); - break; - case 2: - sph_enc32be(out + 32, V00 ^ V10 ^ V20 ^ V30 ^ V40); - sph_enc32be(out + 36, V01 ^ V11 ^ V21 ^ V31 ^ V41); - sph_enc32be(out + 40, V02 ^ V12 ^ V22 ^ V32 ^ V42); - sph_enc32be(out + 44, V03 ^ V13 ^ V23 ^ V33 ^ V43); - sph_enc32be(out + 48, V04 ^ V14 ^ V24 ^ V34 ^ V44); - sph_enc32be(out + 52, V05 ^ V15 ^ V25 ^ V35 ^ V45); - sph_enc32be(out + 56, V06 ^ V16 ^ V26 ^ V36 ^ V46); - sph_enc32be(out + 60, V07 ^ V17 ^ V27 ^ V37 ^ V47); - break; - } - } -} - -/* see sph_luffa.h */ -void -sph_luffa224_init(void *cc) -{ - sph_luffa224_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa224(void *cc, const void *data, size_t len) -{ - luffa3(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa224_close(void *cc, void *dst) -{ - sph_luffa224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa3_close(cc, ub, n, dst, 7); - sph_luffa224_init(cc); -} - -/* see sph_luffa.h */ -void -sph_luffa256_init(void *cc) -{ - sph_luffa256_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa256(void *cc, const void *data, size_t len) -{ - luffa3(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa256_close(void *cc, void *dst) -{ - sph_luffa256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa3_close(cc, ub, n, dst, 8); - sph_luffa256_init(cc); -} - -/* see sph_luffa.h */ -void -sph_luffa384_init(void *cc) -{ - sph_luffa384_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa384(void *cc, const void *data, size_t len) -{ - luffa4(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa384_close(void *cc, void *dst) -{ - sph_luffa384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa4_close(cc, ub, n, dst); - sph_luffa384_init(cc); -} - -/* see sph_luffa.h */ -void -sph_luffa512_init(void *cc) -{ - sph_luffa512_context *sc; - - sc = cc; - memcpy(sc->V, V_INIT, sizeof(sc->V)); - sc->ptr = 0; -} - -/* see sph_luffa.h */ -void -sph_luffa512(void *cc, const void *data, size_t len) -{ - luffa5(cc, data, len); -} - -/* see sph_luffa.h */ -void -sph_luffa512_close(void *cc, void *dst) -{ - sph_luffa512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_luffa.h */ -void -sph_luffa512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - luffa5_close(cc, ub, n, dst); - sph_luffa512_init(cc); -} - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp deleted file mode 100644 index 5a6bfc7ea..000000000 --- a/src/crypto/sha256.cpp +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "sha256.h" -#include "common.h" - -#include -#include -#include - -#if defined(__x86_64__) || defined(__amd64__) -#if defined(EXPERIMENTAL_ASM) -#include -namespace sha256_sse4 -{ -void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks); -} -#endif -#endif - -// Internal implementation code. -namespace -{ -/// Internal SHA-256 implementation. -namespace sha256 -{ -uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); } -uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); } -uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); } -uint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); } -uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); } -uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); } - -/** One round of SHA-256. */ -void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k, uint32_t w) -{ - uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; - uint32_t t2 = Sigma0(a) + Maj(a, b, c); - d += t1; - h = t1 + t2; -} - -/** Initialize SHA-256 state. */ -void inline Initialize(uint32_t* s) -{ - s[0] = 0x6a09e667ul; - s[1] = 0xbb67ae85ul; - s[2] = 0x3c6ef372ul; - s[3] = 0xa54ff53aul; - s[4] = 0x510e527ful; - s[5] = 0x9b05688cul; - s[6] = 0x1f83d9abul; - s[7] = 0x5be0cd19ul; -} - -/** Perform a number of SHA-256 transformations, processing 64-byte chunks. */ -void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks) -{ - while (blocks--) { - uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; - uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - - Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); - Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); - Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); - Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); - Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); - Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); - Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); - Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); - Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); - Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); - Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40)); - Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44)); - Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48)); - Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = ReadBE32(chunk + 52)); - Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56)); - Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60)); - - Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0)); - - Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0)); - - Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0)); - - s[0] += a; - s[1] += b; - s[2] += c; - s[3] += d; - s[4] += e; - s[5] += f; - s[6] += g; - s[7] += h; - chunk += 64; - } -} - -} // namespace sha256 - -typedef void (*TransformType)(uint32_t*, const unsigned char*, size_t); - -bool SelfTest(TransformType tr) { - static const unsigned char in1[65] = {0, 0x80}; - static const unsigned char in2[129] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0 - }; - static const uint32_t init[8] = {0x6a09e667ul, 0xbb67ae85ul, 0x3c6ef372ul, 0xa54ff53aul, 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul}; - static const uint32_t out1[8] = {0xe3b0c442ul, 0x98fc1c14ul, 0x9afbf4c8ul, 0x996fb924ul, 0x27ae41e4ul, 0x649b934cul, 0xa495991bul, 0x7852b855ul}; - static const uint32_t out2[8] = {0xce4153b0ul, 0x147c2a86ul, 0x3ed4298eul, 0xe0676bc8ul, 0x79fc77a1ul, 0x2abe1f49ul, 0xb2b055dful, 0x1069523eul}; - uint32_t buf[8]; - memcpy(buf, init, sizeof(buf)); - // Process nothing, and check we remain in the initial state. - tr(buf, nullptr, 0); - if (memcmp(buf, init, sizeof(buf))) return false; - // Process the padded empty string (unaligned) - tr(buf, in1 + 1, 1); - if (memcmp(buf, out1, sizeof(buf))) return false; - // Process 64 spaces (unaligned) - memcpy(buf, init, sizeof(buf)); - tr(buf, in2 + 1, 2); - if (memcmp(buf, out2, sizeof(buf))) return false; - return true; -} - -TransformType Transform = sha256::Transform; - -} // namespace - -std::string SHA256AutoDetect() -{ -#if defined(EXPERIMENTAL_ASM) && (defined(__x86_64__) || defined(__amd64__)) - uint32_t eax, ebx, ecx, edx; - if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx >> 19) & 1) { - Transform = sha256_sse4::Transform; - assert(SelfTest(Transform)); - return "sse4"; - } -#endif - - assert(SelfTest(Transform)); - return "standard"; -} - -////// SHA-256 - -CSHA256::CSHA256() : bytes(0) -{ - sha256::Initialize(s); -} - -CSHA256& CSHA256::Write(const unsigned char* data, size_t len) -{ - const unsigned char* end = data + len; - size_t bufsize = bytes % 64; - if (bufsize && bufsize + len >= 64) { - // Fill the buffer, and process it. - memcpy(buf + bufsize, data, 64 - bufsize); - bytes += 64 - bufsize; - data += 64 - bufsize; - Transform(s, buf, 1); - bufsize = 0; - } - if (end - data >= 64) { - size_t blocks = (end - data) / 64; - Transform(s, data, blocks); - data += 64 * blocks; - bytes += 64 * blocks; - } - if (end > data) { - // Fill the buffer with what remains. - memcpy(buf + bufsize, data, end - data); - bytes += end - data; - } - return *this; -} - -void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) -{ - static const unsigned char pad[64] = {0x80}; - unsigned char sizedesc[8]; - WriteBE64(sizedesc, bytes << 3); - Write(pad, 1 + ((119 - (bytes % 64)) % 64)); - Write(sizedesc, 8); - WriteBE32(hash, s[0]); - WriteBE32(hash + 4, s[1]); - WriteBE32(hash + 8, s[2]); - WriteBE32(hash + 12, s[3]); - WriteBE32(hash + 16, s[4]); - WriteBE32(hash + 20, s[5]); - WriteBE32(hash + 24, s[6]); - WriteBE32(hash + 28, s[7]); -} - -CSHA256& CSHA256::Reset() -{ - bytes = 0; - sha256::Initialize(s); - return *this; -} diff --git a/src/crypto/sha256.h b/src/crypto/sha256.h deleted file mode 100644 index aa4f3972c..000000000 --- a/src/crypto/sha256.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2014-2016 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_SHA256_H -#define BITCOIN_CRYPTO_SHA256_H - -#include -#include -#include - -/** A hasher class for SHA-256. */ -class CSHA256 -{ -private: - uint32_t s[8]; - unsigned char buf[64]; - uint64_t bytes; - -public: - static const size_t OUTPUT_SIZE = 32; - - CSHA256(); - CSHA256& Write(const unsigned char* data, size_t len); - void Finalize(unsigned char hash[OUTPUT_SIZE]); - CSHA256& Reset(); -}; - -/** Autodetect the best available SHA256 implementation. - * Returns the name of the implementation. - */ -std::string SHA256AutoDetect(); - -#endif // BITCOIN_CRYPTO_SHA256_H diff --git a/src/crypto/shavite.c b/src/crypto/shavite.c deleted file mode 100644 index 85074f334..000000000 --- a/src/crypto/shavite.c +++ /dev/null @@ -1,1764 +0,0 @@ -/* $Id: shavite.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * SHAvite-3 implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_shavite.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_SHAVITE -#define SPH_SMALL_FOOTPRINT_SHAVITE 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#define C32 SPH_C32 - -/* - * As of round 2 of the SHA-3 competition, the published reference - * implementation and test vectors are wrong, because they use - * big-endian AES tables while the internal decoding uses little-endian. - * The code below follows the specification. To turn it into a code - * which follows the reference implementation (the one called "BugFix" - * on the SHAvite-3 web site, published on Nov 23rd, 2009), comment out - * the code below (from the '#define AES_BIG_ENDIAN...' to the definition - * of the AES_ROUND_NOKEY macro) and replace it with the version which - * is commented out afterwards. - */ - -#define AES_BIG_ENDIAN 0 -#include "aes_helper.c" - -static const sph_u32 IV224[] = { - C32(0x6774F31C), C32(0x990AE210), C32(0xC87D4274), C32(0xC9546371), - C32(0x62B2AEA8), C32(0x4B5801D8), C32(0x1B702860), C32(0x842F3017) -}; - -static const sph_u32 IV256[] = { - C32(0x49BB3E47), C32(0x2674860D), C32(0xA8B392AC), C32(0x021AC4E6), - C32(0x409283CF), C32(0x620E5D86), C32(0x6D929DCB), C32(0x96CC2A8B) -}; - -static const sph_u32 IV384[] = { - C32(0x83DF1545), C32(0xF9AAEC13), C32(0xF4803CB0), C32(0x11FE1F47), - C32(0xDA6CD269), C32(0x4F53FCD7), C32(0x950529A2), C32(0x97908147), - C32(0xB0A4D7AF), C32(0x2B9132BF), C32(0x226E607D), C32(0x3C0F8D7C), - C32(0x487B3F0F), C32(0x04363E22), C32(0x0155C99C), C32(0xEC2E20D3) -}; - -static const sph_u32 IV512[] = { - C32(0x72FCCDD8), C32(0x79CA4727), C32(0x128A077B), C32(0x40D55AEC), - C32(0xD1901A06), C32(0x430AE307), C32(0xB29F5CD1), C32(0xDF07FBFC), - C32(0x8E45D73D), C32(0x681AB538), C32(0xBDE86578), C32(0xDD577E47), - C32(0xE275EADE), C32(0x502D9FCD), C32(0xB9357178), C32(0x022A4B9A) -}; - -#define AES_ROUND_NOKEY(x0, x1, x2, x3) do { \ - sph_u32 t0 = (x0); \ - sph_u32 t1 = (x1); \ - sph_u32 t2 = (x2); \ - sph_u32 t3 = (x3); \ - AES_ROUND_NOKEY_LE(t0, t1, t2, t3, x0, x1, x2, x3); \ - } while (0) - -/* - * This is the code needed to match the "reference implementation" as - * published on Nov 23rd, 2009, instead of the published specification. - * - -#define AES_BIG_ENDIAN 1 -#include "aes_helper.c" - -static const sph_u32 IV224[] = { - C32(0xC4C67795), C32(0xC0B1817F), C32(0xEAD88924), C32(0x1ABB1BB0), - C32(0xE0C29152), C32(0xBDE046BA), C32(0xAEEECF99), C32(0x58D509D8) -}; - -static const sph_u32 IV256[] = { - C32(0x3EECF551), C32(0xBF10819B), C32(0xE6DC8559), C32(0xF3E23FD5), - C32(0x431AEC73), C32(0x79E3F731), C32(0x98325F05), C32(0xA92A31F1) -}; - -static const sph_u32 IV384[] = { - C32(0x71F48510), C32(0xA903A8AC), C32(0xFE3216DD), C32(0x0B2D2AD4), - C32(0x6672900A), C32(0x41032819), C32(0x15A7D780), C32(0xB3CAB8D9), - C32(0x34EF4711), C32(0xDE019FE8), C32(0x4D674DC4), C32(0xE056D96B), - C32(0xA35C016B), C32(0xDD903BA7), C32(0x8C1B09B4), C32(0x2C3E9F25) -}; - -static const sph_u32 IV512[] = { - C32(0xD5652B63), C32(0x25F1E6EA), C32(0xB18F48FA), C32(0xA1EE3A47), - C32(0xC8B67B07), C32(0xBDCE48D3), C32(0xE3937B78), C32(0x05DB5186), - C32(0x613BE326), C32(0xA11FA303), C32(0x90C833D4), C32(0x79CEE316), - C32(0x1E1AF00F), C32(0x2829B165), C32(0x23B25F80), C32(0x21E11499) -}; - -#define AES_ROUND_NOKEY(x0, x1, x2, x3) do { \ - sph_u32 t0 = (x0); \ - sph_u32 t1 = (x1); \ - sph_u32 t2 = (x2); \ - sph_u32 t3 = (x3); \ - AES_ROUND_NOKEY_BE(t0, t1, t2, t3, x0, x1, x2, x3); \ - } while (0) - - */ - -#define KEY_EXPAND_ELT(k0, k1, k2, k3) do { \ - sph_u32 kt; \ - AES_ROUND_NOKEY(k1, k2, k3, k0); \ - kt = (k0); \ - (k0) = (k1); \ - (k1) = (k2); \ - (k2) = (k3); \ - (k3) = kt; \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_SHAVITE - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c256(sph_shavite_small_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 rk[144]; - size_t u; - int r, s; - -#if SPH_LITTLE_ENDIAN - memcpy(rk, msg, 64); -#else - for (u = 0; u < 16; u += 4) { - rk[u + 0] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 0); - rk[u + 1] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 4); - rk[u + 2] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 8); - rk[u + 3] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 12); - } -#endif - u = 16; - for (r = 0; r < 4; r ++) { - for (s = 0; s < 2; s ++) { - sph_u32 x0, x1, x2, x3; - - x0 = rk[u - 15]; - x1 = rk[u - 14]; - x2 = rk[u - 13]; - x3 = rk[u - 16]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 16) { - rk[ 16] ^= sc->count0; - rk[ 17] ^= SPH_T32(~sc->count1); - } else if (u == 56) { - rk[ 57] ^= sc->count1; - rk[ 58] ^= SPH_T32(~sc->count0); - } - u += 4; - - x0 = rk[u - 15]; - x1 = rk[u - 14]; - x2 = rk[u - 13]; - x3 = rk[u - 16]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 84) { - rk[ 86] ^= sc->count1; - rk[ 87] ^= SPH_T32(~sc->count0); - } else if (u == 124) { - rk[124] ^= sc->count0; - rk[127] ^= SPH_T32(~sc->count1); - } - u += 4; - } - for (s = 0; s < 4; s ++) { - rk[u + 0] = rk[u - 16] ^ rk[u - 3]; - rk[u + 1] = rk[u - 15] ^ rk[u - 2]; - rk[u + 2] = rk[u - 14] ^ rk[u - 1]; - rk[u + 3] = rk[u - 13] ^ rk[u - 0]; - u += 4; - } - } - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - u = 0; - for (r = 0; r < 6; r ++) { - sph_u32 x0, x1, x2, x3; - - x0 = p4 ^ rk[u ++]; - x1 = p5 ^ rk[u ++]; - x2 = p6 ^ rk[u ++]; - x3 = p7 ^ rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - - x0 = p0 ^ rk[u ++]; - x1 = p1 ^ rk[u ++]; - x2 = p2 ^ rk[u ++]; - x3 = p3 ^ rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - x0 ^= rk[u ++]; - x1 ^= rk[u ++]; - x2 ^= rk[u ++]; - x3 ^= rk[u ++]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - } - sc->h[0x0] ^= p0; - sc->h[0x1] ^= p1; - sc->h[0x2] ^= p2; - sc->h[0x3] ^= p3; - sc->h[0x4] ^= p4; - sc->h[0x5] ^= p5; - sc->h[0x6] ^= p6; - sc->h[0x7] ^= p7; -} - -#else - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c256(sph_shavite_small_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 x0, x1, x2, x3; - sph_u32 rk0, rk1, rk2, rk3, rk4, rk5, rk6, rk7; - sph_u32 rk8, rk9, rkA, rkB, rkC, rkD, rkE, rkF; - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - /* round 0 */ - rk0 = sph_dec32le_aligned((const unsigned char *)msg + 0); - x0 = p4 ^ rk0; - rk1 = sph_dec32le_aligned((const unsigned char *)msg + 4); - x1 = p5 ^ rk1; - rk2 = sph_dec32le_aligned((const unsigned char *)msg + 8); - x2 = p6 ^ rk2; - rk3 = sph_dec32le_aligned((const unsigned char *)msg + 12); - x3 = p7 ^ rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk4 = sph_dec32le_aligned((const unsigned char *)msg + 16); - x0 ^= rk4; - rk5 = sph_dec32le_aligned((const unsigned char *)msg + 20); - x1 ^= rk5; - rk6 = sph_dec32le_aligned((const unsigned char *)msg + 24); - x2 ^= rk6; - rk7 = sph_dec32le_aligned((const unsigned char *)msg + 28); - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 = sph_dec32le_aligned((const unsigned char *)msg + 32); - x0 ^= rk8; - rk9 = sph_dec32le_aligned((const unsigned char *)msg + 36); - x1 ^= rk9; - rkA = sph_dec32le_aligned((const unsigned char *)msg + 40); - x2 ^= rkA; - rkB = sph_dec32le_aligned((const unsigned char *)msg + 44); - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 1 */ - rkC = sph_dec32le_aligned((const unsigned char *)msg + 48); - x0 = p0 ^ rkC; - rkD = sph_dec32le_aligned((const unsigned char *)msg + 52); - x1 = p1 ^ rkD; - rkE = sph_dec32le_aligned((const unsigned char *)msg + 56); - x2 = p2 ^ rkE; - rkF = sph_dec32le_aligned((const unsigned char *)msg + 60); - x3 = p3 ^ rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC ^ sc->count0; - rk1 ^= rkD ^ SPH_T32(~sc->count1); - rk2 ^= rkE; - rk3 ^= rkF; - x0 ^= rk0; - x1 ^= rk1; - x2 ^= rk2; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2; - rk7 ^= rk3; - x0 ^= rk4; - x1 ^= rk5; - x2 ^= rk6; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 2 */ - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5; - rkA ^= rk6; - rkB ^= rk7; - x0 = p4 ^ rk8; - x1 = p5 ^ rk9; - x2 = p6 ^ rkA; - x3 = p7 ^ rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB; - x0 ^= rkC; - x1 ^= rkD; - x2 ^= rkE; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0 ^= rkD; - x0 ^= rk0; - rk1 ^= rkE; - x1 ^= rk1; - rk2 ^= rkF; - x2 ^= rk2; - rk3 ^= rk0; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 3 */ - rk4 ^= rk1; - x0 = p0 ^ rk4; - rk5 ^= rk2; - x1 = p1 ^ rk5; - rk6 ^= rk3; - x2 = p2 ^ rk6; - rk7 ^= rk4; - x3 = p3 ^ rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 ^= rk5; - x0 ^= rk8; - rk9 ^= rk6; - x1 ^= rk9; - rkA ^= rk7; - x2 ^= rkA; - rkB ^= rk8; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rkC ^= rk9; - x0 ^= rkC; - rkD ^= rkA; - x1 ^= rkD; - rkE ^= rkB; - x2 ^= rkE; - rkF ^= rkC; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 4 */ - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC; - rk1 ^= rkD; - rk2 ^= rkE; - rk3 ^= rkF; - x0 = p4 ^ rk0; - x1 = p5 ^ rk1; - x2 = p6 ^ rk2; - x3 = p7 ^ rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2; - rk7 ^= rk3; - x0 ^= rk4; - x1 ^= rk5; - x2 ^= rk6; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5 ^ sc->count1; - rkA ^= rk6 ^ SPH_T32(~sc->count0); - rkB ^= rk7; - x0 ^= rk8; - x1 ^= rk9; - x2 ^= rkA; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 5 */ - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB; - x0 = p0 ^ rkC; - x1 = p1 ^ rkD; - x2 = p2 ^ rkE; - x3 = p3 ^ rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0 ^= rkD; - x0 ^= rk0; - rk1 ^= rkE; - x1 ^= rk1; - rk2 ^= rkF; - x2 ^= rk2; - rk3 ^= rk0; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk4 ^= rk1; - x0 ^= rk4; - rk5 ^= rk2; - x1 ^= rk5; - rk6 ^= rk3; - x2 ^= rk6; - rk7 ^= rk4; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 6 */ - rk8 ^= rk5; - x0 = p4 ^ rk8; - rk9 ^= rk6; - x1 = p5 ^ rk9; - rkA ^= rk7; - x2 = p6 ^ rkA; - rkB ^= rk8; - x3 = p7 ^ rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rkC ^= rk9; - x0 ^= rkC; - rkD ^= rkA; - x1 ^= rkD; - rkE ^= rkB; - x2 ^= rkE; - rkF ^= rkC; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC; - rk1 ^= rkD; - rk2 ^= rkE; - rk3 ^= rkF; - x0 ^= rk0; - x1 ^= rk1; - x2 ^= rk2; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 7 */ - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2 ^ sc->count1; - rk7 ^= rk3 ^ SPH_T32(~sc->count0); - x0 = p0 ^ rk4; - x1 = p1 ^ rk5; - x2 = p2 ^ rk6; - x3 = p3 ^ rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5; - rkA ^= rk6; - rkB ^= rk7; - x0 ^= rk8; - x1 ^= rk9; - x2 ^= rkA; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB; - x0 ^= rkC; - x1 ^= rkD; - x2 ^= rkE; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 8 */ - rk0 ^= rkD; - x0 = p4 ^ rk0; - rk1 ^= rkE; - x1 = p5 ^ rk1; - rk2 ^= rkF; - x2 = p6 ^ rk2; - rk3 ^= rk0; - x3 = p7 ^ rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk4 ^= rk1; - x0 ^= rk4; - rk5 ^= rk2; - x1 ^= rk5; - rk6 ^= rk3; - x2 ^= rk6; - rk7 ^= rk4; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 ^= rk5; - x0 ^= rk8; - rk9 ^= rk6; - x1 ^= rk9; - rkA ^= rk7; - x2 ^= rkA; - rkB ^= rk8; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 9 */ - rkC ^= rk9; - x0 = p0 ^ rkC; - rkD ^= rkA; - x1 = p1 ^ rkD; - rkE ^= rkB; - x2 = p2 ^ rkE; - rkF ^= rkC; - x3 = p3 ^ rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0, rk1, rk2, rk3); - rk0 ^= rkC; - rk1 ^= rkD; - rk2 ^= rkE; - rk3 ^= rkF; - x0 ^= rk0; - x1 ^= rk1; - x2 ^= rk2; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk4, rk5, rk6, rk7); - rk4 ^= rk0; - rk5 ^= rk1; - rk6 ^= rk2; - rk7 ^= rk3; - x0 ^= rk4; - x1 ^= rk5; - x2 ^= rk6; - x3 ^= rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 10 */ - KEY_EXPAND_ELT(rk8, rk9, rkA, rkB); - rk8 ^= rk4; - rk9 ^= rk5; - rkA ^= rk6; - rkB ^= rk7; - x0 = p4 ^ rk8; - x1 = p5 ^ rk9; - x2 = p6 ^ rkA; - x3 = p7 ^ rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rkC, rkD, rkE, rkF); - rkC ^= rk8 ^ sc->count0; - rkD ^= rk9; - rkE ^= rkA; - rkF ^= rkB ^ SPH_T32(~sc->count1); - x0 ^= rkC; - x1 ^= rkD; - x2 ^= rkE; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0 ^= rkD; - x0 ^= rk0; - rk1 ^= rkE; - x1 ^= rk1; - rk2 ^= rkF; - x2 ^= rk2; - rk3 ^= rk0; - x3 ^= rk3; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 11 */ - rk4 ^= rk1; - x0 = p0 ^ rk4; - rk5 ^= rk2; - x1 = p1 ^ rk5; - rk6 ^= rk3; - x2 = p2 ^ rk6; - rk7 ^= rk4; - x3 = p3 ^ rk7; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk8 ^= rk5; - x0 ^= rk8; - rk9 ^= rk6; - x1 ^= rk9; - rkA ^= rk7; - x2 ^= rkA; - rkB ^= rk8; - x3 ^= rkB; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rkC ^= rk9; - x0 ^= rkC; - rkD ^= rkA; - x1 ^= rkD; - rkE ^= rkB; - x2 ^= rkE; - rkF ^= rkC; - x3 ^= rkF; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - sc->h[0x0] ^= p0; - sc->h[0x1] ^= p1; - sc->h[0x2] ^= p2; - sc->h[0x3] ^= p3; - sc->h[0x4] ^= p4; - sc->h[0x5] ^= p5; - sc->h[0x6] ^= p6; - sc->h[0x7] ^= p7; -} - -#endif - -#if SPH_SMALL_FOOTPRINT_SHAVITE - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c512(sph_shavite_big_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 p8, p9, pA, pB, pC, pD, pE, pF; - sph_u32 rk[448]; - size_t u; - int r, s; - -#if SPH_LITTLE_ENDIAN - memcpy(rk, msg, 128); -#else - for (u = 0; u < 32; u += 4) { - rk[u + 0] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 0); - rk[u + 1] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 4); - rk[u + 2] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 8); - rk[u + 3] = sph_dec32le_aligned( - (const unsigned char *)msg + (u << 2) + 12); - } -#endif - u = 32; - for (;;) { - for (s = 0; s < 4; s ++) { - sph_u32 x0, x1, x2, x3; - - x0 = rk[u - 31]; - x1 = rk[u - 30]; - x2 = rk[u - 29]; - x3 = rk[u - 32]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 32) { - rk[ 32] ^= sc->count0; - rk[ 33] ^= sc->count1; - rk[ 34] ^= sc->count2; - rk[ 35] ^= SPH_T32(~sc->count3); - } else if (u == 440) { - rk[440] ^= sc->count1; - rk[441] ^= sc->count0; - rk[442] ^= sc->count3; - rk[443] ^= SPH_T32(~sc->count2); - } - u += 4; - - x0 = rk[u - 31]; - x1 = rk[u - 30]; - x2 = rk[u - 29]; - x3 = rk[u - 32]; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk[u + 0] = x0 ^ rk[u - 4]; - rk[u + 1] = x1 ^ rk[u - 3]; - rk[u + 2] = x2 ^ rk[u - 2]; - rk[u + 3] = x3 ^ rk[u - 1]; - if (u == 164) { - rk[164] ^= sc->count3; - rk[165] ^= sc->count2; - rk[166] ^= sc->count1; - rk[167] ^= SPH_T32(~sc->count0); - } else if (u == 316) { - rk[316] ^= sc->count2; - rk[317] ^= sc->count3; - rk[318] ^= sc->count0; - rk[319] ^= SPH_T32(~sc->count1); - } - u += 4; - } - if (u == 448) - break; - for (s = 0; s < 8; s ++) { - rk[u + 0] = rk[u - 32] ^ rk[u - 7]; - rk[u + 1] = rk[u - 31] ^ rk[u - 6]; - rk[u + 2] = rk[u - 30] ^ rk[u - 5]; - rk[u + 3] = rk[u - 29] ^ rk[u - 4]; - u += 4; - } - } - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - p8 = sc->h[0x8]; - p9 = sc->h[0x9]; - pA = sc->h[0xA]; - pB = sc->h[0xB]; - pC = sc->h[0xC]; - pD = sc->h[0xD]; - pE = sc->h[0xE]; - pF = sc->h[0xF]; - u = 0; - for (r = 0; r < 14; r ++) { -#define C512_ELT(l0, l1, l2, l3, r0, r1, r2, r3) do { \ - sph_u32 x0, x1, x2, x3; \ - x0 = r0 ^ rk[u ++]; \ - x1 = r1 ^ rk[u ++]; \ - x2 = r2 ^ rk[u ++]; \ - x3 = r3 ^ rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - x0 ^= rk[u ++]; \ - x1 ^= rk[u ++]; \ - x2 ^= rk[u ++]; \ - x3 ^= rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - x0 ^= rk[u ++]; \ - x1 ^= rk[u ++]; \ - x2 ^= rk[u ++]; \ - x3 ^= rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - x0 ^= rk[u ++]; \ - x1 ^= rk[u ++]; \ - x2 ^= rk[u ++]; \ - x3 ^= rk[u ++]; \ - AES_ROUND_NOKEY(x0, x1, x2, x3); \ - l0 ^= x0; \ - l1 ^= x1; \ - l2 ^= x2; \ - l3 ^= x3; \ - } while (0) - -#define WROT(a, b, c, d) do { \ - sph_u32 t = d; \ - d = c; \ - c = b; \ - b = a; \ - a = t; \ - } while (0) - - C512_ELT(p0, p1, p2, p3, p4, p5, p6, p7); - C512_ELT(p8, p9, pA, pB, pC, pD, pE, pF); - - WROT(p0, p4, p8, pC); - WROT(p1, p5, p9, pD); - WROT(p2, p6, pA, pE); - WROT(p3, p7, pB, pF); - -#undef C512_ELT -#undef WROT - } - sc->h[0x0] ^= p0; - sc->h[0x1] ^= p1; - sc->h[0x2] ^= p2; - sc->h[0x3] ^= p3; - sc->h[0x4] ^= p4; - sc->h[0x5] ^= p5; - sc->h[0x6] ^= p6; - sc->h[0x7] ^= p7; - sc->h[0x8] ^= p8; - sc->h[0x9] ^= p9; - sc->h[0xA] ^= pA; - sc->h[0xB] ^= pB; - sc->h[0xC] ^= pC; - sc->h[0xD] ^= pD; - sc->h[0xE] ^= pE; - sc->h[0xF] ^= pF; -} - -#else - -/* - * This function assumes that "msg" is aligned for 32-bit access. - */ -static void -c512(sph_shavite_big_context *sc, const void *msg) -{ - sph_u32 p0, p1, p2, p3, p4, p5, p6, p7; - sph_u32 p8, p9, pA, pB, pC, pD, pE, pF; - sph_u32 x0, x1, x2, x3; - sph_u32 rk00, rk01, rk02, rk03, rk04, rk05, rk06, rk07; - sph_u32 rk08, rk09, rk0A, rk0B, rk0C, rk0D, rk0E, rk0F; - sph_u32 rk10, rk11, rk12, rk13, rk14, rk15, rk16, rk17; - sph_u32 rk18, rk19, rk1A, rk1B, rk1C, rk1D, rk1E, rk1F; - int r; - - p0 = sc->h[0x0]; - p1 = sc->h[0x1]; - p2 = sc->h[0x2]; - p3 = sc->h[0x3]; - p4 = sc->h[0x4]; - p5 = sc->h[0x5]; - p6 = sc->h[0x6]; - p7 = sc->h[0x7]; - p8 = sc->h[0x8]; - p9 = sc->h[0x9]; - pA = sc->h[0xA]; - pB = sc->h[0xB]; - pC = sc->h[0xC]; - pD = sc->h[0xD]; - pE = sc->h[0xE]; - pF = sc->h[0xF]; - /* round 0 */ - rk00 = sph_dec32le_aligned((const unsigned char *)msg + 0); - x0 = p4 ^ rk00; - rk01 = sph_dec32le_aligned((const unsigned char *)msg + 4); - x1 = p5 ^ rk01; - rk02 = sph_dec32le_aligned((const unsigned char *)msg + 8); - x2 = p6 ^ rk02; - rk03 = sph_dec32le_aligned((const unsigned char *)msg + 12); - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk04 = sph_dec32le_aligned((const unsigned char *)msg + 16); - x0 ^= rk04; - rk05 = sph_dec32le_aligned((const unsigned char *)msg + 20); - x1 ^= rk05; - rk06 = sph_dec32le_aligned((const unsigned char *)msg + 24); - x2 ^= rk06; - rk07 = sph_dec32le_aligned((const unsigned char *)msg + 28); - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk08 = sph_dec32le_aligned((const unsigned char *)msg + 32); - x0 ^= rk08; - rk09 = sph_dec32le_aligned((const unsigned char *)msg + 36); - x1 ^= rk09; - rk0A = sph_dec32le_aligned((const unsigned char *)msg + 40); - x2 ^= rk0A; - rk0B = sph_dec32le_aligned((const unsigned char *)msg + 44); - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0C = sph_dec32le_aligned((const unsigned char *)msg + 48); - x0 ^= rk0C; - rk0D = sph_dec32le_aligned((const unsigned char *)msg + 52); - x1 ^= rk0D; - rk0E = sph_dec32le_aligned((const unsigned char *)msg + 56); - x2 ^= rk0E; - rk0F = sph_dec32le_aligned((const unsigned char *)msg + 60); - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 = sph_dec32le_aligned((const unsigned char *)msg + 64); - x0 = pC ^ rk10; - rk11 = sph_dec32le_aligned((const unsigned char *)msg + 68); - x1 = pD ^ rk11; - rk12 = sph_dec32le_aligned((const unsigned char *)msg + 72); - x2 = pE ^ rk12; - rk13 = sph_dec32le_aligned((const unsigned char *)msg + 76); - x3 = pF ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk14 = sph_dec32le_aligned((const unsigned char *)msg + 80); - x0 ^= rk14; - rk15 = sph_dec32le_aligned((const unsigned char *)msg + 84); - x1 ^= rk15; - rk16 = sph_dec32le_aligned((const unsigned char *)msg + 88); - x2 ^= rk16; - rk17 = sph_dec32le_aligned((const unsigned char *)msg + 92); - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk18 = sph_dec32le_aligned((const unsigned char *)msg + 96); - x0 ^= rk18; - rk19 = sph_dec32le_aligned((const unsigned char *)msg + 100); - x1 ^= rk19; - rk1A = sph_dec32le_aligned((const unsigned char *)msg + 104); - x2 ^= rk1A; - rk1B = sph_dec32le_aligned((const unsigned char *)msg + 108); - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk1C = sph_dec32le_aligned((const unsigned char *)msg + 112); - x0 ^= rk1C; - rk1D = sph_dec32le_aligned((const unsigned char *)msg + 116); - x1 ^= rk1D; - rk1E = sph_dec32le_aligned((const unsigned char *)msg + 120); - x2 ^= rk1E; - rk1F = sph_dec32le_aligned((const unsigned char *)msg + 124); - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - - for (r = 0; r < 3; r ++) { - /* round 1, 5, 9 */ - KEY_EXPAND_ELT(rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - if (r == 0) { - rk00 ^= sc->count0; - rk01 ^= sc->count1; - rk02 ^= sc->count2; - rk03 ^= SPH_T32(~sc->count3); - } - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - if (r == 1) { - rk04 ^= sc->count3; - rk05 ^= sc->count2; - rk06 ^= sc->count1; - rk07 ^= SPH_T32(~sc->count0); - } - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - if (r == 2) { - rk1C ^= sc->count2; - rk1D ^= sc->count3; - rk1E ^= sc->count0; - rk1F ^= SPH_T32(~sc->count1); - } - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - /* round 2, 6, 10 */ - rk00 ^= rk19; - x0 = pC ^ rk00; - rk01 ^= rk1A; - x1 = pD ^ rk01; - rk02 ^= rk1B; - x2 = pE ^ rk02; - rk03 ^= rk1C; - x3 = pF ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - rk10 ^= rk09; - x0 = p4 ^ rk10; - rk11 ^= rk0A; - x1 = p5 ^ rk11; - rk12 ^= rk0B; - x2 = p6 ^ rk12; - rk13 ^= rk0C; - x3 = p7 ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - /* round 3, 7, 11 */ - KEY_EXPAND_ELT(rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p8 ^ rk00; - x1 = p9 ^ rk01; - x2 = pA ^ rk02; - x3 = pB ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - KEY_EXPAND_ELT(rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p0 ^ rk10; - x1 = p1 ^ rk11; - x2 = p2 ^ rk12; - x3 = p3 ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk18, rk19, rk1A, rk1B); - rk18 ^= rk14; - rk19 ^= rk15; - rk1A ^= rk16; - rk1B ^= rk17; - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - /* round 4, 8, 12 */ - rk00 ^= rk19; - x0 = p4 ^ rk00; - rk01 ^= rk1A; - x1 = p5 ^ rk01; - rk02 ^= rk1B; - x2 = p6 ^ rk02; - rk03 ^= rk1C; - x3 = p7 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk04 ^= rk1D; - x0 ^= rk04; - rk05 ^= rk1E; - x1 ^= rk05; - rk06 ^= rk1F; - x2 ^= rk06; - rk07 ^= rk00; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk08 ^= rk01; - x0 ^= rk08; - rk09 ^= rk02; - x1 ^= rk09; - rk0A ^= rk03; - x2 ^= rk0A; - rk0B ^= rk04; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk0C ^= rk05; - x0 ^= rk0C; - rk0D ^= rk06; - x1 ^= rk0D; - rk0E ^= rk07; - x2 ^= rk0E; - rk0F ^= rk08; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p0 ^= x0; - p1 ^= x1; - p2 ^= x2; - p3 ^= x3; - rk10 ^= rk09; - x0 = pC ^ rk10; - rk11 ^= rk0A; - x1 = pD ^ rk11; - rk12 ^= rk0B; - x2 = pE ^ rk12; - rk13 ^= rk0C; - x3 = pF ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk14 ^= rk0D; - x0 ^= rk14; - rk15 ^= rk0E; - x1 ^= rk15; - rk16 ^= rk0F; - x2 ^= rk16; - rk17 ^= rk10; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk18 ^= rk11; - x0 ^= rk18; - rk19 ^= rk12; - x1 ^= rk19; - rk1A ^= rk13; - x2 ^= rk1A; - rk1B ^= rk14; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - rk1C ^= rk15; - x0 ^= rk1C; - rk1D ^= rk16; - x1 ^= rk1D; - rk1E ^= rk17; - x2 ^= rk1E; - rk1F ^= rk18; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p8 ^= x0; - p9 ^= x1; - pA ^= x2; - pB ^= x3; - } - /* round 13 */ - KEY_EXPAND_ELT(rk00, rk01, rk02, rk03); - rk00 ^= rk1C; - rk01 ^= rk1D; - rk02 ^= rk1E; - rk03 ^= rk1F; - x0 = p0 ^ rk00; - x1 = p1 ^ rk01; - x2 = p2 ^ rk02; - x3 = p3 ^ rk03; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk04, rk05, rk06, rk07); - rk04 ^= rk00; - rk05 ^= rk01; - rk06 ^= rk02; - rk07 ^= rk03; - x0 ^= rk04; - x1 ^= rk05; - x2 ^= rk06; - x3 ^= rk07; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk08, rk09, rk0A, rk0B); - rk08 ^= rk04; - rk09 ^= rk05; - rk0A ^= rk06; - rk0B ^= rk07; - x0 ^= rk08; - x1 ^= rk09; - x2 ^= rk0A; - x3 ^= rk0B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk0C, rk0D, rk0E, rk0F); - rk0C ^= rk08; - rk0D ^= rk09; - rk0E ^= rk0A; - rk0F ^= rk0B; - x0 ^= rk0C; - x1 ^= rk0D; - x2 ^= rk0E; - x3 ^= rk0F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - pC ^= x0; - pD ^= x1; - pE ^= x2; - pF ^= x3; - KEY_EXPAND_ELT(rk10, rk11, rk12, rk13); - rk10 ^= rk0C; - rk11 ^= rk0D; - rk12 ^= rk0E; - rk13 ^= rk0F; - x0 = p8 ^ rk10; - x1 = p9 ^ rk11; - x2 = pA ^ rk12; - x3 = pB ^ rk13; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk14, rk15, rk16, rk17); - rk14 ^= rk10; - rk15 ^= rk11; - rk16 ^= rk12; - rk17 ^= rk13; - x0 ^= rk14; - x1 ^= rk15; - x2 ^= rk16; - x3 ^= rk17; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk18, rk19, rk1A, rk1B); - rk18 ^= rk14 ^ sc->count1; - rk19 ^= rk15 ^ sc->count0; - rk1A ^= rk16 ^ sc->count3; - rk1B ^= rk17 ^ SPH_T32(~sc->count2); - x0 ^= rk18; - x1 ^= rk19; - x2 ^= rk1A; - x3 ^= rk1B; - AES_ROUND_NOKEY(x0, x1, x2, x3); - KEY_EXPAND_ELT(rk1C, rk1D, rk1E, rk1F); - rk1C ^= rk18; - rk1D ^= rk19; - rk1E ^= rk1A; - rk1F ^= rk1B; - x0 ^= rk1C; - x1 ^= rk1D; - x2 ^= rk1E; - x3 ^= rk1F; - AES_ROUND_NOKEY(x0, x1, x2, x3); - p4 ^= x0; - p5 ^= x1; - p6 ^= x2; - p7 ^= x3; - sc->h[0x0] ^= p8; - sc->h[0x1] ^= p9; - sc->h[0x2] ^= pA; - sc->h[0x3] ^= pB; - sc->h[0x4] ^= pC; - sc->h[0x5] ^= pD; - sc->h[0x6] ^= pE; - sc->h[0x7] ^= pF; - sc->h[0x8] ^= p0; - sc->h[0x9] ^= p1; - sc->h[0xA] ^= p2; - sc->h[0xB] ^= p3; - sc->h[0xC] ^= p4; - sc->h[0xD] ^= p5; - sc->h[0xE] ^= p6; - sc->h[0xF] ^= p7; -} - -#endif - -static void -shavite_small_init(sph_shavite_small_context *sc, const sph_u32 *iv) -{ - memcpy(sc->h, iv, sizeof sc->h); - sc->ptr = 0; - sc->count0 = 0; - sc->count1 = 0; -} - -static void -shavite_small_core(sph_shavite_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - ptr += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((sc->count0 = SPH_T32(sc->count0 + 512)) == 0) - sc->count1 = SPH_T32(sc->count1 + 1); - c256(sc, buf); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -shavite_small_close(sph_shavite_small_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - unsigned char *buf; - size_t ptr, u; - unsigned z; - sph_u32 count0, count1; - - buf = sc->buf; - ptr = sc->ptr; - count0 = (sc->count0 += (ptr << 3) + n); - count1 = sc->count1; - z = 0x80 >> n; - z = ((ub & -z) | z) & 0xFF; - if (ptr == 0 && n == 0) { - buf[0] = 0x80; - memset(buf + 1, 0, 53); - sc->count0 = sc->count1 = 0; - } else if (ptr < 54) { - buf[ptr ++] = z; - memset(buf + ptr, 0, 54 - ptr); - } else { - buf[ptr ++] = z; - memset(buf + ptr, 0, 64 - ptr); - c256(sc, buf); - memset(buf, 0, 54); - sc->count0 = sc->count1 = 0; - } - sph_enc32le(buf + 54, count0); - sph_enc32le(buf + 58, count1); - buf[62] = out_size_w32 << 5; - buf[63] = out_size_w32 >> 3; - c256(sc, buf); - for (u = 0; u < out_size_w32; u ++) - sph_enc32le((unsigned char *)dst + (u << 2), sc->h[u]); -} - -static void -shavite_big_init(sph_shavite_big_context *sc, const sph_u32 *iv) -{ - memcpy(sc->h, iv, sizeof sc->h); - sc->ptr = 0; - sc->count0 = 0; - sc->count1 = 0; - sc->count2 = 0; - sc->count3 = 0; -} - -static void -shavite_big_core(sph_shavite_big_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr; - - buf = sc->buf; - ptr = sc->ptr; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - ptr += clen; - len -= clen; - if (ptr == sizeof sc->buf) { - if ((sc->count0 = SPH_T32(sc->count0 + 1024)) == 0) { - sc->count1 = SPH_T32(sc->count1 + 1); - if (sc->count1 == 0) { - sc->count2 = SPH_T32(sc->count2 + 1); - if (sc->count2 == 0) { - sc->count3 = SPH_T32( - sc->count3 + 1); - } - } - } - c512(sc, buf); - ptr = 0; - } - } - sc->ptr = ptr; -} - -static void -shavite_big_close(sph_shavite_big_context *sc, - unsigned ub, unsigned n, void *dst, size_t out_size_w32) -{ - unsigned char *buf; - size_t ptr, u; - unsigned z; - sph_u32 count0, count1, count2, count3; - - buf = sc->buf; - ptr = sc->ptr; - count0 = (sc->count0 += (ptr << 3) + n); - count1 = sc->count1; - count2 = sc->count2; - count3 = sc->count3; - z = 0x80 >> n; - z = ((ub & -z) | z) & 0xFF; - if (ptr == 0 && n == 0) { - buf[0] = 0x80; - memset(buf + 1, 0, 109); - sc->count0 = sc->count1 = sc->count2 = sc->count3 = 0; - } else if (ptr < 110) { - buf[ptr ++] = z; - memset(buf + ptr, 0, 110 - ptr); - } else { - buf[ptr ++] = z; - memset(buf + ptr, 0, 128 - ptr); - c512(sc, buf); - memset(buf, 0, 110); - sc->count0 = sc->count1 = sc->count2 = sc->count3 = 0; - } - sph_enc32le(buf + 110, count0); - sph_enc32le(buf + 114, count1); - sph_enc32le(buf + 118, count2); - sph_enc32le(buf + 122, count3); - buf[126] = out_size_w32 << 5; - buf[127] = out_size_w32 >> 3; - c512(sc, buf); - for (u = 0; u < out_size_w32; u ++) - sph_enc32le((unsigned char *)dst + (u << 2), sc->h[u]); -} - -/* see sph_shavite.h */ -void -sph_shavite224_init(void *cc) -{ - shavite_small_init(cc, IV224); -} - -/* see sph_shavite.h */ -void -sph_shavite224(void *cc, const void *data, size_t len) -{ - shavite_small_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite224_close(void *cc, void *dst) -{ - shavite_small_close(cc, 0, 0, dst, 7); - shavite_small_init(cc, IV224); -} - -/* see sph_shavite.h */ -void -sph_shavite224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_small_close(cc, ub, n, dst, 7); - shavite_small_init(cc, IV224); -} - -/* see sph_shavite.h */ -void -sph_shavite256_init(void *cc) -{ - shavite_small_init(cc, IV256); -} - -/* see sph_shavite.h */ -void -sph_shavite256(void *cc, const void *data, size_t len) -{ - shavite_small_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite256_close(void *cc, void *dst) -{ - shavite_small_close(cc, 0, 0, dst, 8); - shavite_small_init(cc, IV256); -} - -/* see sph_shavite.h */ -void -sph_shavite256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_small_close(cc, ub, n, dst, 8); - shavite_small_init(cc, IV256); -} - -/* see sph_shavite.h */ -void -sph_shavite384_init(void *cc) -{ - shavite_big_init(cc, IV384); -} - -/* see sph_shavite.h */ -void -sph_shavite384(void *cc, const void *data, size_t len) -{ - shavite_big_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite384_close(void *cc, void *dst) -{ - shavite_big_close(cc, 0, 0, dst, 12); - shavite_big_init(cc, IV384); -} - -/* see sph_shavite.h */ -void -sph_shavite384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_big_close(cc, ub, n, dst, 12); - shavite_big_init(cc, IV384); -} - -/* see sph_shavite.h */ -void -sph_shavite512_init(void *cc) -{ - shavite_big_init(cc, IV512); -} - -/* see sph_shavite.h */ -void -sph_shavite512(void *cc, const void *data, size_t len) -{ - shavite_big_core(cc, data, len); -} - -/* see sph_shavite.h */ -void -sph_shavite512_close(void *cc, void *dst) -{ - shavite_big_close(cc, 0, 0, dst, 16); - shavite_big_init(cc, IV512); -} - -/* see sph_shavite.h */ -void -sph_shavite512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - shavite_big_close(cc, ub, n, dst, 16); - shavite_big_init(cc, IV512); -} - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/src/crypto/simd.c b/src/crypto/simd.c deleted file mode 100644 index 2c8062617..000000000 --- a/src/crypto/simd.c +++ /dev/null @@ -1,1799 +0,0 @@ -/* $Id: simd.c 227 2010-06-16 17:28:38Z tp $ */ -/* - * SIMD implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include -#include - -#include "sph_simd.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_SIMD -#define SPH_SMALL_FOOTPRINT_SIMD 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -typedef sph_u32 u32; -typedef sph_s32 s32; -#define C32 SPH_C32 -#define T32 SPH_T32 -#define ROL32 SPH_ROTL32 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -/* - * The powers of 41 modulo 257. We use exponents from 0 to 255, inclusive. - */ -static const s32 alpha_tab[] = { - 1, 41, 139, 45, 46, 87, 226, 14, 60, 147, 116, 130, - 190, 80, 196, 69, 2, 82, 21, 90, 92, 174, 195, 28, - 120, 37, 232, 3, 123, 160, 135, 138, 4, 164, 42, 180, - 184, 91, 133, 56, 240, 74, 207, 6, 246, 63, 13, 19, - 8, 71, 84, 103, 111, 182, 9, 112, 223, 148, 157, 12, - 235, 126, 26, 38, 16, 142, 168, 206, 222, 107, 18, 224, - 189, 39, 57, 24, 213, 252, 52, 76, 32, 27, 79, 155, - 187, 214, 36, 191, 121, 78, 114, 48, 169, 247, 104, 152, - 64, 54, 158, 53, 117, 171, 72, 125, 242, 156, 228, 96, - 81, 237, 208, 47, 128, 108, 59, 106, 234, 85, 144, 250, - 227, 55, 199, 192, 162, 217, 159, 94, 256, 216, 118, 212, - 211, 170, 31, 243, 197, 110, 141, 127, 67, 177, 61, 188, - 255, 175, 236, 167, 165, 83, 62, 229, 137, 220, 25, 254, - 134, 97, 122, 119, 253, 93, 215, 77, 73, 166, 124, 201, - 17, 183, 50, 251, 11, 194, 244, 238, 249, 186, 173, 154, - 146, 75, 248, 145, 34, 109, 100, 245, 22, 131, 231, 219, - 241, 115, 89, 51, 35, 150, 239, 33, 68, 218, 200, 233, - 44, 5, 205, 181, 225, 230, 178, 102, 70, 43, 221, 66, - 136, 179, 143, 209, 88, 10, 153, 105, 193, 203, 99, 204, - 140, 86, 185, 132, 15, 101, 29, 161, 176, 20, 49, 210, - 129, 149, 198, 151, 23, 172, 113, 7, 30, 202, 58, 65, - 95, 40, 98, 163 -}; - -/* - * Ranges: - * REDS1: from -32768..98302 to -383..383 - * REDS2: from -2^31..2^31-1 to -32768..98302 - */ -#define REDS1(x) (((x) & 0xFF) - ((x) >> 8)) -#define REDS2(x) (((x) & 0xFFFF) + ((x) >> 16)) - -/* - * If, upon entry, the values of q[] are all in the -N..N range (where - * N >= 98302) then the new values of q[] are in the -2N..2N range. - * - * Since alpha_tab[v] <= 256, maximum allowed range is for N = 8388608. - */ -#define FFT_LOOP(rb, hk, as, id) do { \ - size_t u, v; \ - s32 m = q[(rb)]; \ - s32 n = q[(rb) + (hk)]; \ - q[(rb)] = m + n; \ - q[(rb) + (hk)] = m - n; \ - u = v = 0; \ - goto id; \ - for (; u < (hk); u += 4, v += 4 * (as)) { \ - s32 t; \ - m = q[(rb) + u + 0]; \ - n = q[(rb) + u + 0 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 0 * (as)]); \ - q[(rb) + u + 0] = m + t; \ - q[(rb) + u + 0 + (hk)] = m - t; \ - id: \ - m = q[(rb) + u + 1]; \ - n = q[(rb) + u + 1 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 1 * (as)]); \ - q[(rb) + u + 1] = m + t; \ - q[(rb) + u + 1 + (hk)] = m - t; \ - m = q[(rb) + u + 2]; \ - n = q[(rb) + u + 2 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 2 * (as)]); \ - q[(rb) + u + 2] = m + t; \ - q[(rb) + u + 2 + (hk)] = m - t; \ - m = q[(rb) + u + 3]; \ - n = q[(rb) + u + 3 + (hk)]; \ - t = REDS2(n * alpha_tab[v + 3 * (as)]); \ - q[(rb) + u + 3] = m + t; \ - q[(rb) + u + 3 + (hk)] = m - t; \ - } \ - } while (0) - -/* - * Output ranges: - * d0: min= 0 max= 1020 - * d1: min= -67 max= 4587 - * d2: min=-4335 max= 4335 - * d3: min=-4147 max= 507 - * d4: min= -510 max= 510 - * d5: min= -252 max= 4402 - * d6: min=-4335 max= 4335 - * d7: min=-4332 max= 322 - */ -#define FFT8(xb, xs, d) do { \ - s32 x0 = x[(xb)]; \ - s32 x1 = x[(xb) + (xs)]; \ - s32 x2 = x[(xb) + 2 * (xs)]; \ - s32 x3 = x[(xb) + 3 * (xs)]; \ - s32 a0 = x0 + x2; \ - s32 a1 = x0 + (x2 << 4); \ - s32 a2 = x0 - x2; \ - s32 a3 = x0 - (x2 << 4); \ - s32 b0 = x1 + x3; \ - s32 b1 = REDS1((x1 << 2) + (x3 << 6)); \ - s32 b2 = (x1 << 4) - (x3 << 4); \ - s32 b3 = REDS1((x1 << 6) + (x3 << 2)); \ - d ## 0 = a0 + b0; \ - d ## 1 = a1 + b1; \ - d ## 2 = a2 + b2; \ - d ## 3 = a3 + b3; \ - d ## 4 = a0 - b0; \ - d ## 5 = a1 - b1; \ - d ## 6 = a2 - b2; \ - d ## 7 = a3 - b3; \ - } while (0) - -/* - * When k=16, we have alpha=2. Multiplication by alpha^i is then reduced - * to some shifting. - * - * Output: within -591471..591723 - */ -#define FFT16(xb, xs, rb) do { \ - s32 d1_0, d1_1, d1_2, d1_3, d1_4, d1_5, d1_6, d1_7; \ - s32 d2_0, d2_1, d2_2, d2_3, d2_4, d2_5, d2_6, d2_7; \ - FFT8(xb, (xs) << 1, d1_); \ - FFT8((xb) + (xs), (xs) << 1, d2_); \ - q[(rb) + 0] = d1_0 + d2_0; \ - q[(rb) + 1] = d1_1 + (d2_1 << 1); \ - q[(rb) + 2] = d1_2 + (d2_2 << 2); \ - q[(rb) + 3] = d1_3 + (d2_3 << 3); \ - q[(rb) + 4] = d1_4 + (d2_4 << 4); \ - q[(rb) + 5] = d1_5 + (d2_5 << 5); \ - q[(rb) + 6] = d1_6 + (d2_6 << 6); \ - q[(rb) + 7] = d1_7 + (d2_7 << 7); \ - q[(rb) + 8] = d1_0 - d2_0; \ - q[(rb) + 9] = d1_1 - (d2_1 << 1); \ - q[(rb) + 10] = d1_2 - (d2_2 << 2); \ - q[(rb) + 11] = d1_3 - (d2_3 << 3); \ - q[(rb) + 12] = d1_4 - (d2_4 << 4); \ - q[(rb) + 13] = d1_5 - (d2_5 << 5); \ - q[(rb) + 14] = d1_6 - (d2_6 << 6); \ - q[(rb) + 15] = d1_7 - (d2_7 << 7); \ - } while (0) - -/* - * Output range: |q| <= 1183446 - */ -#define FFT32(xb, xs, rb, id) do { \ - FFT16(xb, (xs) << 1, rb); \ - FFT16((xb) + (xs), (xs) << 1, (rb) + 16); \ - FFT_LOOP(rb, 16, 8, id); \ - } while (0) - -/* - * Output range: |q| <= 2366892 - */ -#define FFT64(xb, xs, rb, id) do { \ - FFT32(xb, (xs) << 1, rb, XCAT(id, a)); \ - FFT32((xb) + (xs), (xs) << 1, (rb) + 32, XCAT(id, b)); \ - FFT_LOOP(rb, 32, 4, id); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_SIMD - -static void -fft32(unsigned char *x, size_t xs, s32 *q) -{ - size_t xd; - - xd = xs << 1; - FFT16(0, xd, 0); - FFT16(xs, xd, 16); - FFT_LOOP(0, 16, 8, label_); -} - -#define FFT128(xb, xs, rb, id) do { \ - fft32(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \ - fft32(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 32]); \ - FFT_LOOP(rb, 32, 4, XCAT(id, aa)); \ - fft32(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 64]); \ - fft32(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 96]); \ - FFT_LOOP((rb) + 64, 32, 4, XCAT(id, ab)); \ - FFT_LOOP(rb, 64, 2, XCAT(id, a)); \ - } while (0) - -#else - -/* - * Output range: |q| <= 4733784 - */ -#define FFT128(xb, xs, rb, id) do { \ - FFT64(xb, (xs) << 1, rb, XCAT(id, a)); \ - FFT64((xb) + (xs), (xs) << 1, (rb) + 64, XCAT(id, b)); \ - FFT_LOOP(rb, 64, 2, id); \ - } while (0) - -#endif - -/* - * For SIMD-384 / SIMD-512, the fully unrolled FFT yields a compression - * function which does not fit in the 32 kB L1 cache of a typical x86 - * Intel. We therefore add a function call layer at the FFT64 level. - */ - -static void -fft64(unsigned char *x, size_t xs, s32 *q) -{ - size_t xd; - - xd = xs << 1; - FFT32(0, xd, 0, label_a); - FFT32(xs, xd, 32, label_b); - FFT_LOOP(0, 32, 4, label_); -} - -/* - * Output range: |q| <= 9467568 - */ -#define FFT256(xb, xs, rb, id) do { \ - fft64(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \ - fft64(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 64]); \ - FFT_LOOP(rb, 64, 2, XCAT(id, aa)); \ - fft64(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 128]); \ - fft64(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 192]); \ - FFT_LOOP((rb) + 128, 64, 2, XCAT(id, ab)); \ - FFT_LOOP(rb, 128, 1, XCAT(id, a)); \ - } while (0) - -/* - * alpha^(127*i) mod 257 - */ -static const unsigned short yoff_s_n[] = { - 1, 98, 95, 58, 30, 113, 23, 198, 129, 49, 176, 29, - 15, 185, 140, 99, 193, 153, 88, 143, 136, 221, 70, 178, - 225, 205, 44, 200, 68, 239, 35, 89, 241, 231, 22, 100, - 34, 248, 146, 173, 249, 244, 11, 50, 17, 124, 73, 215, - 253, 122, 134, 25, 137, 62, 165, 236, 255, 61, 67, 141, - 197, 31, 211, 118, 256, 159, 162, 199, 227, 144, 234, 59, - 128, 208, 81, 228, 242, 72, 117, 158, 64, 104, 169, 114, - 121, 36, 187, 79, 32, 52, 213, 57, 189, 18, 222, 168, - 16, 26, 235, 157, 223, 9, 111, 84, 8, 13, 246, 207, - 240, 133, 184, 42, 4, 135, 123, 232, 120, 195, 92, 21, - 2, 196, 190, 116, 60, 226, 46, 139 -}; - -/* - * alpha^(127*i) + alpha^(125*i) mod 257 - */ -static const unsigned short yoff_s_f[] = { - 2, 156, 118, 107, 45, 212, 111, 162, 97, 249, 211, 3, - 49, 101, 151, 223, 189, 178, 253, 204, 76, 82, 232, 65, - 96, 176, 161, 47, 189, 61, 248, 107, 0, 131, 133, 113, - 17, 33, 12, 111, 251, 103, 57, 148, 47, 65, 249, 143, - 189, 8, 204, 230, 205, 151, 187, 227, 247, 111, 140, 6, - 77, 10, 21, 149, 255, 101, 139, 150, 212, 45, 146, 95, - 160, 8, 46, 254, 208, 156, 106, 34, 68, 79, 4, 53, - 181, 175, 25, 192, 161, 81, 96, 210, 68, 196, 9, 150, - 0, 126, 124, 144, 240, 224, 245, 146, 6, 154, 200, 109, - 210, 192, 8, 114, 68, 249, 53, 27, 52, 106, 70, 30, - 10, 146, 117, 251, 180, 247, 236, 108 -}; - -/* - * beta^(255*i) mod 257 - */ -static const unsigned short yoff_b_n[] = { - 1, 163, 98, 40, 95, 65, 58, 202, 30, 7, 113, 172, - 23, 151, 198, 149, 129, 210, 49, 20, 176, 161, 29, 101, - 15, 132, 185, 86, 140, 204, 99, 203, 193, 105, 153, 10, - 88, 209, 143, 179, 136, 66, 221, 43, 70, 102, 178, 230, - 225, 181, 205, 5, 44, 233, 200, 218, 68, 33, 239, 150, - 35, 51, 89, 115, 241, 219, 231, 131, 22, 245, 100, 109, - 34, 145, 248, 75, 146, 154, 173, 186, 249, 238, 244, 194, - 11, 251, 50, 183, 17, 201, 124, 166, 73, 77, 215, 93, - 253, 119, 122, 97, 134, 254, 25, 220, 137, 229, 62, 83, - 165, 167, 236, 175, 255, 188, 61, 177, 67, 127, 141, 110, - 197, 243, 31, 170, 211, 212, 118, 216, 256, 94, 159, 217, - 162, 192, 199, 55, 227, 250, 144, 85, 234, 106, 59, 108, - 128, 47, 208, 237, 81, 96, 228, 156, 242, 125, 72, 171, - 117, 53, 158, 54, 64, 152, 104, 247, 169, 48, 114, 78, - 121, 191, 36, 214, 187, 155, 79, 27, 32, 76, 52, 252, - 213, 24, 57, 39, 189, 224, 18, 107, 222, 206, 168, 142, - 16, 38, 26, 126, 235, 12, 157, 148, 223, 112, 9, 182, - 111, 103, 84, 71, 8, 19, 13, 63, 246, 6, 207, 74, - 240, 56, 133, 91, 184, 180, 42, 164, 4, 138, 135, 160, - 123, 3, 232, 37, 120, 28, 195, 174, 92, 90, 21, 82, - 2, 69, 196, 80, 190, 130, 116, 147, 60, 14, 226, 87, - 46, 45, 139, 41 -}; - -/* - * beta^(255*i) + beta^(253*i) mod 257 - */ -static const unsigned short yoff_b_f[] = { - 2, 203, 156, 47, 118, 214, 107, 106, 45, 93, 212, 20, - 111, 73, 162, 251, 97, 215, 249, 53, 211, 19, 3, 89, - 49, 207, 101, 67, 151, 130, 223, 23, 189, 202, 178, 239, - 253, 127, 204, 49, 76, 236, 82, 137, 232, 157, 65, 79, - 96, 161, 176, 130, 161, 30, 47, 9, 189, 247, 61, 226, - 248, 90, 107, 64, 0, 88, 131, 243, 133, 59, 113, 115, - 17, 236, 33, 213, 12, 191, 111, 19, 251, 61, 103, 208, - 57, 35, 148, 248, 47, 116, 65, 119, 249, 178, 143, 40, - 189, 129, 8, 163, 204, 227, 230, 196, 205, 122, 151, 45, - 187, 19, 227, 72, 247, 125, 111, 121, 140, 220, 6, 107, - 77, 69, 10, 101, 21, 65, 149, 171, 255, 54, 101, 210, - 139, 43, 150, 151, 212, 164, 45, 237, 146, 184, 95, 6, - 160, 42, 8, 204, 46, 238, 254, 168, 208, 50, 156, 190, - 106, 127, 34, 234, 68, 55, 79, 18, 4, 130, 53, 208, - 181, 21, 175, 120, 25, 100, 192, 178, 161, 96, 81, 127, - 96, 227, 210, 248, 68, 10, 196, 31, 9, 167, 150, 193, - 0, 169, 126, 14, 124, 198, 144, 142, 240, 21, 224, 44, - 245, 66, 146, 238, 6, 196, 154, 49, 200, 222, 109, 9, - 210, 141, 192, 138, 8, 79, 114, 217, 68, 128, 249, 94, - 53, 30, 27, 61, 52, 135, 106, 212, 70, 238, 30, 185, - 10, 132, 146, 136, 117, 37, 251, 150, 180, 188, 247, 156, - 236, 192, 108, 86 -}; - -#define INNER(l, h, mm) (((u32)((l) * (mm)) & 0xFFFFU) \ - + ((u32)((h) * (mm)) << 16)) - -#define W_SMALL(sb, o1, o2, mm) \ - (INNER(q[8 * (sb) + 2 * 0 + o1], q[8 * (sb) + 2 * 0 + o2], mm), \ - INNER(q[8 * (sb) + 2 * 1 + o1], q[8 * (sb) + 2 * 1 + o2], mm), \ - INNER(q[8 * (sb) + 2 * 2 + o1], q[8 * (sb) + 2 * 2 + o2], mm), \ - INNER(q[8 * (sb) + 2 * 3 + o1], q[8 * (sb) + 2 * 3 + o2], mm) - -#define WS_0_0 W_SMALL( 4, 0, 1, 185) -#define WS_0_1 W_SMALL( 6, 0, 1, 185) -#define WS_0_2 W_SMALL( 0, 0, 1, 185) -#define WS_0_3 W_SMALL( 2, 0, 1, 185) -#define WS_0_4 W_SMALL( 7, 0, 1, 185) -#define WS_0_5 W_SMALL( 5, 0, 1, 185) -#define WS_0_6 W_SMALL( 3, 0, 1, 185) -#define WS_0_7 W_SMALL( 1, 0, 1, 185) -#define WS_1_0 W_SMALL(15, 0, 1, 185) -#define WS_1_1 W_SMALL(11, 0, 1, 185) -#define WS_1_2 W_SMALL(12, 0, 1, 185) -#define WS_1_3 W_SMALL( 8, 0, 1, 185) -#define WS_1_4 W_SMALL( 9, 0, 1, 185) -#define WS_1_5 W_SMALL(13, 0, 1, 185) -#define WS_1_6 W_SMALL(10, 0, 1, 185) -#define WS_1_7 W_SMALL(14, 0, 1, 185) -#define WS_2_0 W_SMALL(17, -128, -64, 233) -#define WS_2_1 W_SMALL(18, -128, -64, 233) -#define WS_2_2 W_SMALL(23, -128, -64, 233) -#define WS_2_3 W_SMALL(20, -128, -64, 233) -#define WS_2_4 W_SMALL(22, -128, -64, 233) -#define WS_2_5 W_SMALL(21, -128, -64, 233) -#define WS_2_6 W_SMALL(16, -128, -64, 233) -#define WS_2_7 W_SMALL(19, -128, -64, 233) -#define WS_3_0 W_SMALL(30, -191, -127, 233) -#define WS_3_1 W_SMALL(24, -191, -127, 233) -#define WS_3_2 W_SMALL(25, -191, -127, 233) -#define WS_3_3 W_SMALL(31, -191, -127, 233) -#define WS_3_4 W_SMALL(27, -191, -127, 233) -#define WS_3_5 W_SMALL(29, -191, -127, 233) -#define WS_3_6 W_SMALL(28, -191, -127, 233) -#define WS_3_7 W_SMALL(26, -191, -127, 233) - -#define W_BIG(sb, o1, o2, mm) \ - (INNER(q[16 * (sb) + 2 * 0 + o1], q[16 * (sb) + 2 * 0 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 1 + o1], q[16 * (sb) + 2 * 1 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 2 + o1], q[16 * (sb) + 2 * 2 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 3 + o1], q[16 * (sb) + 2 * 3 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 4 + o1], q[16 * (sb) + 2 * 4 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 5 + o1], q[16 * (sb) + 2 * 5 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 6 + o1], q[16 * (sb) + 2 * 6 + o2], mm), \ - INNER(q[16 * (sb) + 2 * 7 + o1], q[16 * (sb) + 2 * 7 + o2], mm) - -#define WB_0_0 W_BIG( 4, 0, 1, 185) -#define WB_0_1 W_BIG( 6, 0, 1, 185) -#define WB_0_2 W_BIG( 0, 0, 1, 185) -#define WB_0_3 W_BIG( 2, 0, 1, 185) -#define WB_0_4 W_BIG( 7, 0, 1, 185) -#define WB_0_5 W_BIG( 5, 0, 1, 185) -#define WB_0_6 W_BIG( 3, 0, 1, 185) -#define WB_0_7 W_BIG( 1, 0, 1, 185) -#define WB_1_0 W_BIG(15, 0, 1, 185) -#define WB_1_1 W_BIG(11, 0, 1, 185) -#define WB_1_2 W_BIG(12, 0, 1, 185) -#define WB_1_3 W_BIG( 8, 0, 1, 185) -#define WB_1_4 W_BIG( 9, 0, 1, 185) -#define WB_1_5 W_BIG(13, 0, 1, 185) -#define WB_1_6 W_BIG(10, 0, 1, 185) -#define WB_1_7 W_BIG(14, 0, 1, 185) -#define WB_2_0 W_BIG(17, -256, -128, 233) -#define WB_2_1 W_BIG(18, -256, -128, 233) -#define WB_2_2 W_BIG(23, -256, -128, 233) -#define WB_2_3 W_BIG(20, -256, -128, 233) -#define WB_2_4 W_BIG(22, -256, -128, 233) -#define WB_2_5 W_BIG(21, -256, -128, 233) -#define WB_2_6 W_BIG(16, -256, -128, 233) -#define WB_2_7 W_BIG(19, -256, -128, 233) -#define WB_3_0 W_BIG(30, -383, -255, 233) -#define WB_3_1 W_BIG(24, -383, -255, 233) -#define WB_3_2 W_BIG(25, -383, -255, 233) -#define WB_3_3 W_BIG(31, -383, -255, 233) -#define WB_3_4 W_BIG(27, -383, -255, 233) -#define WB_3_5 W_BIG(29, -383, -255, 233) -#define WB_3_6 W_BIG(28, -383, -255, 233) -#define WB_3_7 W_BIG(26, -383, -255, 233) - -#define IF(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) -#define MAJ(x, y, z) (((x) & (y)) | (((x) | (y)) & (z))) - -#define PP4_0_0 1 -#define PP4_0_1 0 -#define PP4_0_2 3 -#define PP4_0_3 2 -#define PP4_1_0 2 -#define PP4_1_1 3 -#define PP4_1_2 0 -#define PP4_1_3 1 -#define PP4_2_0 3 -#define PP4_2_1 2 -#define PP4_2_2 1 -#define PP4_2_3 0 - -#define PP8_0_0 1 -#define PP8_0_1 0 -#define PP8_0_2 3 -#define PP8_0_3 2 -#define PP8_0_4 5 -#define PP8_0_5 4 -#define PP8_0_6 7 -#define PP8_0_7 6 - -#define PP8_1_0 6 -#define PP8_1_1 7 -#define PP8_1_2 4 -#define PP8_1_3 5 -#define PP8_1_4 2 -#define PP8_1_5 3 -#define PP8_1_6 0 -#define PP8_1_7 1 - -#define PP8_2_0 2 -#define PP8_2_1 3 -#define PP8_2_2 0 -#define PP8_2_3 1 -#define PP8_2_4 6 -#define PP8_2_5 7 -#define PP8_2_6 4 -#define PP8_2_7 5 - -#define PP8_3_0 3 -#define PP8_3_1 2 -#define PP8_3_2 1 -#define PP8_3_3 0 -#define PP8_3_4 7 -#define PP8_3_5 6 -#define PP8_3_6 5 -#define PP8_3_7 4 - -#define PP8_4_0 5 -#define PP8_4_1 4 -#define PP8_4_2 7 -#define PP8_4_3 6 -#define PP8_4_4 1 -#define PP8_4_5 0 -#define PP8_4_6 3 -#define PP8_4_7 2 - -#define PP8_5_0 7 -#define PP8_5_1 6 -#define PP8_5_2 5 -#define PP8_5_3 4 -#define PP8_5_4 3 -#define PP8_5_5 2 -#define PP8_5_6 1 -#define PP8_5_7 0 - -#define PP8_6_0 4 -#define PP8_6_1 5 -#define PP8_6_2 6 -#define PP8_6_3 7 -#define PP8_6_4 0 -#define PP8_6_5 1 -#define PP8_6_6 2 -#define PP8_6_7 3 - -#if SPH_SIMD_NOCOPY - -#define DECL_STATE_SMALL -#define READ_STATE_SMALL(sc) -#define WRITE_STATE_SMALL(sc) -#define DECL_STATE_BIG -#define READ_STATE_BIG(sc) -#define WRITE_STATE_BIG(sc) - -#else - -#define DECL_STATE_SMALL \ - u32 A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3; - -#define READ_STATE_SMALL(sc) do { \ - A0 = (sc)->state[ 0]; \ - A1 = (sc)->state[ 1]; \ - A2 = (sc)->state[ 2]; \ - A3 = (sc)->state[ 3]; \ - B0 = (sc)->state[ 4]; \ - B1 = (sc)->state[ 5]; \ - B2 = (sc)->state[ 6]; \ - B3 = (sc)->state[ 7]; \ - C0 = (sc)->state[ 8]; \ - C1 = (sc)->state[ 9]; \ - C2 = (sc)->state[10]; \ - C3 = (sc)->state[11]; \ - D0 = (sc)->state[12]; \ - D1 = (sc)->state[13]; \ - D2 = (sc)->state[14]; \ - D3 = (sc)->state[15]; \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - (sc)->state[ 0] = A0; \ - (sc)->state[ 1] = A1; \ - (sc)->state[ 2] = A2; \ - (sc)->state[ 3] = A3; \ - (sc)->state[ 4] = B0; \ - (sc)->state[ 5] = B1; \ - (sc)->state[ 6] = B2; \ - (sc)->state[ 7] = B3; \ - (sc)->state[ 8] = C0; \ - (sc)->state[ 9] = C1; \ - (sc)->state[10] = C2; \ - (sc)->state[11] = C3; \ - (sc)->state[12] = D0; \ - (sc)->state[13] = D1; \ - (sc)->state[14] = D2; \ - (sc)->state[15] = D3; \ - } while (0) - -#define DECL_STATE_BIG \ - u32 A0, A1, A2, A3, A4, A5, A6, A7; \ - u32 B0, B1, B2, B3, B4, B5, B6, B7; \ - u32 C0, C1, C2, C3, C4, C5, C6, C7; \ - u32 D0, D1, D2, D3, D4, D5, D6, D7; - -#define READ_STATE_BIG(sc) do { \ - A0 = (sc)->state[ 0]; \ - A1 = (sc)->state[ 1]; \ - A2 = (sc)->state[ 2]; \ - A3 = (sc)->state[ 3]; \ - A4 = (sc)->state[ 4]; \ - A5 = (sc)->state[ 5]; \ - A6 = (sc)->state[ 6]; \ - A7 = (sc)->state[ 7]; \ - B0 = (sc)->state[ 8]; \ - B1 = (sc)->state[ 9]; \ - B2 = (sc)->state[10]; \ - B3 = (sc)->state[11]; \ - B4 = (sc)->state[12]; \ - B5 = (sc)->state[13]; \ - B6 = (sc)->state[14]; \ - B7 = (sc)->state[15]; \ - C0 = (sc)->state[16]; \ - C1 = (sc)->state[17]; \ - C2 = (sc)->state[18]; \ - C3 = (sc)->state[19]; \ - C4 = (sc)->state[20]; \ - C5 = (sc)->state[21]; \ - C6 = (sc)->state[22]; \ - C7 = (sc)->state[23]; \ - D0 = (sc)->state[24]; \ - D1 = (sc)->state[25]; \ - D2 = (sc)->state[26]; \ - D3 = (sc)->state[27]; \ - D4 = (sc)->state[28]; \ - D5 = (sc)->state[29]; \ - D6 = (sc)->state[30]; \ - D7 = (sc)->state[31]; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - (sc)->state[ 0] = A0; \ - (sc)->state[ 1] = A1; \ - (sc)->state[ 2] = A2; \ - (sc)->state[ 3] = A3; \ - (sc)->state[ 4] = A4; \ - (sc)->state[ 5] = A5; \ - (sc)->state[ 6] = A6; \ - (sc)->state[ 7] = A7; \ - (sc)->state[ 8] = B0; \ - (sc)->state[ 9] = B1; \ - (sc)->state[10] = B2; \ - (sc)->state[11] = B3; \ - (sc)->state[12] = B4; \ - (sc)->state[13] = B5; \ - (sc)->state[14] = B6; \ - (sc)->state[15] = B7; \ - (sc)->state[16] = C0; \ - (sc)->state[17] = C1; \ - (sc)->state[18] = C2; \ - (sc)->state[19] = C3; \ - (sc)->state[20] = C4; \ - (sc)->state[21] = C5; \ - (sc)->state[22] = C6; \ - (sc)->state[23] = C7; \ - (sc)->state[24] = D0; \ - (sc)->state[25] = D1; \ - (sc)->state[26] = D2; \ - (sc)->state[27] = D3; \ - (sc)->state[28] = D4; \ - (sc)->state[29] = D5; \ - (sc)->state[30] = D6; \ - (sc)->state[31] = D7; \ - } while (0) - -#endif - -#define STEP_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + XCAT(tA, XCAT(ppb, n))); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA ## n; \ - } while (0) - -#define STEP_SMALL(w0, w1, w2, w3, fun, r, s, pp4b) do { \ - u32 tA0 = ROL32(A0, r); \ - u32 tA1 = ROL32(A1, r); \ - u32 tA2 = ROL32(A2, r); \ - u32 tA3 = ROL32(A3, r); \ - STEP_ELT(0, w0, fun, s, pp4b); \ - STEP_ELT(1, w1, fun, s, pp4b); \ - STEP_ELT(2, w2, fun, s, pp4b); \ - STEP_ELT(3, w3, fun, s, pp4b); \ - } while (0) - -#define STEP_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b) do { \ - u32 tA0 = ROL32(A0, r); \ - u32 tA1 = ROL32(A1, r); \ - u32 tA2 = ROL32(A2, r); \ - u32 tA3 = ROL32(A3, r); \ - u32 tA4 = ROL32(A4, r); \ - u32 tA5 = ROL32(A5, r); \ - u32 tA6 = ROL32(A6, r); \ - u32 tA7 = ROL32(A7, r); \ - STEP_ELT(0, w0, fun, s, pp8b); \ - STEP_ELT(1, w1, fun, s, pp8b); \ - STEP_ELT(2, w2, fun, s, pp8b); \ - STEP_ELT(3, w3, fun, s, pp8b); \ - STEP_ELT(4, w4, fun, s, pp8b); \ - STEP_ELT(5, w5, fun, s, pp8b); \ - STEP_ELT(6, w6, fun, s, pp8b); \ - STEP_ELT(7, w7, fun, s, pp8b); \ - } while (0) - -#define M3_0_0 0_ -#define M3_1_0 1_ -#define M3_2_0 2_ -#define M3_3_0 0_ -#define M3_4_0 1_ -#define M3_5_0 2_ -#define M3_6_0 0_ -#define M3_7_0 1_ - -#define M3_0_1 1_ -#define M3_1_1 2_ -#define M3_2_1 0_ -#define M3_3_1 1_ -#define M3_4_1 2_ -#define M3_5_1 0_ -#define M3_6_1 1_ -#define M3_7_1 2_ - -#define M3_0_2 2_ -#define M3_1_2 0_ -#define M3_2_2 1_ -#define M3_3_2 2_ -#define M3_4_2 0_ -#define M3_5_2 1_ -#define M3_6_2 2_ -#define M3_7_2 0_ - -#define STEP_SMALL_(w, fun, r, s, pp4b) STEP_SMALL w, fun, r, s, pp4b) - -#define ONE_ROUND_SMALL(ri, isp, p0, p1, p2, p3) do { \ - STEP_SMALL_(WS_ ## ri ## 0, \ - IF, p0, p1, XCAT(PP4_, M3_0_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 1, \ - IF, p1, p2, XCAT(PP4_, M3_1_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 2, \ - IF, p2, p3, XCAT(PP4_, M3_2_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 3, \ - IF, p3, p0, XCAT(PP4_, M3_3_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 4, \ - MAJ, p0, p1, XCAT(PP4_, M3_4_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 5, \ - MAJ, p1, p2, XCAT(PP4_, M3_5_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 6, \ - MAJ, p2, p3, XCAT(PP4_, M3_6_ ## isp)); \ - STEP_SMALL_(WS_ ## ri ## 7, \ - MAJ, p3, p0, XCAT(PP4_, M3_7_ ## isp)); \ - } while (0) - -#define M7_0_0 0_ -#define M7_1_0 1_ -#define M7_2_0 2_ -#define M7_3_0 3_ -#define M7_4_0 4_ -#define M7_5_0 5_ -#define M7_6_0 6_ -#define M7_7_0 0_ - -#define M7_0_1 1_ -#define M7_1_1 2_ -#define M7_2_1 3_ -#define M7_3_1 4_ -#define M7_4_1 5_ -#define M7_5_1 6_ -#define M7_6_1 0_ -#define M7_7_1 1_ - -#define M7_0_2 2_ -#define M7_1_2 3_ -#define M7_2_2 4_ -#define M7_3_2 5_ -#define M7_4_2 6_ -#define M7_5_2 0_ -#define M7_6_2 1_ -#define M7_7_2 2_ - -#define M7_0_3 3_ -#define M7_1_3 4_ -#define M7_2_3 5_ -#define M7_3_3 6_ -#define M7_4_3 0_ -#define M7_5_3 1_ -#define M7_6_3 2_ -#define M7_7_3 3_ - -#define STEP_BIG_(w, fun, r, s, pp8b) STEP_BIG w, fun, r, s, pp8b) - -#define ONE_ROUND_BIG(ri, isp, p0, p1, p2, p3) do { \ - STEP_BIG_(WB_ ## ri ## 0, \ - IF, p0, p1, XCAT(PP8_, M7_0_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 1, \ - IF, p1, p2, XCAT(PP8_, M7_1_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 2, \ - IF, p2, p3, XCAT(PP8_, M7_2_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 3, \ - IF, p3, p0, XCAT(PP8_, M7_3_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 4, \ - MAJ, p0, p1, XCAT(PP8_, M7_4_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 5, \ - MAJ, p1, p2, XCAT(PP8_, M7_5_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 6, \ - MAJ, p2, p3, XCAT(PP8_, M7_6_ ## isp)); \ - STEP_BIG_(WB_ ## ri ## 7, \ - MAJ, p3, p0, XCAT(PP8_, M7_7_ ## isp)); \ - } while (0) - -#if SPH_SMALL_FOOTPRINT_SIMD - -#define A0 state[ 0] -#define A1 state[ 1] -#define A2 state[ 2] -#define A3 state[ 3] -#define B0 state[ 4] -#define B1 state[ 5] -#define B2 state[ 6] -#define B3 state[ 7] -#define C0 state[ 8] -#define C1 state[ 9] -#define C2 state[10] -#define C3 state[11] -#define D0 state[12] -#define D1 state[13] -#define D2 state[14] -#define D3 state[15] - -#define STEP2_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + tA[(ppb) ^ n]); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA[n]; \ - } while (0) - -#define STEP2_SMALL(w0, w1, w2, w3, fun, r, s, pp4b) do { \ - u32 tA[4]; \ - tA[0] = ROL32(A0, r); \ - tA[1] = ROL32(A1, r); \ - tA[2] = ROL32(A2, r); \ - tA[3] = ROL32(A3, r); \ - STEP2_ELT(0, w0, fun, s, pp4b); \ - STEP2_ELT(1, w1, fun, s, pp4b); \ - STEP2_ELT(2, w2, fun, s, pp4b); \ - STEP2_ELT(3, w3, fun, s, pp4b); \ - } while (0) - -static void -one_round_small(u32 *state, u32 *w, int isp, int p0, int p1, int p2, int p3) -{ - static const int pp4k[] = { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2 }; - - STEP2_SMALL(w[ 0], w[ 1], w[ 2], w[ 3], IF, p0, p1, pp4k[isp + 0]); - STEP2_SMALL(w[ 4], w[ 5], w[ 6], w[ 7], IF, p1, p2, pp4k[isp + 1]); - STEP2_SMALL(w[ 8], w[ 9], w[10], w[11], IF, p2, p3, pp4k[isp + 2]); - STEP2_SMALL(w[12], w[13], w[14], w[15], IF, p3, p0, pp4k[isp + 3]); - STEP2_SMALL(w[16], w[17], w[18], w[19], MAJ, p0, p1, pp4k[isp + 4]); - STEP2_SMALL(w[20], w[21], w[22], w[23], MAJ, p1, p2, pp4k[isp + 5]); - STEP2_SMALL(w[24], w[25], w[26], w[27], MAJ, p2, p3, pp4k[isp + 6]); - STEP2_SMALL(w[28], w[29], w[30], w[31], MAJ, p3, p0, pp4k[isp + 7]); -} - -static void -compress_small(sph_simd_small_context *sc, int last) -{ - unsigned char *x; - s32 q[128]; - int i; - u32 w[32]; - u32 state[16]; - size_t u; - - static const size_t wsp[32] = { - 4 << 3, 6 << 3, 0 << 3, 2 << 3, - 7 << 3, 5 << 3, 3 << 3, 1 << 3, - 15 << 3, 11 << 3, 12 << 3, 8 << 3, - 9 << 3, 13 << 3, 10 << 3, 14 << 3, - 17 << 3, 18 << 3, 23 << 3, 20 << 3, - 22 << 3, 21 << 3, 16 << 3, 19 << 3, - 30 << 3, 24 << 3, 25 << 3, 31 << 3, - 27 << 3, 29 << 3, 28 << 3, 26 << 3 - }; - - x = sc->buf; - FFT128(0, 1, 0, ll); - if (last) { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - - for (i = 0; i < 16; i += 4) { - state[i + 0] = sc->state[i + 0] - ^ sph_dec32le_aligned(x + 4 * (i + 0)); - state[i + 1] = sc->state[i + 1] - ^ sph_dec32le_aligned(x + 4 * (i + 1)); - state[i + 2] = sc->state[i + 2] - ^ sph_dec32le_aligned(x + 4 * (i + 2)); - state[i + 3] = sc->state[i + 3] - ^ sph_dec32le_aligned(x + 4 * (i + 3)); - } - -#define WSREAD(sb, o1, o2, mm) do { \ - for (u = 0; u < 32; u += 4) { \ - size_t v = wsp[(u >> 2) + (sb)]; \ - w[u + 0] = INNER(q[v + 2 * 0 + (o1)], \ - q[v + 2 * 0 + (o2)], mm); \ - w[u + 1] = INNER(q[v + 2 * 1 + (o1)], \ - q[v + 2 * 1 + (o2)], mm); \ - w[u + 2] = INNER(q[v + 2 * 2 + (o1)], \ - q[v + 2 * 2 + (o2)], mm); \ - w[u + 3] = INNER(q[v + 2 * 3 + (o1)], \ - q[v + 2 * 3 + (o2)], mm); \ - } \ - } while (0) - - WSREAD( 0, 0, 1, 185); - one_round_small(state, w, 0, 3, 23, 17, 27); - WSREAD( 8, 0, 1, 185); - one_round_small(state, w, 2, 28, 19, 22, 7); - WSREAD(16, -128, -64, 233); - one_round_small(state, w, 1, 29, 9, 15, 5); - WSREAD(24, -191, -127, 233); - one_round_small(state, w, 0, 4, 13, 10, 25); - -#undef WSREAD - - STEP_SMALL(sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - IF, 4, 13, PP4_2_); - STEP_SMALL(sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 13, 10, PP4_0_); - STEP_SMALL(sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - IF, 10, 25, PP4_1_); - STEP_SMALL(sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 25, 4, PP4_2_); - - memcpy(sc->state, state, sizeof state); -} - -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef D0 -#undef D1 -#undef D2 -#undef D3 - -#else - -#if SPH_SIMD_NOCOPY -#define A0 (sc->state[ 0]) -#define A1 (sc->state[ 1]) -#define A2 (sc->state[ 2]) -#define A3 (sc->state[ 3]) -#define B0 (sc->state[ 4]) -#define B1 (sc->state[ 5]) -#define B2 (sc->state[ 6]) -#define B3 (sc->state[ 7]) -#define C0 (sc->state[ 8]) -#define C1 (sc->state[ 9]) -#define C2 (sc->state[10]) -#define C3 (sc->state[11]) -#define D0 (sc->state[12]) -#define D1 (sc->state[13]) -#define D2 (sc->state[14]) -#define D3 (sc->state[15]) -#endif - -static void -compress_small(sph_simd_small_context *sc, int last) -{ - unsigned char *x; - s32 q[128]; - int i; - DECL_STATE_SMALL -#if SPH_SIMD_NOCOPY - sph_u32 saved[16]; -#endif - -#if SPH_SIMD_NOCOPY - memcpy(saved, sc->state, sizeof saved); -#endif - x = sc->buf; - FFT128(0, 1, 0, ll); - if (last) { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 128; i ++) { - s32 tq; - - tq = q[i] + yoff_s_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - READ_STATE_SMALL(sc); - A0 ^= sph_dec32le_aligned(x + 0); - A1 ^= sph_dec32le_aligned(x + 4); - A2 ^= sph_dec32le_aligned(x + 8); - A3 ^= sph_dec32le_aligned(x + 12); - B0 ^= sph_dec32le_aligned(x + 16); - B1 ^= sph_dec32le_aligned(x + 20); - B2 ^= sph_dec32le_aligned(x + 24); - B3 ^= sph_dec32le_aligned(x + 28); - C0 ^= sph_dec32le_aligned(x + 32); - C1 ^= sph_dec32le_aligned(x + 36); - C2 ^= sph_dec32le_aligned(x + 40); - C3 ^= sph_dec32le_aligned(x + 44); - D0 ^= sph_dec32le_aligned(x + 48); - D1 ^= sph_dec32le_aligned(x + 52); - D2 ^= sph_dec32le_aligned(x + 56); - D3 ^= sph_dec32le_aligned(x + 60); - ONE_ROUND_SMALL(0_, 0, 3, 23, 17, 27); - ONE_ROUND_SMALL(1_, 2, 28, 19, 22, 7); - ONE_ROUND_SMALL(2_, 1, 29, 9, 15, 5); - ONE_ROUND_SMALL(3_, 0, 4, 13, 10, 25); -#if SPH_SIMD_NOCOPY - STEP_SMALL(saved[ 0], saved[ 1], saved[ 2], saved[ 3], - IF, 4, 13, PP4_2_); - STEP_SMALL(saved[ 4], saved[ 5], saved[ 6], saved[ 7], - IF, 13, 10, PP4_0_); - STEP_SMALL(saved[ 8], saved[ 9], saved[10], saved[11], - IF, 10, 25, PP4_1_); - STEP_SMALL(saved[12], saved[13], saved[14], saved[15], - IF, 25, 4, PP4_2_); -#else - STEP_SMALL(sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - IF, 4, 13, PP4_2_); - STEP_SMALL(sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 13, 10, PP4_0_); - STEP_SMALL(sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - IF, 10, 25, PP4_1_); - STEP_SMALL(sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 25, 4, PP4_2_); - WRITE_STATE_SMALL(sc); -#endif -} - -#if SPH_SIMD_NOCOPY -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef D0 -#undef D1 -#undef D2 -#undef D3 -#endif - -#endif - -#if SPH_SMALL_FOOTPRINT_SIMD - -#define A0 state[ 0] -#define A1 state[ 1] -#define A2 state[ 2] -#define A3 state[ 3] -#define A4 state[ 4] -#define A5 state[ 5] -#define A6 state[ 6] -#define A7 state[ 7] -#define B0 state[ 8] -#define B1 state[ 9] -#define B2 state[10] -#define B3 state[11] -#define B4 state[12] -#define B5 state[13] -#define B6 state[14] -#define B7 state[15] -#define C0 state[16] -#define C1 state[17] -#define C2 state[18] -#define C3 state[19] -#define C4 state[20] -#define C5 state[21] -#define C6 state[22] -#define C7 state[23] -#define D0 state[24] -#define D1 state[25] -#define D2 state[26] -#define D3 state[27] -#define D4 state[28] -#define D5 state[29] -#define D6 state[30] -#define D7 state[31] - -/* - * Not needed -- already defined for SIMD-224 / SIMD-256 - * -#define STEP2_ELT(n, w, fun, s, ppb) do { \ - u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \ - A ## n = T32(ROL32(tt, s) + tA[(ppb) ^ n]); \ - D ## n = C ## n; \ - C ## n = B ## n; \ - B ## n = tA[n]; \ - } while (0) - */ - -#define STEP2_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b) do { \ - u32 tA[8]; \ - tA[0] = ROL32(A0, r); \ - tA[1] = ROL32(A1, r); \ - tA[2] = ROL32(A2, r); \ - tA[3] = ROL32(A3, r); \ - tA[4] = ROL32(A4, r); \ - tA[5] = ROL32(A5, r); \ - tA[6] = ROL32(A6, r); \ - tA[7] = ROL32(A7, r); \ - STEP2_ELT(0, w0, fun, s, pp8b); \ - STEP2_ELT(1, w1, fun, s, pp8b); \ - STEP2_ELT(2, w2, fun, s, pp8b); \ - STEP2_ELT(3, w3, fun, s, pp8b); \ - STEP2_ELT(4, w4, fun, s, pp8b); \ - STEP2_ELT(5, w5, fun, s, pp8b); \ - STEP2_ELT(6, w6, fun, s, pp8b); \ - STEP2_ELT(7, w7, fun, s, pp8b); \ - } while (0) - -static void -one_round_big(u32 *state, u32 *w, int isp, int p0, int p1, int p2, int p3) -{ - static const int pp8k[] = { 1, 6, 2, 3, 5, 7, 4, 1, 6, 2, 3 }; - - STEP2_BIG(w[ 0], w[ 1], w[ 2], w[ 3], w[ 4], w[ 5], w[ 6], w[ 7], - IF, p0, p1, pp8k[isp + 0]); - STEP2_BIG(w[ 8], w[ 9], w[10], w[11], w[12], w[13], w[14], w[15], - IF, p1, p2, pp8k[isp + 1]); - STEP2_BIG(w[16], w[17], w[18], w[19], w[20], w[21], w[22], w[23], - IF, p2, p3, pp8k[isp + 2]); - STEP2_BIG(w[24], w[25], w[26], w[27], w[28], w[29], w[30], w[31], - IF, p3, p0, pp8k[isp + 3]); - STEP2_BIG(w[32], w[33], w[34], w[35], w[36], w[37], w[38], w[39], - MAJ, p0, p1, pp8k[isp + 4]); - STEP2_BIG(w[40], w[41], w[42], w[43], w[44], w[45], w[46], w[47], - MAJ, p1, p2, pp8k[isp + 5]); - STEP2_BIG(w[48], w[49], w[50], w[51], w[52], w[53], w[54], w[55], - MAJ, p2, p3, pp8k[isp + 6]); - STEP2_BIG(w[56], w[57], w[58], w[59], w[60], w[61], w[62], w[63], - MAJ, p3, p0, pp8k[isp + 7]); -} - -static void -compress_big(sph_simd_big_context *sc, int last) -{ - unsigned char *x; - s32 q[256]; - int i; - u32 w[64]; - u32 state[32]; - size_t u; - - static const size_t wbp[32] = { - 4 << 4, 6 << 4, 0 << 4, 2 << 4, - 7 << 4, 5 << 4, 3 << 4, 1 << 4, - 15 << 4, 11 << 4, 12 << 4, 8 << 4, - 9 << 4, 13 << 4, 10 << 4, 14 << 4, - 17 << 4, 18 << 4, 23 << 4, 20 << 4, - 22 << 4, 21 << 4, 16 << 4, 19 << 4, - 30 << 4, 24 << 4, 25 << 4, 31 << 4, - 27 << 4, 29 << 4, 28 << 4, 26 << 4 - }; - - x = sc->buf; - FFT256(0, 1, 0, ll); - if (last) { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - - for (i = 0; i < 32; i += 8) { - state[i + 0] = sc->state[i + 0] - ^ sph_dec32le_aligned(x + 4 * (i + 0)); - state[i + 1] = sc->state[i + 1] - ^ sph_dec32le_aligned(x + 4 * (i + 1)); - state[i + 2] = sc->state[i + 2] - ^ sph_dec32le_aligned(x + 4 * (i + 2)); - state[i + 3] = sc->state[i + 3] - ^ sph_dec32le_aligned(x + 4 * (i + 3)); - state[i + 4] = sc->state[i + 4] - ^ sph_dec32le_aligned(x + 4 * (i + 4)); - state[i + 5] = sc->state[i + 5] - ^ sph_dec32le_aligned(x + 4 * (i + 5)); - state[i + 6] = sc->state[i + 6] - ^ sph_dec32le_aligned(x + 4 * (i + 6)); - state[i + 7] = sc->state[i + 7] - ^ sph_dec32le_aligned(x + 4 * (i + 7)); - } - -#define WBREAD(sb, o1, o2, mm) do { \ - for (u = 0; u < 64; u += 8) { \ - size_t v = wbp[(u >> 3) + (sb)]; \ - w[u + 0] = INNER(q[v + 2 * 0 + (o1)], \ - q[v + 2 * 0 + (o2)], mm); \ - w[u + 1] = INNER(q[v + 2 * 1 + (o1)], \ - q[v + 2 * 1 + (o2)], mm); \ - w[u + 2] = INNER(q[v + 2 * 2 + (o1)], \ - q[v + 2 * 2 + (o2)], mm); \ - w[u + 3] = INNER(q[v + 2 * 3 + (o1)], \ - q[v + 2 * 3 + (o2)], mm); \ - w[u + 4] = INNER(q[v + 2 * 4 + (o1)], \ - q[v + 2 * 4 + (o2)], mm); \ - w[u + 5] = INNER(q[v + 2 * 5 + (o1)], \ - q[v + 2 * 5 + (o2)], mm); \ - w[u + 6] = INNER(q[v + 2 * 6 + (o1)], \ - q[v + 2 * 6 + (o2)], mm); \ - w[u + 7] = INNER(q[v + 2 * 7 + (o1)], \ - q[v + 2 * 7 + (o2)], mm); \ - } \ - } while (0) - - WBREAD( 0, 0, 1, 185); - one_round_big(state, w, 0, 3, 23, 17, 27); - WBREAD( 8, 0, 1, 185); - one_round_big(state, w, 1, 28, 19, 22, 7); - WBREAD(16, -256, -128, 233); - one_round_big(state, w, 2, 29, 9, 15, 5); - WBREAD(24, -383, -255, 233); - one_round_big(state, w, 3, 4, 13, 10, 25); - -#undef WBREAD - - STEP_BIG( - sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 4, 13, PP8_4_); - STEP_BIG( - sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 13, 10, PP8_5_); - STEP_BIG( - sc->state[16], sc->state[17], sc->state[18], sc->state[19], - sc->state[20], sc->state[21], sc->state[22], sc->state[23], - IF, 10, 25, PP8_6_); - STEP_BIG( - sc->state[24], sc->state[25], sc->state[26], sc->state[27], - sc->state[28], sc->state[29], sc->state[30], sc->state[31], - IF, 25, 4, PP8_0_); - - memcpy(sc->state, state, sizeof state); -} - -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef A4 -#undef A5 -#undef A6 -#undef A7 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef B4 -#undef B5 -#undef B6 -#undef B7 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef C4 -#undef C5 -#undef C6 -#undef C7 -#undef D0 -#undef D1 -#undef D2 -#undef D3 -#undef D4 -#undef D5 -#undef D6 -#undef D7 - -#else - -#if SPH_SIMD_NOCOPY -#define A0 (sc->state[ 0]) -#define A1 (sc->state[ 1]) -#define A2 (sc->state[ 2]) -#define A3 (sc->state[ 3]) -#define A4 (sc->state[ 4]) -#define A5 (sc->state[ 5]) -#define A6 (sc->state[ 6]) -#define A7 (sc->state[ 7]) -#define B0 (sc->state[ 8]) -#define B1 (sc->state[ 9]) -#define B2 (sc->state[10]) -#define B3 (sc->state[11]) -#define B4 (sc->state[12]) -#define B5 (sc->state[13]) -#define B6 (sc->state[14]) -#define B7 (sc->state[15]) -#define C0 (sc->state[16]) -#define C1 (sc->state[17]) -#define C2 (sc->state[18]) -#define C3 (sc->state[19]) -#define C4 (sc->state[20]) -#define C5 (sc->state[21]) -#define C6 (sc->state[22]) -#define C7 (sc->state[23]) -#define D0 (sc->state[24]) -#define D1 (sc->state[25]) -#define D2 (sc->state[26]) -#define D3 (sc->state[27]) -#define D4 (sc->state[28]) -#define D5 (sc->state[29]) -#define D6 (sc->state[30]) -#define D7 (sc->state[31]) -#endif - -static void -compress_big(sph_simd_big_context *sc, int last) -{ - unsigned char *x; - s32 q[256]; - int i; - DECL_STATE_BIG -#if SPH_SIMD_NOCOPY - sph_u32 saved[32]; -#endif - -#if SPH_SIMD_NOCOPY - memcpy(saved, sc->state, sizeof saved); -#endif - - x = sc->buf; - FFT256(0, 1, 0, ll); - if (last) { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_f[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } else { - for (i = 0; i < 256; i ++) { - s32 tq; - - tq = q[i] + yoff_b_n[i]; - tq = REDS2(tq); - tq = REDS1(tq); - tq = REDS1(tq); - q[i] = (tq <= 128 ? tq : tq - 257); - } - } - READ_STATE_BIG(sc); - A0 ^= sph_dec32le_aligned(x + 0); - A1 ^= sph_dec32le_aligned(x + 4); - A2 ^= sph_dec32le_aligned(x + 8); - A3 ^= sph_dec32le_aligned(x + 12); - A4 ^= sph_dec32le_aligned(x + 16); - A5 ^= sph_dec32le_aligned(x + 20); - A6 ^= sph_dec32le_aligned(x + 24); - A7 ^= sph_dec32le_aligned(x + 28); - B0 ^= sph_dec32le_aligned(x + 32); - B1 ^= sph_dec32le_aligned(x + 36); - B2 ^= sph_dec32le_aligned(x + 40); - B3 ^= sph_dec32le_aligned(x + 44); - B4 ^= sph_dec32le_aligned(x + 48); - B5 ^= sph_dec32le_aligned(x + 52); - B6 ^= sph_dec32le_aligned(x + 56); - B7 ^= sph_dec32le_aligned(x + 60); - C0 ^= sph_dec32le_aligned(x + 64); - C1 ^= sph_dec32le_aligned(x + 68); - C2 ^= sph_dec32le_aligned(x + 72); - C3 ^= sph_dec32le_aligned(x + 76); - C4 ^= sph_dec32le_aligned(x + 80); - C5 ^= sph_dec32le_aligned(x + 84); - C6 ^= sph_dec32le_aligned(x + 88); - C7 ^= sph_dec32le_aligned(x + 92); - D0 ^= sph_dec32le_aligned(x + 96); - D1 ^= sph_dec32le_aligned(x + 100); - D2 ^= sph_dec32le_aligned(x + 104); - D3 ^= sph_dec32le_aligned(x + 108); - D4 ^= sph_dec32le_aligned(x + 112); - D5 ^= sph_dec32le_aligned(x + 116); - D6 ^= sph_dec32le_aligned(x + 120); - D7 ^= sph_dec32le_aligned(x + 124); - - ONE_ROUND_BIG(0_, 0, 3, 23, 17, 27); - ONE_ROUND_BIG(1_, 1, 28, 19, 22, 7); - ONE_ROUND_BIG(2_, 2, 29, 9, 15, 5); - ONE_ROUND_BIG(3_, 3, 4, 13, 10, 25); -#if SPH_SIMD_NOCOPY - STEP_BIG( - saved[ 0], saved[ 1], saved[ 2], saved[ 3], - saved[ 4], saved[ 5], saved[ 6], saved[ 7], - IF, 4, 13, PP8_4_); - STEP_BIG( - saved[ 8], saved[ 9], saved[10], saved[11], - saved[12], saved[13], saved[14], saved[15], - IF, 13, 10, PP8_5_); - STEP_BIG( - saved[16], saved[17], saved[18], saved[19], - saved[20], saved[21], saved[22], saved[23], - IF, 10, 25, PP8_6_); - STEP_BIG( - saved[24], saved[25], saved[26], saved[27], - saved[28], saved[29], saved[30], saved[31], - IF, 25, 4, PP8_0_); -#else - STEP_BIG( - sc->state[ 0], sc->state[ 1], sc->state[ 2], sc->state[ 3], - sc->state[ 4], sc->state[ 5], sc->state[ 6], sc->state[ 7], - IF, 4, 13, PP8_4_); - STEP_BIG( - sc->state[ 8], sc->state[ 9], sc->state[10], sc->state[11], - sc->state[12], sc->state[13], sc->state[14], sc->state[15], - IF, 13, 10, PP8_5_); - STEP_BIG( - sc->state[16], sc->state[17], sc->state[18], sc->state[19], - sc->state[20], sc->state[21], sc->state[22], sc->state[23], - IF, 10, 25, PP8_6_); - STEP_BIG( - sc->state[24], sc->state[25], sc->state[26], sc->state[27], - sc->state[28], sc->state[29], sc->state[30], sc->state[31], - IF, 25, 4, PP8_0_); - WRITE_STATE_BIG(sc); -#endif -} - -#if SPH_SIMD_NOCOPY -#undef A0 -#undef A1 -#undef A2 -#undef A3 -#undef A4 -#undef A5 -#undef A6 -#undef A7 -#undef B0 -#undef B1 -#undef B2 -#undef B3 -#undef B4 -#undef B5 -#undef B6 -#undef B7 -#undef C0 -#undef C1 -#undef C2 -#undef C3 -#undef C4 -#undef C5 -#undef C6 -#undef C7 -#undef D0 -#undef D1 -#undef D2 -#undef D3 -#undef D4 -#undef D5 -#undef D6 -#undef D7 -#endif - -#endif - -static const u32 IV224[] = { - C32(0x33586E9F), C32(0x12FFF033), C32(0xB2D9F64D), C32(0x6F8FEA53), - C32(0xDE943106), C32(0x2742E439), C32(0x4FBAB5AC), C32(0x62B9FF96), - C32(0x22E7B0AF), C32(0xC862B3A8), C32(0x33E00CDC), C32(0x236B86A6), - C32(0xF64AE77C), C32(0xFA373B76), C32(0x7DC1EE5B), C32(0x7FB29CE8) -}; - -static const u32 IV256[] = { - C32(0x4D567983), C32(0x07190BA9), C32(0x8474577B), C32(0x39D726E9), - C32(0xAAF3D925), C32(0x3EE20B03), C32(0xAFD5E751), C32(0xC96006D3), - C32(0xC2C2BA14), C32(0x49B3BCB4), C32(0xF67CAF46), C32(0x668626C9), - C32(0xE2EAA8D2), C32(0x1FF47833), C32(0xD0C661A5), C32(0x55693DE1) -}; - -static const u32 IV384[] = { - C32(0x8A36EEBC), C32(0x94A3BD90), C32(0xD1537B83), C32(0xB25B070B), - C32(0xF463F1B5), C32(0xB6F81E20), C32(0x0055C339), C32(0xB4D144D1), - C32(0x7360CA61), C32(0x18361A03), C32(0x17DCB4B9), C32(0x3414C45A), - C32(0xA699A9D2), C32(0xE39E9664), C32(0x468BFE77), C32(0x51D062F8), - C32(0xB9E3BFE8), C32(0x63BECE2A), C32(0x8FE506B9), C32(0xF8CC4AC2), - C32(0x7AE11542), C32(0xB1AADDA1), C32(0x64B06794), C32(0x28D2F462), - C32(0xE64071EC), C32(0x1DEB91A8), C32(0x8AC8DB23), C32(0x3F782AB5), - C32(0x039B5CB8), C32(0x71DDD962), C32(0xFADE2CEA), C32(0x1416DF71) -}; - -static const u32 IV512[] = { - C32(0x0BA16B95), C32(0x72F999AD), C32(0x9FECC2AE), C32(0xBA3264FC), - C32(0x5E894929), C32(0x8E9F30E5), C32(0x2F1DAA37), C32(0xF0F2C558), - C32(0xAC506643), C32(0xA90635A5), C32(0xE25B878B), C32(0xAAB7878F), - C32(0x88817F7A), C32(0x0A02892B), C32(0x559A7550), C32(0x598F657E), - C32(0x7EEF60A1), C32(0x6B70E3E8), C32(0x9C1714D1), C32(0xB958E2A8), - C32(0xAB02675E), C32(0xED1C014F), C32(0xCD8D65BB), C32(0xFDB7A257), - C32(0x09254899), C32(0xD699C7BC), C32(0x9019B6DC), C32(0x2B9022E4), - C32(0x8FA14956), C32(0x21BF9BD3), C32(0xB94D0943), C32(0x6FFDDC22) -}; - -static void -init_small(void *cc, const u32 *iv) -{ - sph_simd_small_context *sc; - - sc = cc; - memcpy(sc->state, iv, sizeof sc->state); - sc->count_low = sc->count_high = 0; - sc->ptr = 0; -} - -static void -init_big(void *cc, const u32 *iv) -{ - sph_simd_big_context *sc; - - sc = cc; - memcpy(sc->state, iv, sizeof sc->state); - sc->count_low = sc->count_high = 0; - sc->ptr = 0; -} - -static void -update_small(void *cc, const void *data, size_t len) -{ - sph_simd_small_context *sc; - - sc = cc; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - sc->ptr; - if (clen > len) - clen = len; - memcpy(sc->buf + sc->ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - if ((sc->ptr += clen) == sizeof sc->buf) { - compress_small(sc, 0); - sc->ptr = 0; - sc->count_low = T32(sc->count_low + 1); - if (sc->count_low == 0) - sc->count_high ++; - } - } -} - -static void -update_big(void *cc, const void *data, size_t len) -{ - sph_simd_big_context *sc; - - sc = cc; - while (len > 0) { - size_t clen; - - clen = (sizeof sc->buf) - sc->ptr; - if (clen > len) - clen = len; - memcpy(sc->buf + sc->ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - if ((sc->ptr += clen) == sizeof sc->buf) { - compress_big(sc, 0); - sc->ptr = 0; - sc->count_low = T32(sc->count_low + 1); - if (sc->count_low == 0) - sc->count_high ++; - } - } -} - -static void -encode_count_small(unsigned char *dst, - u32 low, u32 high, size_t ptr, unsigned n) -{ - low = T32(low << 9); - high = T32(high << 9) + (low >> 23); - low += (ptr << 3) + n; - sph_enc32le(dst, low); - sph_enc32le(dst + 4, high); -} - -static void -encode_count_big(unsigned char *dst, - u32 low, u32 high, size_t ptr, unsigned n) -{ - low = T32(low << 10); - high = T32(high << 10) + (low >> 22); - low += (ptr << 3) + n; - sph_enc32le(dst, low); - sph_enc32le(dst + 4, high); -} - -static void -finalize_small(void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len) -{ - sph_simd_small_context *sc; - unsigned char *d; - size_t u; - - sc = cc; - if (sc->ptr > 0 || n > 0) { - memset(sc->buf + sc->ptr, 0, - (sizeof sc->buf) - sc->ptr); - sc->buf[sc->ptr] = ub & (0xFF << (8 - n)); - compress_small(sc, 0); - } - memset(sc->buf, 0, sizeof sc->buf); - encode_count_small(sc->buf, sc->count_low, sc->count_high, sc->ptr, n); - compress_small(sc, 1); - d = dst; - for (d = dst, u = 0; u < dst_len; u ++) - sph_enc32le(d + (u << 2), sc->state[u]); -} - -static void -finalize_big(void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len) -{ - sph_simd_big_context *sc; - unsigned char *d; - size_t u; - - sc = cc; - if (sc->ptr > 0 || n > 0) { - memset(sc->buf + sc->ptr, 0, - (sizeof sc->buf) - sc->ptr); - sc->buf[sc->ptr] = ub & (0xFF << (8 - n)); - compress_big(sc, 0); - } - memset(sc->buf, 0, sizeof sc->buf); - encode_count_big(sc->buf, sc->count_low, sc->count_high, sc->ptr, n); - compress_big(sc, 1); - d = dst; - for (d = dst, u = 0; u < dst_len; u ++) - sph_enc32le(d + (u << 2), sc->state[u]); -} - -void -sph_simd224_init(void *cc) -{ - init_small(cc, IV224); -} - -void -sph_simd224(void *cc, const void *data, size_t len) -{ - update_small(cc, data, len); -} - -void -sph_simd224_close(void *cc, void *dst) -{ - sph_simd224_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_small(cc, ub, n, dst, 7); - sph_simd224_init(cc); -} - -void -sph_simd256_init(void *cc) -{ - init_small(cc, IV256); -} - -void -sph_simd256(void *cc, const void *data, size_t len) -{ - update_small(cc, data, len); -} - -void -sph_simd256_close(void *cc, void *dst) -{ - sph_simd256_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_small(cc, ub, n, dst, 8); - sph_simd256_init(cc); -} - -void -sph_simd384_init(void *cc) -{ - init_big(cc, IV384); -} - -void -sph_simd384(void *cc, const void *data, size_t len) -{ - update_big(cc, data, len); -} - -void -sph_simd384_close(void *cc, void *dst) -{ - sph_simd384_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_big(cc, ub, n, dst, 12); - sph_simd384_init(cc); -} - -void -sph_simd512_init(void *cc) -{ - init_big(cc, IV512); -} - -void -sph_simd512(void *cc, const void *data, size_t len) -{ - update_big(cc, data, len); -} - -void -sph_simd512_close(void *cc, void *dst) -{ - sph_simd512_addbits_and_close(cc, 0, 0, dst); -} - -void -sph_simd512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - finalize_big(cc, ub, n, dst, 16); - sph_simd512_init(cc); -} -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/src/crypto/skein.c b/src/crypto/skein.c deleted file mode 100644 index 7e47e3522..000000000 --- a/src/crypto/skein.c +++ /dev/null @@ -1,1254 +0,0 @@ -/* $Id: skein.c 254 2011-06-07 19:38:58Z tp $ */ -/* - * Skein implementation. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @author Thomas Pornin - */ - -#include -#include - -#include "sph_skein.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -#if SPH_SMALL_FOOTPRINT && !defined SPH_SMALL_FOOTPRINT_SKEIN -#define SPH_SMALL_FOOTPRINT_SKEIN 1 -#endif - -#ifdef _MSC_VER -#pragma warning (disable: 4146) -#endif - -#if SPH_64 - -#if 0 -/* obsolete */ -/* - * M5_ ## s ## _ ## i evaluates to s+i mod 5 (0 <= s <= 18, 0 <= i <= 3). - */ - -#define M5_0_0 0 -#define M5_0_1 1 -#define M5_0_2 2 -#define M5_0_3 3 - -#define M5_1_0 1 -#define M5_1_1 2 -#define M5_1_2 3 -#define M5_1_3 4 - -#define M5_2_0 2 -#define M5_2_1 3 -#define M5_2_2 4 -#define M5_2_3 0 - -#define M5_3_0 3 -#define M5_3_1 4 -#define M5_3_2 0 -#define M5_3_3 1 - -#define M5_4_0 4 -#define M5_4_1 0 -#define M5_4_2 1 -#define M5_4_3 2 - -#define M5_5_0 0 -#define M5_5_1 1 -#define M5_5_2 2 -#define M5_5_3 3 - -#define M5_6_0 1 -#define M5_6_1 2 -#define M5_6_2 3 -#define M5_6_3 4 - -#define M5_7_0 2 -#define M5_7_1 3 -#define M5_7_2 4 -#define M5_7_3 0 - -#define M5_8_0 3 -#define M5_8_1 4 -#define M5_8_2 0 -#define M5_8_3 1 - -#define M5_9_0 4 -#define M5_9_1 0 -#define M5_9_2 1 -#define M5_9_3 2 - -#define M5_10_0 0 -#define M5_10_1 1 -#define M5_10_2 2 -#define M5_10_3 3 - -#define M5_11_0 1 -#define M5_11_1 2 -#define M5_11_2 3 -#define M5_11_3 4 - -#define M5_12_0 2 -#define M5_12_1 3 -#define M5_12_2 4 -#define M5_12_3 0 - -#define M5_13_0 3 -#define M5_13_1 4 -#define M5_13_2 0 -#define M5_13_3 1 - -#define M5_14_0 4 -#define M5_14_1 0 -#define M5_14_2 1 -#define M5_14_3 2 - -#define M5_15_0 0 -#define M5_15_1 1 -#define M5_15_2 2 -#define M5_15_3 3 - -#define M5_16_0 1 -#define M5_16_1 2 -#define M5_16_2 3 -#define M5_16_3 4 - -#define M5_17_0 2 -#define M5_17_1 3 -#define M5_17_2 4 -#define M5_17_3 0 - -#define M5_18_0 3 -#define M5_18_1 4 -#define M5_18_2 0 -#define M5_18_3 1 -#endif - -/* - * M9_ ## s ## _ ## i evaluates to s+i mod 9 (0 <= s <= 18, 0 <= i <= 7). - */ - -#define M9_0_0 0 -#define M9_0_1 1 -#define M9_0_2 2 -#define M9_0_3 3 -#define M9_0_4 4 -#define M9_0_5 5 -#define M9_0_6 6 -#define M9_0_7 7 - -#define M9_1_0 1 -#define M9_1_1 2 -#define M9_1_2 3 -#define M9_1_3 4 -#define M9_1_4 5 -#define M9_1_5 6 -#define M9_1_6 7 -#define M9_1_7 8 - -#define M9_2_0 2 -#define M9_2_1 3 -#define M9_2_2 4 -#define M9_2_3 5 -#define M9_2_4 6 -#define M9_2_5 7 -#define M9_2_6 8 -#define M9_2_7 0 - -#define M9_3_0 3 -#define M9_3_1 4 -#define M9_3_2 5 -#define M9_3_3 6 -#define M9_3_4 7 -#define M9_3_5 8 -#define M9_3_6 0 -#define M9_3_7 1 - -#define M9_4_0 4 -#define M9_4_1 5 -#define M9_4_2 6 -#define M9_4_3 7 -#define M9_4_4 8 -#define M9_4_5 0 -#define M9_4_6 1 -#define M9_4_7 2 - -#define M9_5_0 5 -#define M9_5_1 6 -#define M9_5_2 7 -#define M9_5_3 8 -#define M9_5_4 0 -#define M9_5_5 1 -#define M9_5_6 2 -#define M9_5_7 3 - -#define M9_6_0 6 -#define M9_6_1 7 -#define M9_6_2 8 -#define M9_6_3 0 -#define M9_6_4 1 -#define M9_6_5 2 -#define M9_6_6 3 -#define M9_6_7 4 - -#define M9_7_0 7 -#define M9_7_1 8 -#define M9_7_2 0 -#define M9_7_3 1 -#define M9_7_4 2 -#define M9_7_5 3 -#define M9_7_6 4 -#define M9_7_7 5 - -#define M9_8_0 8 -#define M9_8_1 0 -#define M9_8_2 1 -#define M9_8_3 2 -#define M9_8_4 3 -#define M9_8_5 4 -#define M9_8_6 5 -#define M9_8_7 6 - -#define M9_9_0 0 -#define M9_9_1 1 -#define M9_9_2 2 -#define M9_9_3 3 -#define M9_9_4 4 -#define M9_9_5 5 -#define M9_9_6 6 -#define M9_9_7 7 - -#define M9_10_0 1 -#define M9_10_1 2 -#define M9_10_2 3 -#define M9_10_3 4 -#define M9_10_4 5 -#define M9_10_5 6 -#define M9_10_6 7 -#define M9_10_7 8 - -#define M9_11_0 2 -#define M9_11_1 3 -#define M9_11_2 4 -#define M9_11_3 5 -#define M9_11_4 6 -#define M9_11_5 7 -#define M9_11_6 8 -#define M9_11_7 0 - -#define M9_12_0 3 -#define M9_12_1 4 -#define M9_12_2 5 -#define M9_12_3 6 -#define M9_12_4 7 -#define M9_12_5 8 -#define M9_12_6 0 -#define M9_12_7 1 - -#define M9_13_0 4 -#define M9_13_1 5 -#define M9_13_2 6 -#define M9_13_3 7 -#define M9_13_4 8 -#define M9_13_5 0 -#define M9_13_6 1 -#define M9_13_7 2 - -#define M9_14_0 5 -#define M9_14_1 6 -#define M9_14_2 7 -#define M9_14_3 8 -#define M9_14_4 0 -#define M9_14_5 1 -#define M9_14_6 2 -#define M9_14_7 3 - -#define M9_15_0 6 -#define M9_15_1 7 -#define M9_15_2 8 -#define M9_15_3 0 -#define M9_15_4 1 -#define M9_15_5 2 -#define M9_15_6 3 -#define M9_15_7 4 - -#define M9_16_0 7 -#define M9_16_1 8 -#define M9_16_2 0 -#define M9_16_3 1 -#define M9_16_4 2 -#define M9_16_5 3 -#define M9_16_6 4 -#define M9_16_7 5 - -#define M9_17_0 8 -#define M9_17_1 0 -#define M9_17_2 1 -#define M9_17_3 2 -#define M9_17_4 3 -#define M9_17_5 4 -#define M9_17_6 5 -#define M9_17_7 6 - -#define M9_18_0 0 -#define M9_18_1 1 -#define M9_18_2 2 -#define M9_18_3 3 -#define M9_18_4 4 -#define M9_18_5 5 -#define M9_18_6 6 -#define M9_18_7 7 - -/* - * M3_ ## s ## _ ## i evaluates to s+i mod 3 (0 <= s <= 18, 0 <= i <= 1). - */ - -#define M3_0_0 0 -#define M3_0_1 1 -#define M3_1_0 1 -#define M3_1_1 2 -#define M3_2_0 2 -#define M3_2_1 0 -#define M3_3_0 0 -#define M3_3_1 1 -#define M3_4_0 1 -#define M3_4_1 2 -#define M3_5_0 2 -#define M3_5_1 0 -#define M3_6_0 0 -#define M3_6_1 1 -#define M3_7_0 1 -#define M3_7_1 2 -#define M3_8_0 2 -#define M3_8_1 0 -#define M3_9_0 0 -#define M3_9_1 1 -#define M3_10_0 1 -#define M3_10_1 2 -#define M3_11_0 2 -#define M3_11_1 0 -#define M3_12_0 0 -#define M3_12_1 1 -#define M3_13_0 1 -#define M3_13_1 2 -#define M3_14_0 2 -#define M3_14_1 0 -#define M3_15_0 0 -#define M3_15_1 1 -#define M3_16_0 1 -#define M3_16_1 2 -#define M3_17_0 2 -#define M3_17_1 0 -#define M3_18_0 0 -#define M3_18_1 1 - -#define XCAT(x, y) XCAT_(x, y) -#define XCAT_(x, y) x ## y - -#if 0 -/* obsolete */ -#define SKSI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M5_, s), _), i)) -#define SKST(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) -#endif - -#define SKBI(k, s, i) XCAT(k, XCAT(XCAT(XCAT(M9_, s), _), i)) -#define SKBT(t, s, v) XCAT(t, XCAT(XCAT(XCAT(M3_, s), _), v)) - -#if 0 -/* obsolete */ -#define TFSMALL_KINIT(k0, k1, k2, k3, k4, t0, t1, t2) do { \ - k4 = (k0 ^ k1) ^ (k2 ^ k3) ^ SPH_C64(0x1BD11BDAA9FC1A22); \ - t2 = t0 ^ t1; \ - } while (0) -#endif - -#define TFBIG_KINIT(k0, k1, k2, k3, k4, k5, k6, k7, k8, t0, t1, t2) do { \ - k8 = ((k0 ^ k1) ^ (k2 ^ k3)) ^ ((k4 ^ k5) ^ (k6 ^ k7)) \ - ^ SPH_C64(0x1BD11BDAA9FC1A22); \ - t2 = t0 ^ t1; \ - } while (0) - -#if 0 -/* obsolete */ -#define TFSMALL_ADDKEY(w0, w1, w2, w3, k, t, s) do { \ - w0 = SPH_T64(w0 + SKSI(k, s, 0)); \ - w1 = SPH_T64(w1 + SKSI(k, s, 1) + SKST(t, s, 0)); \ - w2 = SPH_T64(w2 + SKSI(k, s, 2) + SKST(t, s, 1)); \ - w3 = SPH_T64(w3 + SKSI(k, s, 3) + (sph_u64)s); \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define TFBIG_ADDKEY(s, tt0, tt1) do { \ - p0 = SPH_T64(p0 + h[s + 0]); \ - p1 = SPH_T64(p1 + h[s + 1]); \ - p2 = SPH_T64(p2 + h[s + 2]); \ - p3 = SPH_T64(p3 + h[s + 3]); \ - p4 = SPH_T64(p4 + h[s + 4]); \ - p5 = SPH_T64(p5 + h[s + 5] + tt0); \ - p6 = SPH_T64(p6 + h[s + 6] + tt1); \ - p7 = SPH_T64(p7 + h[s + 7] + (sph_u64)s); \ - } while (0) - -#else - -#define TFBIG_ADDKEY(w0, w1, w2, w3, w4, w5, w6, w7, k, t, s) do { \ - w0 = SPH_T64(w0 + SKBI(k, s, 0)); \ - w1 = SPH_T64(w1 + SKBI(k, s, 1)); \ - w2 = SPH_T64(w2 + SKBI(k, s, 2)); \ - w3 = SPH_T64(w3 + SKBI(k, s, 3)); \ - w4 = SPH_T64(w4 + SKBI(k, s, 4)); \ - w5 = SPH_T64(w5 + SKBI(k, s, 5) + SKBT(t, s, 0)); \ - w6 = SPH_T64(w6 + SKBI(k, s, 6) + SKBT(t, s, 1)); \ - w7 = SPH_T64(w7 + SKBI(k, s, 7) + (sph_u64)s); \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -#define TFSMALL_MIX(x0, x1, rc) do { \ - x0 = SPH_T64(x0 + x1); \ - x1 = SPH_ROTL64(x1, rc) ^ x0; \ - } while (0) -#endif - -#define TFBIG_MIX(x0, x1, rc) do { \ - x0 = SPH_T64(x0 + x1); \ - x1 = SPH_ROTL64(x1, rc) ^ x0; \ - } while (0) - -#if 0 -/* obsolete */ -#define TFSMALL_MIX4(w0, w1, w2, w3, rc0, rc1) do { \ - TFSMALL_MIX(w0, w1, rc0); \ - TFSMALL_MIX(w2, w3, rc1); \ - } while (0) -#endif - -#define TFBIG_MIX8(w0, w1, w2, w3, w4, w5, w6, w7, rc0, rc1, rc2, rc3) do { \ - TFBIG_MIX(w0, w1, rc0); \ - TFBIG_MIX(w2, w3, rc1); \ - TFBIG_MIX(w4, w5, rc2); \ - TFBIG_MIX(w6, w7, rc3); \ - } while (0) - -#if 0 -/* obsolete */ -#define TFSMALL_4e(s) do { \ - TFSMALL_ADDKEY(p0, p1, p2, p3, h, t, s); \ - TFSMALL_MIX4(p0, p1, p2, p3, 14, 16); \ - TFSMALL_MIX4(p0, p3, p2, p1, 52, 57); \ - TFSMALL_MIX4(p0, p1, p2, p3, 23, 40); \ - TFSMALL_MIX4(p0, p3, p2, p1, 5, 37); \ - } while (0) - -#define TFSMALL_4o(s) do { \ - TFSMALL_ADDKEY(p0, p1, p2, p3, h, t, s); \ - TFSMALL_MIX4(p0, p1, p2, p3, 25, 33); \ - TFSMALL_MIX4(p0, p3, p2, p1, 46, 12); \ - TFSMALL_MIX4(p0, p1, p2, p3, 58, 22); \ - TFSMALL_MIX4(p0, p3, p2, p1, 32, 32); \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define TFBIG_4e(s) do { \ - TFBIG_ADDKEY(s, t0, t1); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); \ - } while (0) - -#define TFBIG_4o(s) do { \ - TFBIG_ADDKEY(s, t1, t2); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); \ - } while (0) - -#else - -#define TFBIG_4e(s) do { \ - TFBIG_ADDKEY(p0, p1, p2, p3, p4, p5, p6, p7, h, t, s); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 46, 36, 19, 37); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 33, 27, 14, 42); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 17, 49, 36, 39); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 44, 9, 54, 56); \ - } while (0) - -#define TFBIG_4o(s) do { \ - TFBIG_ADDKEY(p0, p1, p2, p3, p4, p5, p6, p7, h, t, s); \ - TFBIG_MIX8(p0, p1, p2, p3, p4, p5, p6, p7, 39, 30, 34, 24); \ - TFBIG_MIX8(p2, p1, p4, p7, p6, p5, p0, p3, 13, 50, 10, 17); \ - TFBIG_MIX8(p4, p1, p6, p3, p0, p5, p2, p7, 25, 29, 39, 43); \ - TFBIG_MIX8(p6, p1, p0, p7, p2, p5, p4, p3, 8, 35, 56, 22); \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -#define UBI_SMALL(etype, extra) do { \ - sph_u64 h4, t0, t1, t2; \ - sph_u64 m0 = sph_dec64le(buf + 0); \ - sph_u64 m1 = sph_dec64le(buf + 8); \ - sph_u64 m2 = sph_dec64le(buf + 16); \ - sph_u64 m3 = sph_dec64le(buf + 24); \ - sph_u64 p0 = m0; \ - sph_u64 p1 = m1; \ - sph_u64 p2 = m2; \ - sph_u64 p3 = m3; \ - t0 = SPH_T64(bcount << 5) + (sph_u64)(extra); \ - t1 = (bcount >> 59) + ((sph_u64)(etype) << 55); \ - TFSMALL_KINIT(h0, h1, h2, h3, h4, t0, t1, t2); \ - TFSMALL_4e(0); \ - TFSMALL_4o(1); \ - TFSMALL_4e(2); \ - TFSMALL_4o(3); \ - TFSMALL_4e(4); \ - TFSMALL_4o(5); \ - TFSMALL_4e(6); \ - TFSMALL_4o(7); \ - TFSMALL_4e(8); \ - TFSMALL_4o(9); \ - TFSMALL_4e(10); \ - TFSMALL_4o(11); \ - TFSMALL_4e(12); \ - TFSMALL_4o(13); \ - TFSMALL_4e(14); \ - TFSMALL_4o(15); \ - TFSMALL_4e(16); \ - TFSMALL_4o(17); \ - TFSMALL_ADDKEY(p0, p1, p2, p3, h, t, 18); \ - h0 = m0 ^ p0; \ - h1 = m1 ^ p1; \ - h2 = m2 ^ p2; \ - h3 = m3 ^ p3; \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define UBI_BIG(etype, extra) do { \ - sph_u64 t0, t1, t2; \ - unsigned u; \ - sph_u64 m0 = sph_dec64le_aligned(buf + 0); \ - sph_u64 m1 = sph_dec64le_aligned(buf + 8); \ - sph_u64 m2 = sph_dec64le_aligned(buf + 16); \ - sph_u64 m3 = sph_dec64le_aligned(buf + 24); \ - sph_u64 m4 = sph_dec64le_aligned(buf + 32); \ - sph_u64 m5 = sph_dec64le_aligned(buf + 40); \ - sph_u64 m6 = sph_dec64le_aligned(buf + 48); \ - sph_u64 m7 = sph_dec64le_aligned(buf + 56); \ - sph_u64 p0 = m0; \ - sph_u64 p1 = m1; \ - sph_u64 p2 = m2; \ - sph_u64 p3 = m3; \ - sph_u64 p4 = m4; \ - sph_u64 p5 = m5; \ - sph_u64 p6 = m6; \ - sph_u64 p7 = m7; \ - t0 = SPH_T64(bcount << 6) + (sph_u64)(extra); \ - t1 = (bcount >> 58) + ((sph_u64)(etype) << 55); \ - TFBIG_KINIT(h[0], h[1], h[2], h[3], h[4], h[5], \ - h[6], h[7], h[8], t0, t1, t2); \ - for (u = 0; u <= 15; u += 3) { \ - h[u + 9] = h[u + 0]; \ - h[u + 10] = h[u + 1]; \ - h[u + 11] = h[u + 2]; \ - } \ - for (u = 0; u < 9; u ++) { \ - sph_u64 s = u << 1; \ - sph_u64 tmp; \ - TFBIG_4e(s); \ - TFBIG_4o(s + 1); \ - tmp = t2; \ - t2 = t1; \ - t1 = t0; \ - t0 = tmp; \ - } \ - TFBIG_ADDKEY(18, t0, t1); \ - h[0] = m0 ^ p0; \ - h[1] = m1 ^ p1; \ - h[2] = m2 ^ p2; \ - h[3] = m3 ^ p3; \ - h[4] = m4 ^ p4; \ - h[5] = m5 ^ p5; \ - h[6] = m6 ^ p6; \ - h[7] = m7 ^ p7; \ - } while (0) - -#else - -#define UBI_BIG(etype, extra) do { \ - sph_u64 h8, t0, t1, t2; \ - sph_u64 m0 = sph_dec64le_aligned(buf + 0); \ - sph_u64 m1 = sph_dec64le_aligned(buf + 8); \ - sph_u64 m2 = sph_dec64le_aligned(buf + 16); \ - sph_u64 m3 = sph_dec64le_aligned(buf + 24); \ - sph_u64 m4 = sph_dec64le_aligned(buf + 32); \ - sph_u64 m5 = sph_dec64le_aligned(buf + 40); \ - sph_u64 m6 = sph_dec64le_aligned(buf + 48); \ - sph_u64 m7 = sph_dec64le_aligned(buf + 56); \ - sph_u64 p0 = m0; \ - sph_u64 p1 = m1; \ - sph_u64 p2 = m2; \ - sph_u64 p3 = m3; \ - sph_u64 p4 = m4; \ - sph_u64 p5 = m5; \ - sph_u64 p6 = m6; \ - sph_u64 p7 = m7; \ - t0 = SPH_T64(bcount << 6) + (sph_u64)(extra); \ - t1 = (bcount >> 58) + ((sph_u64)(etype) << 55); \ - TFBIG_KINIT(h0, h1, h2, h3, h4, h5, h6, h7, h8, t0, t1, t2); \ - TFBIG_4e(0); \ - TFBIG_4o(1); \ - TFBIG_4e(2); \ - TFBIG_4o(3); \ - TFBIG_4e(4); \ - TFBIG_4o(5); \ - TFBIG_4e(6); \ - TFBIG_4o(7); \ - TFBIG_4e(8); \ - TFBIG_4o(9); \ - TFBIG_4e(10); \ - TFBIG_4o(11); \ - TFBIG_4e(12); \ - TFBIG_4o(13); \ - TFBIG_4e(14); \ - TFBIG_4o(15); \ - TFBIG_4e(16); \ - TFBIG_4o(17); \ - TFBIG_ADDKEY(p0, p1, p2, p3, p4, p5, p6, p7, h, t, 18); \ - h0 = m0 ^ p0; \ - h1 = m1 ^ p1; \ - h2 = m2 ^ p2; \ - h3 = m3 ^ p3; \ - h4 = m4 ^ p4; \ - h5 = m5 ^ p5; \ - h6 = m6 ^ p6; \ - h7 = m7 ^ p7; \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -#define DECL_STATE_SMALL \ - sph_u64 h0, h1, h2, h3; \ - sph_u64 bcount; - -#define READ_STATE_SMALL(sc) do { \ - h0 = (sc)->h0; \ - h1 = (sc)->h1; \ - h2 = (sc)->h2; \ - h3 = (sc)->h3; \ - bcount = sc->bcount; \ - } while (0) - -#define WRITE_STATE_SMALL(sc) do { \ - (sc)->h0 = h0; \ - (sc)->h1 = h1; \ - (sc)->h2 = h2; \ - (sc)->h3 = h3; \ - sc->bcount = bcount; \ - } while (0) -#endif - -#if SPH_SMALL_FOOTPRINT_SKEIN - -#define DECL_STATE_BIG \ - sph_u64 h[27]; \ - sph_u64 bcount; - -#define READ_STATE_BIG(sc) do { \ - h[0] = (sc)->h0; \ - h[1] = (sc)->h1; \ - h[2] = (sc)->h2; \ - h[3] = (sc)->h3; \ - h[4] = (sc)->h4; \ - h[5] = (sc)->h5; \ - h[6] = (sc)->h6; \ - h[7] = (sc)->h7; \ - bcount = sc->bcount; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - (sc)->h0 = h[0]; \ - (sc)->h1 = h[1]; \ - (sc)->h2 = h[2]; \ - (sc)->h3 = h[3]; \ - (sc)->h4 = h[4]; \ - (sc)->h5 = h[5]; \ - (sc)->h6 = h[6]; \ - (sc)->h7 = h[7]; \ - sc->bcount = bcount; \ - } while (0) - -#else - -#define DECL_STATE_BIG \ - sph_u64 h0, h1, h2, h3, h4, h5, h6, h7; \ - sph_u64 bcount; - -#define READ_STATE_BIG(sc) do { \ - h0 = (sc)->h0; \ - h1 = (sc)->h1; \ - h2 = (sc)->h2; \ - h3 = (sc)->h3; \ - h4 = (sc)->h4; \ - h5 = (sc)->h5; \ - h6 = (sc)->h6; \ - h7 = (sc)->h7; \ - bcount = sc->bcount; \ - } while (0) - -#define WRITE_STATE_BIG(sc) do { \ - (sc)->h0 = h0; \ - (sc)->h1 = h1; \ - (sc)->h2 = h2; \ - (sc)->h3 = h3; \ - (sc)->h4 = h4; \ - (sc)->h5 = h5; \ - (sc)->h6 = h6; \ - (sc)->h7 = h7; \ - sc->bcount = bcount; \ - } while (0) - -#endif - -#if 0 -/* obsolete */ -static void -skein_small_init(sph_skein_small_context *sc, const sph_u64 *iv) -{ - sc->h0 = iv[0]; - sc->h1 = iv[1]; - sc->h2 = iv[2]; - sc->h3 = iv[3]; - sc->bcount = 0; - sc->ptr = 0; -} -#endif - -static void -skein_big_init(sph_skein_big_context *sc, const sph_u64 *iv) -{ - sc->h0 = iv[0]; - sc->h1 = iv[1]; - sc->h2 = iv[2]; - sc->h3 = iv[3]; - sc->h4 = iv[4]; - sc->h5 = iv[5]; - sc->h6 = iv[6]; - sc->h7 = iv[7]; - sc->bcount = 0; - sc->ptr = 0; -} - -#if 0 -/* obsolete */ -static void -skein_small_core(sph_skein_small_context *sc, const void *data, size_t len) -{ - unsigned char *buf; - size_t ptr, clen; - unsigned first; - DECL_STATE_SMALL - - buf = sc->buf; - ptr = sc->ptr; - clen = (sizeof sc->buf) - ptr; - if (len <= clen) { - memcpy(buf + ptr, data, len); - sc->ptr = ptr + len; - return; - } - if (clen != 0) { - memcpy(buf + ptr, data, clen); - data = (const unsigned char *)data + clen; - len -= clen; - } - -#if SPH_SMALL_FOOTPRINT_SKEIN - - READ_STATE_SMALL(sc); - first = (bcount == 0) << 7; - for (;;) { - bcount ++; - UBI_SMALL(96 + first, 0); - if (len <= sizeof sc->buf) - break; - first = 0; - memcpy(buf, data, sizeof sc->buf); - data = (const unsigned char *)data + sizeof sc->buf; - len -= sizeof sc->buf; - } - WRITE_STATE_SMALL(sc); - sc->ptr = len; - memcpy(buf, data, len); - -#else - - /* - * Unrolling the loop yields a slight performance boost, while - * keeping the code size aorund 24 kB on 32-bit x86. - */ - READ_STATE_SMALL(sc); - first = (bcount == 0) << 7; - for (;;) { - bcount ++; - UBI_SMALL(96 + first, 0); - if (len <= sizeof sc->buf) - break; - buf = (unsigned char *)data; - bcount ++; - UBI_SMALL(96, 0); - if (len <= 2 * sizeof sc->buf) { - data = buf + sizeof sc->buf; - len -= sizeof sc->buf; - break; - } - buf += sizeof sc->buf; - data = buf + sizeof sc->buf; - first = 0; - len -= 2 * sizeof sc->buf; - } - WRITE_STATE_SMALL(sc); - sc->ptr = len; - memcpy(sc->buf, data, len); - -#endif -} -#endif - -static void -skein_big_core(sph_skein_big_context *sc, const void *data, size_t len) -{ - /* - * The Skein "final bit" in the tweak is troublesome here, - * because if the input has a length which is a multiple of the - * block size (512 bits) then that bit must be set for the - * final block, which is full of message bits (padding in - * Skein can be reduced to no extra bit at all). However, this - * function cannot know whether it processes the last chunks of - * the message or not. Hence we may keep a full block of buffered - * data (64 bytes). - */ - unsigned char *buf; - size_t ptr; - unsigned first; - DECL_STATE_BIG - - buf = sc->buf; - ptr = sc->ptr; - if (len <= (sizeof sc->buf) - ptr) { - memcpy(buf + ptr, data, len); - ptr += len; - sc->ptr = ptr; - return; - } - - READ_STATE_BIG(sc); - first = (bcount == 0) << 7; - do { - size_t clen; - - if (ptr == sizeof sc->buf) { - bcount ++; - UBI_BIG(96 + first, 0); - first = 0; - ptr = 0; - } - clen = (sizeof sc->buf) - ptr; - if (clen > len) - clen = len; - memcpy(buf + ptr, data, clen); - ptr += clen; - data = (const unsigned char *)data + clen; - len -= clen; - } while (len > 0); - WRITE_STATE_BIG(sc); - sc->ptr = ptr; -} - -#if 0 -/* obsolete */ -static void -skein_small_close(sph_skein_small_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_len) -{ - unsigned char *buf; - size_t ptr; - unsigned et; - int i; - DECL_STATE_SMALL - - if (n != 0) { - unsigned z; - unsigned char x; - - z = 0x80 >> n; - x = ((ub & -z) | z) & 0xFF; - skein_small_core(sc, &x, 1); - } - - buf = sc->buf; - ptr = sc->ptr; - READ_STATE_SMALL(sc); - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - et = 352 + ((bcount == 0) << 7) + (n != 0); - for (i = 0; i < 2; i ++) { - UBI_SMALL(et, ptr); - if (i == 0) { - memset(buf, 0, sizeof sc->buf); - bcount = 0; - et = 510; - ptr = 8; - } - } - - sph_enc64le_aligned(buf + 0, h0); - sph_enc64le_aligned(buf + 8, h1); - sph_enc64le_aligned(buf + 16, h2); - sph_enc64le_aligned(buf + 24, h3); - memcpy(dst, buf, out_len); -} -#endif - -static void -skein_big_close(sph_skein_big_context *sc, unsigned ub, unsigned n, - void *dst, size_t out_len) -{ - unsigned char *buf; - size_t ptr; - unsigned et; - int i; -#if SPH_SMALL_FOOTPRINT_SKEIN - size_t u; -#endif - DECL_STATE_BIG - - /* - * Add bit padding if necessary. - */ - if (n != 0) { - unsigned z; - unsigned char x; - - z = 0x80 >> n; - x = ((ub & -z) | z) & 0xFF; - skein_big_core(sc, &x, 1); - } - - buf = sc->buf; - ptr = sc->ptr; - - /* - * At that point, if ptr == 0, then the message was empty; - * otherwise, there is between 1 and 64 bytes (inclusive) which - * are yet to be processed. Either way, we complete the buffer - * to a full block with zeros (the Skein specification mandates - * that an empty message is padded so that there is at least - * one block to process). - * - * Once this block has been processed, we do it again, with - * a block full of zeros, for the output (that block contains - * the encoding of "0", over 8 bytes, then padded with zeros). - */ - READ_STATE_BIG(sc); - memset(buf + ptr, 0, (sizeof sc->buf) - ptr); - et = 352 + ((bcount == 0) << 7) + (n != 0); - for (i = 0; i < 2; i ++) { - UBI_BIG(et, ptr); - if (i == 0) { - memset(buf, 0, sizeof sc->buf); - bcount = 0; - et = 510; - ptr = 8; - } - } - -#if SPH_SMALL_FOOTPRINT_SKEIN - - /* - * We use a temporary buffer because we must support the case - * where output size is not a multiple of 64 (namely, a 224-bit - * output). - */ - for (u = 0; u < out_len; u += 8) - sph_enc64le_aligned(buf + u, h[u >> 3]); - memcpy(dst, buf, out_len); - -#else - - sph_enc64le_aligned(buf + 0, h0); - sph_enc64le_aligned(buf + 8, h1); - sph_enc64le_aligned(buf + 16, h2); - sph_enc64le_aligned(buf + 24, h3); - sph_enc64le_aligned(buf + 32, h4); - sph_enc64le_aligned(buf + 40, h5); - sph_enc64le_aligned(buf + 48, h6); - sph_enc64le_aligned(buf + 56, h7); - memcpy(dst, buf, out_len); - -#endif -} - -#if 0 -/* obsolete */ -static const sph_u64 IV224[] = { - SPH_C64(0xC6098A8C9AE5EA0B), SPH_C64(0x876D568608C5191C), - SPH_C64(0x99CB88D7D7F53884), SPH_C64(0x384BDDB1AEDDB5DE) -}; - -static const sph_u64 IV256[] = { - SPH_C64(0xFC9DA860D048B449), SPH_C64(0x2FCA66479FA7D833), - SPH_C64(0xB33BC3896656840F), SPH_C64(0x6A54E920FDE8DA69) -}; -#endif - -static const sph_u64 IV224[] = { - SPH_C64(0xCCD0616248677224), SPH_C64(0xCBA65CF3A92339EF), - SPH_C64(0x8CCD69D652FF4B64), SPH_C64(0x398AED7B3AB890B4), - SPH_C64(0x0F59D1B1457D2BD0), SPH_C64(0x6776FE6575D4EB3D), - SPH_C64(0x99FBC70E997413E9), SPH_C64(0x9E2CFCCFE1C41EF7) -}; - -static const sph_u64 IV256[] = { - SPH_C64(0xCCD044A12FDB3E13), SPH_C64(0xE83590301A79A9EB), - SPH_C64(0x55AEA0614F816E6F), SPH_C64(0x2A2767A4AE9B94DB), - SPH_C64(0xEC06025E74DD7683), SPH_C64(0xE7A436CDC4746251), - SPH_C64(0xC36FBAF9393AD185), SPH_C64(0x3EEDBA1833EDFC13) -}; - -static const sph_u64 IV384[] = { - SPH_C64(0xA3F6C6BF3A75EF5F), SPH_C64(0xB0FEF9CCFD84FAA4), - SPH_C64(0x9D77DD663D770CFE), SPH_C64(0xD798CBF3B468FDDA), - SPH_C64(0x1BC4A6668A0E4465), SPH_C64(0x7ED7D434E5807407), - SPH_C64(0x548FC1ACD4EC44D6), SPH_C64(0x266E17546AA18FF8) -}; - -static const sph_u64 IV512[] = { - SPH_C64(0x4903ADFF749C51CE), SPH_C64(0x0D95DE399746DF03), - SPH_C64(0x8FD1934127C79BCE), SPH_C64(0x9A255629FF352CB1), - SPH_C64(0x5DB62599DF6CA7B0), SPH_C64(0xEABE394CA9D5C3F4), - SPH_C64(0x991112C71A75B523), SPH_C64(0xAE18A40B660FCC33) -}; - -#if 0 -/* obsolete */ -/* see sph_skein.h */ -void -sph_skein224_init(void *cc) -{ - skein_small_init(cc, IV224); -} - -/* see sph_skein.h */ -void -sph_skein224(void *cc, const void *data, size_t len) -{ - skein_small_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein224_close(void *cc, void *dst) -{ - sph_skein224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_small_close(cc, ub, n, dst, 28); - sph_skein224_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein256_init(void *cc) -{ - skein_small_init(cc, IV256); -} - -/* see sph_skein.h */ -void -sph_skein256(void *cc, const void *data, size_t len) -{ - skein_small_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein256_close(void *cc, void *dst) -{ - sph_skein256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_small_close(cc, ub, n, dst, 32); - sph_skein256_init(cc); -} -#endif - -/* see sph_skein.h */ -void -sph_skein224_init(void *cc) -{ - skein_big_init(cc, IV224); -} - -/* see sph_skein.h */ -void -sph_skein224(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein224_close(void *cc, void *dst) -{ - sph_skein224_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 28); - sph_skein224_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein256_init(void *cc) -{ - skein_big_init(cc, IV256); -} - -/* see sph_skein.h */ -void -sph_skein256(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein256_close(void *cc, void *dst) -{ - sph_skein256_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 32); - sph_skein256_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein384_init(void *cc) -{ - skein_big_init(cc, IV384); -} - -/* see sph_skein.h */ -void -sph_skein384(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein384_close(void *cc, void *dst) -{ - sph_skein384_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 48); - sph_skein384_init(cc); -} - -/* see sph_skein.h */ -void -sph_skein512_init(void *cc) -{ - skein_big_init(cc, IV512); -} - -/* see sph_skein.h */ -void -sph_skein512(void *cc, const void *data, size_t len) -{ - skein_big_core(cc, data, len); -} - -/* see sph_skein.h */ -void -sph_skein512_close(void *cc, void *dst) -{ - sph_skein512_addbits_and_close(cc, 0, 0, dst); -} - -/* see sph_skein.h */ -void -sph_skein512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) -{ - skein_big_close(cc, ub, n, dst, 64); - sph_skein512_init(cc); -} - -#endif - - -#ifdef __cplusplus -} -#endif diff --git a/src/crypto/sph_blake.h b/src/crypto/sph_blake.h deleted file mode 100644 index d8d794399..000000000 --- a/src/crypto/sph_blake.h +++ /dev/null @@ -1,327 +0,0 @@ -/* $Id: sph_blake.h 252 2011-06-07 17:55:14Z tp $ */ -/** - * BLAKE interface. BLAKE is a family of functions which differ by their - * output size; this implementation defines BLAKE for output sizes 224, - * 256, 384 and 512 bits. This implementation conforms to the "third - * round" specification. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_blake.h - * @author Thomas Pornin - */ - -#ifndef SPH_BLAKE_H__ -#define SPH_BLAKE_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for BLAKE-224. - */ -#define SPH_SIZE_blake224 224 - -/** - * Output size (in bits) for BLAKE-256. - */ -#define SPH_SIZE_blake256 256 - -#if SPH_64 - -/** - * Output size (in bits) for BLAKE-384. - */ -#define SPH_SIZE_blake384 384 - -/** - * Output size (in bits) for BLAKE-512. - */ -#define SPH_SIZE_blake512 512 - -#endif - -/** - * This structure is a context for BLAKE-224 and BLAKE-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BLAKE computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BLAKE - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 H[8]; - sph_u32 S[4]; - sph_u32 T0, T1; -#endif -} sph_blake_small_context; - -/** - * This structure is a context for BLAKE-224 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_small_context sph_blake224_context; - -/** - * This structure is a context for BLAKE-256 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_small_context sph_blake256_context; - -#if SPH_64 - -/** - * This structure is a context for BLAKE-384 and BLAKE-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BLAKE computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BLAKE - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u64 H[8]; - sph_u64 S[4]; - sph_u64 T0, T1; -#endif -} sph_blake_big_context; - -/** - * This structure is a context for BLAKE-384 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_big_context sph_blake384_context; - -/** - * This structure is a context for BLAKE-512 computations. It is - * identical to the common sph_blake_small_context. - */ -typedef sph_blake_big_context sph_blake512_context; - -#endif - -/** - * Initialize a BLAKE-224 context. This process performs no memory allocation. - * - * @param cc the BLAKE-224 context (pointer to a - * sph_blake224_context) - */ -void sph_blake224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake224(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-224 context - * @param dst the destination buffer - */ -void sph_blake224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BLAKE-256 context. This process performs no memory allocation. - * - * @param cc the BLAKE-256 context (pointer to a - * sph_blake256_context) - */ -void sph_blake256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake256(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-256 context - * @param dst the destination buffer - */ -void sph_blake256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#if SPH_64 - -/** - * Initialize a BLAKE-384 context. This process performs no memory allocation. - * - * @param cc the BLAKE-384 context (pointer to a - * sph_blake384_context) - */ -void sph_blake384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake384(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-384 context - * @param dst the destination buffer - */ -void sph_blake384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BLAKE-512 context. This process performs no memory allocation. - * - * @param cc the BLAKE-512 context (pointer to a - * sph_blake512_context) - */ -void sph_blake512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BLAKE-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_blake512(void *cc, const void *data, size_t len); - -/** - * Terminate the current BLAKE-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the BLAKE-512 context - * @param dst the destination buffer - */ -void sph_blake512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BLAKE-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_blake512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_bmw.h b/src/crypto/sph_bmw.h deleted file mode 100644 index d386b0c14..000000000 --- a/src/crypto/sph_bmw.h +++ /dev/null @@ -1,328 +0,0 @@ -/* $Id: sph_bmw.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * BMW interface. BMW (aka "Blue Midnight Wish") is a family of - * functions which differ by their output size; this implementation - * defines BMW for output sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_bmw.h - * @author Thomas Pornin - */ - -#ifndef SPH_BMW_H__ -#define SPH_BMW_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for BMW-224. - */ -#define SPH_SIZE_bmw224 224 - -/** - * Output size (in bits) for BMW-256. - */ -#define SPH_SIZE_bmw256 256 - -#if SPH_64 - -/** - * Output size (in bits) for BMW-384. - */ -#define SPH_SIZE_bmw384 384 - -/** - * Output size (in bits) for BMW-512. - */ -#define SPH_SIZE_bmw512 512 - -#endif - -/** - * This structure is a context for BMW-224 and BMW-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BMW computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BMW - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 H[16]; -#if SPH_64 - sph_u64 bit_count; -#else - sph_u32 bit_count_high, bit_count_low; -#endif -#endif -} sph_bmw_small_context; - -/** - * This structure is a context for BMW-224 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_small_context sph_bmw224_context; - -/** - * This structure is a context for BMW-256 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_small_context sph_bmw256_context; - -#if SPH_64 - -/** - * This structure is a context for BMW-384 and BMW-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a BMW computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running BMW - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u64 H[16]; - sph_u64 bit_count; -#endif -} sph_bmw_big_context; - -/** - * This structure is a context for BMW-384 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_big_context sph_bmw384_context; - -/** - * This structure is a context for BMW-512 computations. It is - * identical to the common sph_bmw_small_context. - */ -typedef sph_bmw_big_context sph_bmw512_context; - -#endif - -/** - * Initialize a BMW-224 context. This process performs no memory allocation. - * - * @param cc the BMW-224 context (pointer to a - * sph_bmw224_context) - */ -void sph_bmw224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw224(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-224 context - * @param dst the destination buffer - */ -void sph_bmw224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BMW-256 context. This process performs no memory allocation. - * - * @param cc the BMW-256 context (pointer to a - * sph_bmw256_context) - */ -void sph_bmw256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw256(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-256 context - * @param dst the destination buffer - */ -void sph_bmw256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#if SPH_64 - -/** - * Initialize a BMW-384 context. This process performs no memory allocation. - * - * @param cc the BMW-384 context (pointer to a - * sph_bmw384_context) - */ -void sph_bmw384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw384(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-384 context - * @param dst the destination buffer - */ -void sph_bmw384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a BMW-512 context. This process performs no memory allocation. - * - * @param cc the BMW-512 context (pointer to a - * sph_bmw512_context) - */ -void sph_bmw512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the BMW-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_bmw512(void *cc, const void *data, size_t len); - -/** - * Terminate the current BMW-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the BMW-512 context - * @param dst the destination buffer - */ -void sph_bmw512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the BMW-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_bmw512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_cubehash.h b/src/crypto/sph_cubehash.h deleted file mode 100644 index 487a1946a..000000000 --- a/src/crypto/sph_cubehash.h +++ /dev/null @@ -1,292 +0,0 @@ -/* $Id: sph_cubehash.h 180 2010-05-08 02:29:25Z tp $ */ -/** - * CubeHash interface. CubeHash is a family of functions which differ by - * their output size; this implementation defines CubeHash for output - * sizes 224, 256, 384 and 512 bits, with the "standard parameters" - * (CubeHash16/32 with the CubeHash specification notations). - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_cubehash.h - * @author Thomas Pornin - */ - -#ifndef SPH_CUBEHASH_H__ -#define SPH_CUBEHASH_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for CubeHash-224. - */ -#define SPH_SIZE_cubehash224 224 - -/** - * Output size (in bits) for CubeHash-256. - */ -#define SPH_SIZE_cubehash256 256 - -/** - * Output size (in bits) for CubeHash-384. - */ -#define SPH_SIZE_cubehash384 384 - -/** - * Output size (in bits) for CubeHash-512. - */ -#define SPH_SIZE_cubehash512 512 - -/** - * This structure is a context for CubeHash computations: it contains the - * intermediate values and some data from the last entered block. Once - * a CubeHash computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running CubeHash computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 state[32]; -#endif -} sph_cubehash_context; - -/** - * Type for a CubeHash-224 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash224_context; - -/** - * Type for a CubeHash-256 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash256_context; - -/** - * Type for a CubeHash-384 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash384_context; - -/** - * Type for a CubeHash-512 context (identical to the common context). - */ -typedef sph_cubehash_context sph_cubehash512_context; - -/** - * Initialize a CubeHash-224 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-224 context (pointer to a - * sph_cubehash224_context) - */ -void sph_cubehash224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash224(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-224 context - * @param dst the destination buffer - */ -void sph_cubehash224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a CubeHash-256 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-256 context (pointer to a - * sph_cubehash256_context) - */ -void sph_cubehash256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash256(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-256 context - * @param dst the destination buffer - */ -void sph_cubehash256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a CubeHash-384 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-384 context (pointer to a - * sph_cubehash384_context) - */ -void sph_cubehash384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash384(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-384 context - * @param dst the destination buffer - */ -void sph_cubehash384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a CubeHash-512 context. This process performs no memory - * allocation. - * - * @param cc the CubeHash-512 context (pointer to a - * sph_cubehash512_context) - */ -void sph_cubehash512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the CubeHash-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_cubehash512(void *cc, const void *data, size_t len); - -/** - * Terminate the current CubeHash-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the CubeHash-512 context - * @param dst the destination buffer - */ -void sph_cubehash512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the CubeHash-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_cubehash512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_echo.h b/src/crypto/sph_echo.h deleted file mode 100644 index 1ae1e3dd6..000000000 --- a/src/crypto/sph_echo.h +++ /dev/null @@ -1,320 +0,0 @@ -/* $Id: sph_echo.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * ECHO interface. ECHO is a family of functions which differ by - * their output size; this implementation defines ECHO for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_echo.h - * @author Thomas Pornin - */ - -#ifndef SPH_ECHO_H__ -#define SPH_ECHO_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for ECHO-224. - */ -#define SPH_SIZE_echo224 224 - -/** - * Output size (in bits) for ECHO-256. - */ -#define SPH_SIZE_echo256 256 - -/** - * Output size (in bits) for ECHO-384. - */ -#define SPH_SIZE_echo384 384 - -/** - * Output size (in bits) for ECHO-512. - */ -#define SPH_SIZE_echo512 512 - -/** - * This structure is a context for ECHO computations: it contains the - * intermediate values and some data from the last entered block. Once - * an ECHO computation has been performed, the context can be reused for - * another computation. This specific structure is used for ECHO-224 - * and ECHO-256. - * - * The contents of this structure are private. A running ECHO computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[192]; /* first field, for alignment */ - size_t ptr; - union { - sph_u32 Vs[4][4]; -#if SPH_64 - sph_u64 Vb[4][2]; -#endif - } u; - sph_u32 C0, C1, C2, C3; -#endif -} sph_echo_small_context; - -/** - * This structure is a context for ECHO computations: it contains the - * intermediate values and some data from the last entered block. Once - * an ECHO computation has been performed, the context can be reused for - * another computation. This specific structure is used for ECHO-384 - * and ECHO-512. - * - * The contents of this structure are private. A running ECHO computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - union { - sph_u32 Vs[8][4]; -#if SPH_64 - sph_u64 Vb[8][2]; -#endif - } u; - sph_u32 C0, C1, C2, C3; -#endif -} sph_echo_big_context; - -/** - * Type for a ECHO-224 context (identical to the common "small" context). - */ -typedef sph_echo_small_context sph_echo224_context; - -/** - * Type for a ECHO-256 context (identical to the common "small" context). - */ -typedef sph_echo_small_context sph_echo256_context; - -/** - * Type for a ECHO-384 context (identical to the common "big" context). - */ -typedef sph_echo_big_context sph_echo384_context; - -/** - * Type for a ECHO-512 context (identical to the common "big" context). - */ -typedef sph_echo_big_context sph_echo512_context; - -/** - * Initialize an ECHO-224 context. This process performs no memory allocation. - * - * @param cc the ECHO-224 context (pointer to a - * sph_echo224_context) - */ -void sph_echo224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo224(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-224 context - * @param dst the destination buffer - */ -void sph_echo224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an ECHO-256 context. This process performs no memory allocation. - * - * @param cc the ECHO-256 context (pointer to a - * sph_echo256_context) - */ -void sph_echo256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo256(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-256 context - * @param dst the destination buffer - */ -void sph_echo256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an ECHO-384 context. This process performs no memory allocation. - * - * @param cc the ECHO-384 context (pointer to a - * sph_echo384_context) - */ -void sph_echo384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo384(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-384 context - * @param dst the destination buffer - */ -void sph_echo384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an ECHO-512 context. This process performs no memory allocation. - * - * @param cc the ECHO-512 context (pointer to a - * sph_echo512_context) - */ -void sph_echo512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the ECHO-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_echo512(void *cc, const void *data, size_t len); - -/** - * Terminate the current ECHO-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the ECHO-512 context - * @param dst the destination buffer - */ -void sph_echo512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the ECHO-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_echo512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_groestl.h b/src/crypto/sph_groestl.h deleted file mode 100644 index 495f05e21..000000000 --- a/src/crypto/sph_groestl.h +++ /dev/null @@ -1,329 +0,0 @@ -/* $Id: sph_groestl.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * Groestl interface. This code implements Groestl with the recommended - * parameters for SHA-3, with outputs of 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_groestl.h - * @author Thomas Pornin - */ - -#ifndef SPH_GROESTL_H__ -#define SPH_GROESTL_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for Groestl-224. - */ -#define SPH_SIZE_groestl224 224 - -/** - * Output size (in bits) for Groestl-256. - */ -#define SPH_SIZE_groestl256 256 - -/** - * Output size (in bits) for Groestl-384. - */ -#define SPH_SIZE_groestl384 384 - -/** - * Output size (in bits) for Groestl-512. - */ -#define SPH_SIZE_groestl512 512 - -/** - * This structure is a context for Groestl-224 and Groestl-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a Groestl computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running Groestl - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - union { -#if SPH_64 - sph_u64 wide[8]; -#endif - sph_u32 narrow[16]; - } state; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_groestl_small_context; - -/** - * This structure is a context for Groestl-224 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_small_context sph_groestl224_context; - -/** - * This structure is a context for Groestl-256 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_small_context sph_groestl256_context; - -/** - * This structure is a context for Groestl-384 and Groestl-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a Groestl computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running Groestl - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - union { -#if SPH_64 - sph_u64 wide[16]; -#endif - sph_u32 narrow[32]; - } state; -#if SPH_64 - sph_u64 count; -#else - sph_u32 count_high, count_low; -#endif -#endif -} sph_groestl_big_context; - -/** - * This structure is a context for Groestl-384 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_big_context sph_groestl384_context; - -/** - * This structure is a context for Groestl-512 computations. It is - * identical to the common sph_groestl_small_context. - */ -typedef sph_groestl_big_context sph_groestl512_context; - -/** - * Initialize a Groestl-224 context. This process performs no memory allocation. - * - * @param cc the Groestl-224 context (pointer to a - * sph_groestl224_context) - */ -void sph_groestl224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-224 context - * @param dst the destination buffer - */ -void sph_groestl224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Groestl-256 context. This process performs no memory allocation. - * - * @param cc the Groestl-256 context (pointer to a - * sph_groestl256_context) - */ -void sph_groestl256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-256 context - * @param dst the destination buffer - */ -void sph_groestl256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Groestl-384 context. This process performs no memory allocation. - * - * @param cc the Groestl-384 context (pointer to a - * sph_groestl384_context) - */ -void sph_groestl384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-384 context - * @param dst the destination buffer - */ -void sph_groestl384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Groestl-512 context. This process performs no memory allocation. - * - * @param cc the Groestl-512 context (pointer to a - * sph_groestl512_context) - */ -void sph_groestl512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Groestl-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_groestl512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Groestl-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Groestl-512 context - * @param dst the destination buffer - */ -void sph_groestl512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Groestl-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_groestl512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_jh.h b/src/crypto/sph_jh.h deleted file mode 100644 index 82fae58df..000000000 --- a/src/crypto/sph_jh.h +++ /dev/null @@ -1,298 +0,0 @@ -/* $Id: sph_jh.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * JH interface. JH is a family of functions which differ by - * their output size; this implementation defines JH for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_jh.h - * @author Thomas Pornin - */ - -#ifndef SPH_JH_H__ -#define SPH_JH_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for JH-224. - */ -#define SPH_SIZE_jh224 224 - -/** - * Output size (in bits) for JH-256. - */ -#define SPH_SIZE_jh256 256 - -/** - * Output size (in bits) for JH-384. - */ -#define SPH_SIZE_jh384 384 - -/** - * Output size (in bits) for JH-512. - */ -#define SPH_SIZE_jh512 512 - -/** - * This structure is a context for JH computations: it contains the - * intermediate values and some data from the last entered block. Once - * a JH computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running JH computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - union { -#if SPH_64 - sph_u64 wide[16]; -#endif - sph_u32 narrow[32]; - } H; -#if SPH_64 - sph_u64 block_count; -#else - sph_u32 block_count_high, block_count_low; -#endif -#endif -} sph_jh_context; - -/** - * Type for a JH-224 context (identical to the common context). - */ -typedef sph_jh_context sph_jh224_context; - -/** - * Type for a JH-256 context (identical to the common context). - */ -typedef sph_jh_context sph_jh256_context; - -/** - * Type for a JH-384 context (identical to the common context). - */ -typedef sph_jh_context sph_jh384_context; - -/** - * Type for a JH-512 context (identical to the common context). - */ -typedef sph_jh_context sph_jh512_context; - -/** - * Initialize a JH-224 context. This process performs no memory allocation. - * - * @param cc the JH-224 context (pointer to a - * sph_jh224_context) - */ -void sph_jh224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh224(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-224 context - * @param dst the destination buffer - */ -void sph_jh224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a JH-256 context. This process performs no memory allocation. - * - * @param cc the JH-256 context (pointer to a - * sph_jh256_context) - */ -void sph_jh256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh256(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-256 context - * @param dst the destination buffer - */ -void sph_jh256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a JH-384 context. This process performs no memory allocation. - * - * @param cc the JH-384 context (pointer to a - * sph_jh384_context) - */ -void sph_jh384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh384(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-384 context - * @param dst the destination buffer - */ -void sph_jh384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a JH-512 context. This process performs no memory allocation. - * - * @param cc the JH-512 context (pointer to a - * sph_jh512_context) - */ -void sph_jh512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the JH-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_jh512(void *cc, const void *data, size_t len); - -/** - * Terminate the current JH-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the JH-512 context - * @param dst the destination buffer - */ -void sph_jh512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the JH-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_jh512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_keccak.h b/src/crypto/sph_keccak.h deleted file mode 100644 index bdafdb88d..000000000 --- a/src/crypto/sph_keccak.h +++ /dev/null @@ -1,293 +0,0 @@ -/* $Id: sph_keccak.h 216 2010-06-08 09:46:57Z tp $ */ -/** - * Keccak interface. This is the interface for Keccak with the - * recommended parameters for SHA-3, with output lengths 224, 256, - * 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_keccak.h - * @author Thomas Pornin - */ - -#ifndef SPH_KECCAK_H__ -#define SPH_KECCAK_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for Keccak-224. - */ -#define SPH_SIZE_keccak224 224 - -/** - * Output size (in bits) for Keccak-256. - */ -#define SPH_SIZE_keccak256 256 - -/** - * Output size (in bits) for Keccak-384. - */ -#define SPH_SIZE_keccak384 384 - -/** - * Output size (in bits) for Keccak-512. - */ -#define SPH_SIZE_keccak512 512 - -/** - * This structure is a context for Keccak computations: it contains the - * intermediate values and some data from the last entered block. Once a - * Keccak computation has been performed, the context can be reused for - * another computation. - * - * The contents of this structure are private. A running Keccak computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[144]; /* first field, for alignment */ - size_t ptr, lim; - union { -#if SPH_64 - sph_u64 wide[25]; -#endif - sph_u32 narrow[50]; - } u; -#endif -} sph_keccak_context; - -/** - * Type for a Keccak-224 context (identical to the common context). - */ -typedef sph_keccak_context sph_keccak224_context; - -/** - * Type for a Keccak-256 context (identical to the common context). - */ -typedef sph_keccak_context sph_keccak256_context; - -/** - * Type for a Keccak-384 context (identical to the common context). - */ -typedef sph_keccak_context sph_keccak384_context; - -/** - * Type for a Keccak-512 context (identical to the common context). - */ -typedef sph_keccak_context sph_keccak512_context; - -/** - * Initialize a Keccak-224 context. This process performs no memory allocation. - * - * @param cc the Keccak-224 context (pointer to a - * sph_keccak224_context) - */ -void sph_keccak224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Keccak-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_keccak224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Keccak-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Keccak-224 context - * @param dst the destination buffer - */ -void sph_keccak224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Keccak-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_keccak224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Keccak-256 context. This process performs no memory allocation. - * - * @param cc the Keccak-256 context (pointer to a - * sph_keccak256_context) - */ -void sph_keccak256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Keccak-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_keccak256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Keccak-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Keccak-256 context - * @param dst the destination buffer - */ -void sph_keccak256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Keccak-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_keccak256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Keccak-384 context. This process performs no memory allocation. - * - * @param cc the Keccak-384 context (pointer to a - * sph_keccak384_context) - */ -void sph_keccak384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Keccak-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_keccak384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Keccak-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Keccak-384 context - * @param dst the destination buffer - */ -void sph_keccak384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Keccak-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_keccak384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Keccak-512 context. This process performs no memory allocation. - * - * @param cc the Keccak-512 context (pointer to a - * sph_keccak512_context) - */ -void sph_keccak512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Keccak-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_keccak512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Keccak-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Keccak-512 context - * @param dst the destination buffer - */ -void sph_keccak512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Keccak-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_keccak512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_luffa.h b/src/crypto/sph_luffa.h deleted file mode 100644 index a32fd7b16..000000000 --- a/src/crypto/sph_luffa.h +++ /dev/null @@ -1,296 +0,0 @@ -/* $Id: sph_luffa.h 154 2010-04-26 17:00:24Z tp $ */ -/** - * Luffa interface. Luffa is a family of functions which differ by - * their output size; this implementation defines Luffa for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_luffa.h - * @author Thomas Pornin - */ - -#ifndef SPH_LUFFA_H__ -#define SPH_LUFFA_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for Luffa-224. - */ -#define SPH_SIZE_luffa224 224 - -/** - * Output size (in bits) for Luffa-256. - */ -#define SPH_SIZE_luffa256 256 - -/** - * Output size (in bits) for Luffa-384. - */ -#define SPH_SIZE_luffa384 384 - -/** - * Output size (in bits) for Luffa-512. - */ -#define SPH_SIZE_luffa512 512 - -/** - * This structure is a context for Luffa-224 computations: it contains - * the intermediate values and some data from the last entered block. - * Once a Luffa computation has been performed, the context can be - * reused for another computation. - * - * The contents of this structure are private. A running Luffa - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[3][8]; -#endif -} sph_luffa224_context; - -/** - * This structure is a context for Luffa-256 computations. It is - * identical to sph_luffa224_context. - */ -typedef sph_luffa224_context sph_luffa256_context; - -/** - * This structure is a context for Luffa-384 computations. - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[4][8]; -#endif -} sph_luffa384_context; - -/** - * This structure is a context for Luffa-512 computations. - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[32]; /* first field, for alignment */ - size_t ptr; - sph_u32 V[5][8]; -#endif -} sph_luffa512_context; - -/** - * Initialize a Luffa-224 context. This process performs no memory allocation. - * - * @param cc the Luffa-224 context (pointer to a - * sph_luffa224_context) - */ -void sph_luffa224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-224 context - * @param dst the destination buffer - */ -void sph_luffa224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Luffa-256 context. This process performs no memory allocation. - * - * @param cc the Luffa-256 context (pointer to a - * sph_luffa256_context) - */ -void sph_luffa256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-256 context - * @param dst the destination buffer - */ -void sph_luffa256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Luffa-384 context. This process performs no memory allocation. - * - * @param cc the Luffa-384 context (pointer to a - * sph_luffa384_context) - */ -void sph_luffa384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-384 context - * @param dst the destination buffer - */ -void sph_luffa384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Luffa-512 context. This process performs no memory allocation. - * - * @param cc the Luffa-512 context (pointer to a - * sph_luffa512_context) - */ -void sph_luffa512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Luffa-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_luffa512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Luffa-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Luffa-512 context - * @param dst the destination buffer - */ -void sph_luffa512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Luffa-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_luffa512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_shavite.h b/src/crypto/sph_shavite.h deleted file mode 100644 index 0957e42a9..000000000 --- a/src/crypto/sph_shavite.h +++ /dev/null @@ -1,314 +0,0 @@ -/* $Id: sph_shavite.h 208 2010-06-02 20:33:00Z tp $ */ -/** - * SHAvite-3 interface. This code implements SHAvite-3 with the - * recommended parameters for SHA-3, with outputs of 224, 256, 384 and - * 512 bits. In the following, we call the function "SHAvite" (without - * the "-3" suffix), thus "SHAvite-224" is "SHAvite-3 with a 224-bit - * output". - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_shavite.h - * @author Thomas Pornin - */ - -#ifndef SPH_SHAVITE_H__ -#define SPH_SHAVITE_H__ - -#include -#include "sph_types.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * Output size (in bits) for SHAvite-224. - */ -#define SPH_SIZE_shavite224 224 - -/** - * Output size (in bits) for SHAvite-256. - */ -#define SPH_SIZE_shavite256 256 - -/** - * Output size (in bits) for SHAvite-384. - */ -#define SPH_SIZE_shavite384 384 - -/** - * Output size (in bits) for SHAvite-512. - */ -#define SPH_SIZE_shavite512 512 - -/** - * This structure is a context for SHAvite-224 and SHAvite-256 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a SHAvite computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running SHAvite - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 h[8]; - sph_u32 count0, count1; -#endif -} sph_shavite_small_context; - -/** - * This structure is a context for SHAvite-224 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_small_context sph_shavite224_context; - -/** - * This structure is a context for SHAvite-256 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_small_context sph_shavite256_context; - -/** - * This structure is a context for SHAvite-384 and SHAvite-512 computations: - * it contains the intermediate values and some data from the last - * entered block. Once a SHAvite computation has been performed, the - * context can be reused for another computation. - * - * The contents of this structure are private. A running SHAvite - * computation can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u32 h[16]; - sph_u32 count0, count1, count2, count3; -#endif -} sph_shavite_big_context; - -/** - * This structure is a context for SHAvite-384 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_big_context sph_shavite384_context; - -/** - * This structure is a context for SHAvite-512 computations. It is - * identical to the common sph_shavite_small_context. - */ -typedef sph_shavite_big_context sph_shavite512_context; - -/** - * Initialize a SHAvite-224 context. This process performs no memory allocation. - * - * @param cc the SHAvite-224 context (pointer to a - * sph_shavite224_context) - */ -void sph_shavite224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite224(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-224 context - * @param dst the destination buffer - */ -void sph_shavite224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a SHAvite-256 context. This process performs no memory allocation. - * - * @param cc the SHAvite-256 context (pointer to a - * sph_shavite256_context) - */ -void sph_shavite256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite256(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-256 context - * @param dst the destination buffer - */ -void sph_shavite256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a SHAvite-384 context. This process performs no memory allocation. - * - * @param cc the SHAvite-384 context (pointer to a - * sph_shavite384_context) - */ -void sph_shavite384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite384(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-384 context - * @param dst the destination buffer - */ -void sph_shavite384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a SHAvite-512 context. This process performs no memory allocation. - * - * @param cc the SHAvite-512 context (pointer to a - * sph_shavite512_context) - */ -void sph_shavite512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SHAvite-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_shavite512(void *cc, const void *data, size_t len); - -/** - * Terminate the current SHAvite-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the SHAvite-512 context - * @param dst the destination buffer - */ -void sph_shavite512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SHAvite-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_shavite512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_simd.h b/src/crypto/sph_simd.h deleted file mode 100644 index 92ee1e727..000000000 --- a/src/crypto/sph_simd.h +++ /dev/null @@ -1,309 +0,0 @@ -/* $Id: sph_simd.h 154 2010-04-26 17:00:24Z tp $ */ -/** - * SIMD interface. SIMD is a family of functions which differ by - * their output size; this implementation defines SIMD for output - * sizes 224, 256, 384 and 512 bits. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_simd.h - * @author Thomas Pornin - */ - -#ifndef SPH_SIMD_H__ -#define SPH_SIMD_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -/** - * Output size (in bits) for SIMD-224. - */ -#define SPH_SIZE_simd224 224 - -/** - * Output size (in bits) for SIMD-256. - */ -#define SPH_SIZE_simd256 256 - -/** - * Output size (in bits) for SIMD-384. - */ -#define SPH_SIZE_simd384 384 - -/** - * Output size (in bits) for SIMD-512. - */ -#define SPH_SIZE_simd512 512 - -/** - * This structure is a context for SIMD computations: it contains the - * intermediate values and some data from the last entered block. Once - * an SIMD computation has been performed, the context can be reused for - * another computation. This specific structure is used for SIMD-224 - * and SIMD-256. - * - * The contents of this structure are private. A running SIMD computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u32 state[16]; - sph_u32 count_low, count_high; -#endif -} sph_simd_small_context; - -/** - * This structure is a context for SIMD computations: it contains the - * intermediate values and some data from the last entered block. Once - * an SIMD computation has been performed, the context can be reused for - * another computation. This specific structure is used for SIMD-384 - * and SIMD-512. - * - * The contents of this structure are private. A running SIMD computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[128]; /* first field, for alignment */ - size_t ptr; - sph_u32 state[32]; - sph_u32 count_low, count_high; -#endif -} sph_simd_big_context; - -/** - * Type for a SIMD-224 context (identical to the common "small" context). - */ -typedef sph_simd_small_context sph_simd224_context; - -/** - * Type for a SIMD-256 context (identical to the common "small" context). - */ -typedef sph_simd_small_context sph_simd256_context; - -/** - * Type for a SIMD-384 context (identical to the common "big" context). - */ -typedef sph_simd_big_context sph_simd384_context; - -/** - * Type for a SIMD-512 context (identical to the common "big" context). - */ -typedef sph_simd_big_context sph_simd512_context; - -/** - * Initialize an SIMD-224 context. This process performs no memory allocation. - * - * @param cc the SIMD-224 context (pointer to a - * sph_simd224_context) - */ -void sph_simd224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd224(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-224 context - * @param dst the destination buffer - */ -void sph_simd224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an SIMD-256 context. This process performs no memory allocation. - * - * @param cc the SIMD-256 context (pointer to a - * sph_simd256_context) - */ -void sph_simd256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd256(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-256 context - * @param dst the destination buffer - */ -void sph_simd256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an SIMD-384 context. This process performs no memory allocation. - * - * @param cc the SIMD-384 context (pointer to a - * sph_simd384_context) - */ -void sph_simd384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd384(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-384 context - * @param dst the destination buffer - */ -void sph_simd384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize an SIMD-512 context. This process performs no memory allocation. - * - * @param cc the SIMD-512 context (pointer to a - * sph_simd512_context) - */ -void sph_simd512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the SIMD-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_simd512(void *cc, const void *data, size_t len); - -/** - * Terminate the current SIMD-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the SIMD-512 context - * @param dst the destination buffer - */ -void sph_simd512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the SIMD-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_simd512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_skein.h b/src/crypto/sph_skein.h deleted file mode 100644 index bddbc86fa..000000000 --- a/src/crypto/sph_skein.h +++ /dev/null @@ -1,298 +0,0 @@ -/* $Id: sph_skein.h 253 2011-06-07 18:33:10Z tp $ */ -/** - * Skein interface. The Skein specification defines three main - * functions, called Skein-256, Skein-512 and Skein-1024, which can be - * further parameterized with an output length. For the SHA-3 - * competition, Skein-512 is used for output sizes of 224, 256, 384 and - * 512 bits; this is what this code implements. Thus, we hereafter call - * Skein-224, Skein-256, Skein-384 and Skein-512 what the Skein - * specification defines as Skein-512-224, Skein-512-256, Skein-512-384 - * and Skein-512-512, respectively. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_skein.h - * @author Thomas Pornin - */ - -#ifndef SPH_SKEIN_H__ -#define SPH_SKEIN_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include -#include "sph_types.h" - -#if SPH_64 - -/** - * Output size (in bits) for Skein-224. - */ -#define SPH_SIZE_skein224 224 - -/** - * Output size (in bits) for Skein-256. - */ -#define SPH_SIZE_skein256 256 - -/** - * Output size (in bits) for Skein-384. - */ -#define SPH_SIZE_skein384 384 - -/** - * Output size (in bits) for Skein-512. - */ -#define SPH_SIZE_skein512 512 - -/** - * This structure is a context for Skein computations (with a 384- or - * 512-bit output): it contains the intermediate values and some data - * from the last entered block. Once a Skein computation has been - * performed, the context can be reused for another computation. - * - * The contents of this structure are private. A running Skein computation - * can be cloned by copying the context (e.g. with a simple - * memcpy()). - */ -typedef struct { -#ifndef DOXYGEN_IGNORE - unsigned char buf[64]; /* first field, for alignment */ - size_t ptr; - sph_u64 h0, h1, h2, h3, h4, h5, h6, h7; - sph_u64 bcount; -#endif -} sph_skein_big_context; - -/** - * Type for a Skein-224 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein224_context; - -/** - * Type for a Skein-256 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein256_context; - -/** - * Type for a Skein-384 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein384_context; - -/** - * Type for a Skein-512 context (identical to the common "big" context). - */ -typedef sph_skein_big_context sph_skein512_context; - -/** - * Initialize a Skein-224 context. This process performs no memory allocation. - * - * @param cc the Skein-224 context (pointer to a - * sph_skein224_context) - */ -void sph_skein224_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-224 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein224(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-224 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (28 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-224 context - * @param dst the destination buffer - */ -void sph_skein224_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (28 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-224 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein224_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Skein-256 context. This process performs no memory allocation. - * - * @param cc the Skein-256 context (pointer to a - * sph_skein256_context) - */ -void sph_skein256_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-256 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein256(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-256 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (32 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-256 context - * @param dst the destination buffer - */ -void sph_skein256_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (32 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-256 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein256_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Skein-384 context. This process performs no memory allocation. - * - * @param cc the Skein-384 context (pointer to a - * sph_skein384_context) - */ -void sph_skein384_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-384 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein384(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-384 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (48 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-384 context - * @param dst the destination buffer - */ -void sph_skein384_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (48 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-384 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein384_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -/** - * Initialize a Skein-512 context. This process performs no memory allocation. - * - * @param cc the Skein-512 context (pointer to a - * sph_skein512_context) - */ -void sph_skein512_init(void *cc); - -/** - * Process some data bytes. It is acceptable that len is zero - * (in which case this function does nothing). - * - * @param cc the Skein-512 context - * @param data the input data - * @param len the input data length (in bytes) - */ -void sph_skein512(void *cc, const void *data, size_t len); - -/** - * Terminate the current Skein-512 computation and output the result into - * the provided buffer. The destination buffer must be wide enough to - * accomodate the result (64 bytes). The context is automatically - * reinitialized. - * - * @param cc the Skein-512 context - * @param dst the destination buffer - */ -void sph_skein512_close(void *cc, void *dst); - -/** - * Add a few additional bits (0 to 7) to the current computation, then - * terminate it and output the result in the provided buffer, which must - * be wide enough to accomodate the result (64 bytes). If bit number i - * in ub has value 2^i, then the extra bits are those - * numbered 7 downto 8-n (this is the big-endian convention at the byte - * level). The context is automatically reinitialized. - * - * @param cc the Skein-512 context - * @param ub the extra bits - * @param n the number of extra bits (0 to 7) - * @param dst the destination buffer - */ -void sph_skein512_addbits_and_close( - void *cc, unsigned ub, unsigned n, void *dst); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/crypto/sph_types.h b/src/crypto/sph_types.h deleted file mode 100644 index 7295b0b37..000000000 --- a/src/crypto/sph_types.h +++ /dev/null @@ -1,1976 +0,0 @@ -/* $Id: sph_types.h 260 2011-07-21 01:02:38Z tp $ */ -/** - * Basic type definitions. - * - * This header file defines the generic integer types that will be used - * for the implementation of hash functions; it also contains helper - * functions which encode and decode multi-byte integer values, using - * either little-endian or big-endian conventions. - * - * This file contains a compile-time test on the size of a byte - * (the unsigned char C type). If bytes are not octets, - * i.e. if they do not have a size of exactly 8 bits, then compilation - * is aborted. Architectures where bytes are not octets are relatively - * rare, even in the embedded devices market. We forbid non-octet bytes - * because there is no clear convention on how octet streams are encoded - * on such systems. - * - * ==========================(LICENSE BEGIN)============================ - * - * Copyright (c) 2007-2010 Projet RNRT SAPHIR - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * ===========================(LICENSE END)============================= - * - * @file sph_types.h - * @author Thomas Pornin - */ - -#ifndef SPH_TYPES_H__ -#define SPH_TYPES_H__ - -#include - -/* - * All our I/O functions are defined over octet streams. We do not know - * how to handle input data if bytes are not octets. - */ -#if CHAR_BIT != 8 -#error This code requires 8-bit bytes -#endif - -/* ============= BEGIN documentation block for Doxygen ============ */ - -#ifdef DOXYGEN_IGNORE - -/** @mainpage sphlib C code documentation - * - * @section overview Overview - * - * sphlib is a library which contains implementations of - * various cryptographic hash functions. These pages have been generated - * with doxygen and - * document the API for the C implementations. - * - * The API is described in appropriate header files, which are available - * in the "Files" section. Each hash function family has its own header, - * whose name begins with "sph_" and contains the family - * name. For instance, the API for the RIPEMD hash functions is available - * in the header file sph_ripemd.h. - * - * @section principles API structure and conventions - * - * @subsection io Input/output conventions - * - * In all generality, hash functions operate over strings of bits. - * Individual bits are rarely encountered in C programming or actual - * communication protocols; most protocols converge on the ubiquitous - * "octet" which is a group of eight bits. Data is thus expressed as a - * stream of octets. The C programming language contains the notion of a - * "byte", which is a data unit managed under the type "unsigned - * char". The C standard prescribes that a byte should hold at - * least eight bits, but possibly more. Most modern architectures, even - * in the embedded world, feature eight-bit bytes, i.e. map bytes to - * octets. - * - * Nevertheless, for some of the implemented hash functions, an extra - * API has been added, which allows the input of arbitrary sequences of - * bits: when the computation is about to be closed, 1 to 7 extra bits - * can be added. The functions for which this API is implemented include - * the SHA-2 functions and all SHA-3 candidates. - * - * sphlib defines hash function which may hash octet streams, - * i.e. streams of bits where the number of bits is a multiple of eight. - * The data input functions in the sphlib API expect data - * as anonymous pointers ("const void *") with a length - * (of type "size_t") which gives the input data chunk length - * in bytes. A byte is assumed to be an octet; the sph_types.h - * header contains a compile-time test which prevents compilation on - * architectures where this property is not met. - * - * The hash function output is also converted into bytes. All currently - * implemented hash functions have an output width which is a multiple of - * eight, and this is likely to remain true for new designs. - * - * Most hash functions internally convert input data into 32-bit of 64-bit - * words, using either little-endian or big-endian conversion. The hash - * output also often consists of such words, which are encoded into output - * bytes with a similar endianness convention. Some hash functions have - * been only loosely specified on that subject; when necessary, - * sphlib has been tested against published "reference" - * implementations in order to use the same conventions. - * - * @subsection shortname Function short name - * - * Each implemented hash function has a "short name" which is used - * internally to derive the identifiers for the functions and context - * structures which the function uses. For instance, MD5 has the short - * name "md5". Short names are listed in the next section, - * for the implemented hash functions. In subsequent sections, the - * short name will be assumed to be "XXX": replace with the - * actual hash function name to get the C identifier. - * - * Note: some functions within the same family share the same core - * elements, such as update function or context structure. Correspondingly, - * some of the defined types or functions may actually be macros which - * transparently evaluate to another type or function name. - * - * @subsection context Context structure - * - * Each implemented hash fonction has its own context structure, available - * under the type name "sph_XXX_context" for the hash function - * with short name "XXX". This structure holds all needed - * state for a running hash computation. - * - * The contents of these structures are meant to be opaque, and private - * to the implementation. However, these contents are specified in the - * header files so that application code which uses sphlib - * may access the size of those structures. - * - * The caller is responsible for allocating the context structure, - * whether by dynamic allocation (malloc() or equivalent), - * static allocation (a global permanent variable), as an automatic - * variable ("on the stack"), or by any other mean which ensures proper - * structure alignment. sphlib code performs no dynamic - * allocation by itself. - * - * The context must be initialized before use, using the - * sph_XXX_init() function. This function sets the context - * state to proper initial values for hashing. - * - * Since all state data is contained within the context structure, - * sphlib is thread-safe and reentrant: several hash - * computations may be performed in parallel, provided that they do not - * operate on the same context. Moreover, a running computation can be - * cloned by copying the context (with a simple memcpy()): - * the context and its clone are then independant and may be updated - * with new data and/or closed without interfering with each other. - * Similarly, a context structure can be moved in memory at will: - * context structures contain no pointer, in particular no pointer to - * themselves. - * - * @subsection dataio Data input - * - * Hashed data is input with the sph_XXX() fonction, which - * takes as parameters a pointer to the context, a pointer to the data - * to hash, and the number of data bytes to hash. The context is updated - * with the new data. - * - * Data can be input in one or several calls, with arbitrary input lengths. - * However, it is best, performance wise, to input data by relatively big - * chunks (say a few kilobytes), because this allows sphlib to - * optimize things and avoid internal copying. - * - * When all data has been input, the context can be closed with - * sph_XXX_close(). The hash output is computed and written - * into the provided buffer. The caller must take care to provide a - * buffer of appropriate length; e.g., when using SHA-1, the output is - * a 20-byte word, therefore the output buffer must be at least 20-byte - * long. - * - * For some hash functions, the sph_XXX_addbits_and_close() - * function can be used instead of sph_XXX_close(). This - * function can take a few extra bits to be added at - * the end of the input message. This allows hashing messages with a - * bit length which is not a multiple of 8. The extra bits are provided - * as an unsigned integer value, and a bit count. The bit count must be - * between 0 and 7, inclusive. The extra bits are provided as bits 7 to - * 0 (bits of numerical value 128, 64, 32... downto 0), in that order. - * For instance, to add three bits of value 1, 1 and 0, the unsigned - * integer will have value 192 (1*128 + 1*64 + 0*32) and the bit count - * will be 3. - * - * The SPH_SIZE_XXX macro is defined for each hash function; - * it evaluates to the function output size, expressed in bits. For instance, - * SPH_SIZE_sha1 evaluates to 160. - * - * When closed, the context is automatically reinitialized and can be - * immediately used for another computation. It is not necessary to call - * sph_XXX_init() after a close. Note that - * sph_XXX_init() can still be called to "reset" a context, - * i.e. forget previously input data, and get back to the initial state. - * - * @subsection alignment Data alignment - * - * "Alignment" is a property of data, which is said to be "properly - * aligned" when its emplacement in memory is such that the data can - * be optimally read by full words. This depends on the type of access; - * basically, some hash functions will read data by 32-bit or 64-bit - * words. sphlib does not mandate such alignment for input - * data, but using aligned data can substantially improve performance. - * - * As a rule, it is best to input data by chunks whose length (in bytes) - * is a multiple of eight, and which begins at "generally aligned" - * addresses, such as the base address returned by a call to - * malloc(). - * - * @section functions Implemented functions - * - * We give here the list of implemented functions. They are grouped by - * family; to each family corresponds a specific header file. Each - * individual function has its associated "short name". Please refer to - * the documentation for that header file to get details on the hash - * function denomination and provenance. - * - * Note: the functions marked with a '(64)' in the list below are - * available only if the C compiler provides an integer type of length - * 64 bits or more. Such a type is mandatory in the latest C standard - * (ISO 9899:1999, aka "C99") and is present in several older compilers - * as well, so chances are that such a type is available. - * - * - HAVAL family: file sph_haval.h - * - HAVAL-128/3 (128-bit, 3 passes): short name: haval128_3 - * - HAVAL-128/4 (128-bit, 4 passes): short name: haval128_4 - * - HAVAL-128/5 (128-bit, 5 passes): short name: haval128_5 - * - HAVAL-160/3 (160-bit, 3 passes): short name: haval160_3 - * - HAVAL-160/4 (160-bit, 4 passes): short name: haval160_4 - * - HAVAL-160/5 (160-bit, 5 passes): short name: haval160_5 - * - HAVAL-192/3 (192-bit, 3 passes): short name: haval192_3 - * - HAVAL-192/4 (192-bit, 4 passes): short name: haval192_4 - * - HAVAL-192/5 (192-bit, 5 passes): short name: haval192_5 - * - HAVAL-224/3 (224-bit, 3 passes): short name: haval224_3 - * - HAVAL-224/4 (224-bit, 4 passes): short name: haval224_4 - * - HAVAL-224/5 (224-bit, 5 passes): short name: haval224_5 - * - HAVAL-256/3 (256-bit, 3 passes): short name: haval256_3 - * - HAVAL-256/4 (256-bit, 4 passes): short name: haval256_4 - * - HAVAL-256/5 (256-bit, 5 passes): short name: haval256_5 - * - MD2: file sph_md2.h, short name: md2 - * - MD4: file sph_md4.h, short name: md4 - * - MD5: file sph_md5.h, short name: md5 - * - PANAMA: file sph_panama.h, short name: panama - * - RadioGatun family: file sph_radiogatun.h - * - RadioGatun[32]: short name: radiogatun32 - * - RadioGatun[64]: short name: radiogatun64 (64) - * - RIPEMD family: file sph_ripemd.h - * - RIPEMD: short name: ripemd - * - RIPEMD-128: short name: ripemd128 - * - RIPEMD-160: short name: ripemd160 - * - SHA-0: file sph_sha0.h, short name: sha0 - * - SHA-1: file sph_sha1.h, short name: sha1 - * - SHA-2 family, 32-bit hashes: file sph_sha2.h - * - SHA-224: short name: sha224 - * - SHA-256: short name: sha256 - * - SHA-384: short name: sha384 (64) - * - SHA-512: short name: sha512 (64) - * - Tiger family: file sph_tiger.h - * - Tiger: short name: tiger (64) - * - Tiger2: short name: tiger2 (64) - * - WHIRLPOOL family: file sph_whirlpool.h - * - WHIRLPOOL-0: short name: whirlpool0 (64) - * - WHIRLPOOL-1: short name: whirlpool1 (64) - * - WHIRLPOOL: short name: whirlpool (64) - * - * The fourteen second-round SHA-3 candidates are also implemented; - * when applicable, the implementations follow the "final" specifications - * as published for the third round of the SHA-3 competition (BLAKE, - * Groestl, JH, Keccak and Skein have been tweaked for third round). - * - * - BLAKE family: file sph_blake.h - * - BLAKE-224: short name: blake224 - * - BLAKE-256: short name: blake256 - * - BLAKE-384: short name: blake384 - * - BLAKE-512: short name: blake512 - * - BMW (Blue Midnight Wish) family: file sph_bmw.h - * - BMW-224: short name: bmw224 - * - BMW-256: short name: bmw256 - * - BMW-384: short name: bmw384 (64) - * - BMW-512: short name: bmw512 (64) - * - CubeHash family: file sph_cubehash.h (specified as - * CubeHash16/32 in the CubeHash specification) - * - CubeHash-224: short name: cubehash224 - * - CubeHash-256: short name: cubehash256 - * - CubeHash-384: short name: cubehash384 - * - CubeHash-512: short name: cubehash512 - * - ECHO family: file sph_echo.h - * - ECHO-224: short name: echo224 - * - ECHO-256: short name: echo256 - * - ECHO-384: short name: echo384 - * - ECHO-512: short name: echo512 - * - Fugue family: file sph_fugue.h - * - Fugue-224: short name: fugue224 - * - Fugue-256: short name: fugue256 - * - Fugue-384: short name: fugue384 - * - Fugue-512: short name: fugue512 - * - Groestl family: file sph_groestl.h - * - Groestl-224: short name: groestl224 - * - Groestl-256: short name: groestl256 - * - Groestl-384: short name: groestl384 - * - Groestl-512: short name: groestl512 - * - Hamsi family: file sph_hamsi.h - * - Hamsi-224: short name: hamsi224 - * - Hamsi-256: short name: hamsi256 - * - Hamsi-384: short name: hamsi384 - * - Hamsi-512: short name: hamsi512 - * - JH family: file sph_jh.h - * - JH-224: short name: jh224 - * - JH-256: short name: jh256 - * - JH-384: short name: jh384 - * - JH-512: short name: jh512 - * - Keccak family: file sph_keccak.h - * - Keccak-224: short name: keccak224 - * - Keccak-256: short name: keccak256 - * - Keccak-384: short name: keccak384 - * - Keccak-512: short name: keccak512 - * - Luffa family: file sph_luffa.h - * - Luffa-224: short name: luffa224 - * - Luffa-256: short name: luffa256 - * - Luffa-384: short name: luffa384 - * - Luffa-512: short name: luffa512 - * - Shabal family: file sph_shabal.h - * - Shabal-192: short name: shabal192 - * - Shabal-224: short name: shabal224 - * - Shabal-256: short name: shabal256 - * - Shabal-384: short name: shabal384 - * - Shabal-512: short name: shabal512 - * - SHAvite-3 family: file sph_shavite.h - * - SHAvite-224 (nominally "SHAvite-3 with 224-bit output"): - * short name: shabal224 - * - SHAvite-256 (nominally "SHAvite-3 with 256-bit output"): - * short name: shabal256 - * - SHAvite-384 (nominally "SHAvite-3 with 384-bit output"): - * short name: shabal384 - * - SHAvite-512 (nominally "SHAvite-3 with 512-bit output"): - * short name: shabal512 - * - SIMD family: file sph_simd.h - * - SIMD-224: short name: simd224 - * - SIMD-256: short name: simd256 - * - SIMD-384: short name: simd384 - * - SIMD-512: short name: simd512 - * - Skein family: file sph_skein.h - * - Skein-224 (nominally specified as Skein-512-224): short name: - * skein224 (64) - * - Skein-256 (nominally specified as Skein-512-256): short name: - * skein256 (64) - * - Skein-384 (nominally specified as Skein-512-384): short name: - * skein384 (64) - * - Skein-512 (nominally specified as Skein-512-512): short name: - * skein512 (64) - * - * For the second-round SHA-3 candidates, the functions are as specified - * for round 2, i.e. with the "tweaks" that some candidates added - * between round 1 and round 2. Also, some of the submitted packages for - * round 2 contained errors, in the specification, reference code, or - * both. sphlib implements the corrected versions. - */ - -/** @hideinitializer - * Unsigned integer type whose length is at least 32 bits; on most - * architectures, it will have a width of exactly 32 bits. Unsigned C - * types implement arithmetics modulo a power of 2; use the - * SPH_T32() macro to ensure that the value is truncated - * to exactly 32 bits. Unless otherwise specified, all macros and - * functions which accept sph_u32 values assume that these - * values fit on 32 bits, i.e. do not exceed 2^32-1, even on architectures - * where sph_u32 is larger than that. - */ -typedef __arch_dependant__ sph_u32; - -/** @hideinitializer - * Signed integer type corresponding to sph_u32; it has - * width 32 bits or more. - */ -typedef __arch_dependant__ sph_s32; - -/** @hideinitializer - * Unsigned integer type whose length is at least 64 bits; on most - * architectures which feature such a type, it will have a width of - * exactly 64 bits. C99-compliant platform will have this type; it - * is also defined when the GNU compiler (gcc) is used, and on - * platforms where unsigned long is large enough. If this - * type is not available, then some hash functions which depends on - * a 64-bit type will not be available (most notably SHA-384, SHA-512, - * Tiger and WHIRLPOOL). - */ -typedef __arch_dependant__ sph_u64; - -/** @hideinitializer - * Signed integer type corresponding to sph_u64; it has - * width 64 bits or more. - */ -typedef __arch_dependant__ sph_s64; - -/** - * This macro expands the token x into a suitable - * constant expression of type sph_u32. Depending on - * how this type is defined, a suffix such as UL may - * be appended to the argument. - * - * @param x the token to expand into a suitable constant expression - */ -#define SPH_C32(x) - -/** - * Truncate a 32-bit value to exactly 32 bits. On most systems, this is - * a no-op, recognized as such by the compiler. - * - * @param x the value to truncate (of type sph_u32) - */ -#define SPH_T32(x) - -/** - * Rotate a 32-bit value by a number of bits to the left. The rotate - * count must reside between 1 and 31. This macro assumes that its - * first argument fits in 32 bits (no extra bit allowed on machines where - * sph_u32 is wider); both arguments may be evaluated - * several times. - * - * @param x the value to rotate (of type sph_u32) - * @param n the rotation count (between 1 and 31, inclusive) - */ -#define SPH_ROTL32(x, n) - -/** - * Rotate a 32-bit value by a number of bits to the left. The rotate - * count must reside between 1 and 31. This macro assumes that its - * first argument fits in 32 bits (no extra bit allowed on machines where - * sph_u32 is wider); both arguments may be evaluated - * several times. - * - * @param x the value to rotate (of type sph_u32) - * @param n the rotation count (between 1 and 31, inclusive) - */ -#define SPH_ROTR32(x, n) - -/** - * This macro is defined on systems for which a 64-bit type has been - * detected, and is used for sph_u64. - */ -#define SPH_64 - -/** - * This macro is defined on systems for the "native" integer size is - * 64 bits (64-bit values fit in one register). - */ -#define SPH_64_TRUE - -/** - * This macro expands the token x into a suitable - * constant expression of type sph_u64. Depending on - * how this type is defined, a suffix such as ULL may - * be appended to the argument. This macro is defined only if a - * 64-bit type was detected and used for sph_u64. - * - * @param x the token to expand into a suitable constant expression - */ -#define SPH_C64(x) - -/** - * Truncate a 64-bit value to exactly 64 bits. On most systems, this is - * a no-op, recognized as such by the compiler. This macro is defined only - * if a 64-bit type was detected and used for sph_u64. - * - * @param x the value to truncate (of type sph_u64) - */ -#define SPH_T64(x) - -/** - * Rotate a 64-bit value by a number of bits to the left. The rotate - * count must reside between 1 and 63. This macro assumes that its - * first argument fits in 64 bits (no extra bit allowed on machines where - * sph_u64 is wider); both arguments may be evaluated - * several times. This macro is defined only if a 64-bit type was detected - * and used for sph_u64. - * - * @param x the value to rotate (of type sph_u64) - * @param n the rotation count (between 1 and 63, inclusive) - */ -#define SPH_ROTL64(x, n) - -/** - * Rotate a 64-bit value by a number of bits to the left. The rotate - * count must reside between 1 and 63. This macro assumes that its - * first argument fits in 64 bits (no extra bit allowed on machines where - * sph_u64 is wider); both arguments may be evaluated - * several times. This macro is defined only if a 64-bit type was detected - * and used for sph_u64. - * - * @param x the value to rotate (of type sph_u64) - * @param n the rotation count (between 1 and 63, inclusive) - */ -#define SPH_ROTR64(x, n) - -/** - * This macro evaluates to inline or an equivalent construction, - * if available on the compilation platform, or to nothing otherwise. This - * is used to declare inline functions, for which the compiler should - * endeavour to include the code directly in the caller. Inline functions - * are typically defined in header files as replacement for macros. - */ -#define SPH_INLINE - -/** - * This macro is defined if the platform has been detected as using - * little-endian convention. This implies that the sph_u32 - * type (and the sph_u64 type also, if it is defined) has - * an exact width (i.e. exactly 32-bit, respectively 64-bit). - */ -#define SPH_LITTLE_ENDIAN - -/** - * This macro is defined if the platform has been detected as using - * big-endian convention. This implies that the sph_u32 - * type (and the sph_u64 type also, if it is defined) has - * an exact width (i.e. exactly 32-bit, respectively 64-bit). - */ -#define SPH_BIG_ENDIAN - -/** - * This macro is defined if 32-bit words (and 64-bit words, if defined) - * can be read from and written to memory efficiently in little-endian - * convention. This is the case for little-endian platforms, and also - * for the big-endian platforms which have special little-endian access - * opcodes (e.g. Ultrasparc). - */ -#define SPH_LITTLE_FAST - -/** - * This macro is defined if 32-bit words (and 64-bit words, if defined) - * can be read from and written to memory efficiently in big-endian - * convention. This is the case for little-endian platforms, and also - * for the little-endian platforms which have special big-endian access - * opcodes. - */ -#define SPH_BIG_FAST - -/** - * On some platforms, this macro is defined to an unsigned integer type - * into which pointer values may be cast. The resulting value can then - * be tested for being a multiple of 2, 4 or 8, indicating an aligned - * pointer for, respectively, 16-bit, 32-bit or 64-bit memory accesses. - */ -#define SPH_UPTR - -/** - * When defined, this macro indicates that unaligned memory accesses - * are possible with only a minor penalty, and thus should be prefered - * over strategies which first copy data to an aligned buffer. - */ -#define SPH_UNALIGNED - -/** - * Byte-swap a 32-bit word (i.e. 0x12345678 becomes - * 0x78563412). This is an inline function which resorts - * to inline assembly on some platforms, for better performance. - * - * @param x the 32-bit value to byte-swap - * @return the byte-swapped value - */ -static inline sph_u32 sph_bswap32(sph_u32 x); - -/** - * Byte-swap a 64-bit word. This is an inline function which resorts - * to inline assembly on some platforms, for better performance. This - * function is defined only if a suitable 64-bit type was found for - * sph_u64 - * - * @param x the 64-bit value to byte-swap - * @return the byte-swapped value - */ -static inline sph_u64 sph_bswap64(sph_u64 x); - -/** - * Decode a 16-bit unsigned value from memory, in little-endian convention - * (least significant byte comes first). - * - * @param src the source address - * @return the decoded value - */ -static inline unsigned sph_dec16le(const void *src); - -/** - * Encode a 16-bit unsigned value into memory, in little-endian convention - * (least significant byte comes first). - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc16le(void *dst, unsigned val); - -/** - * Decode a 16-bit unsigned value from memory, in big-endian convention - * (most significant byte comes first). - * - * @param src the source address - * @return the decoded value - */ -static inline unsigned sph_dec16be(const void *src); - -/** - * Encode a 16-bit unsigned value into memory, in big-endian convention - * (most significant byte comes first). - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc16be(void *dst, unsigned val); - -/** - * Decode a 32-bit unsigned value from memory, in little-endian convention - * (least significant byte comes first). - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u32 sph_dec32le(const void *src); - -/** - * Decode a 32-bit unsigned value from memory, in little-endian convention - * (least significant byte comes first). This function assumes that the - * source address is suitably aligned for a direct access, if the platform - * supports such things; it can thus be marginally faster than the generic - * sph_dec32le() function. - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u32 sph_dec32le_aligned(const void *src); - -/** - * Encode a 32-bit unsigned value into memory, in little-endian convention - * (least significant byte comes first). - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc32le(void *dst, sph_u32 val); - -/** - * Encode a 32-bit unsigned value into memory, in little-endian convention - * (least significant byte comes first). This function assumes that the - * destination address is suitably aligned for a direct access, if the - * platform supports such things; it can thus be marginally faster than - * the generic sph_enc32le() function. - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc32le_aligned(void *dst, sph_u32 val); - -/** - * Decode a 32-bit unsigned value from memory, in big-endian convention - * (most significant byte comes first). - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u32 sph_dec32be(const void *src); - -/** - * Decode a 32-bit unsigned value from memory, in big-endian convention - * (most significant byte comes first). This function assumes that the - * source address is suitably aligned for a direct access, if the platform - * supports such things; it can thus be marginally faster than the generic - * sph_dec32be() function. - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u32 sph_dec32be_aligned(const void *src); - -/** - * Encode a 32-bit unsigned value into memory, in big-endian convention - * (most significant byte comes first). - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc32be(void *dst, sph_u32 val); - -/** - * Encode a 32-bit unsigned value into memory, in big-endian convention - * (most significant byte comes first). This function assumes that the - * destination address is suitably aligned for a direct access, if the - * platform supports such things; it can thus be marginally faster than - * the generic sph_enc32be() function. - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc32be_aligned(void *dst, sph_u32 val); - -/** - * Decode a 64-bit unsigned value from memory, in little-endian convention - * (least significant byte comes first). This function is defined only - * if a suitable 64-bit type was detected and used for sph_u64. - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u64 sph_dec64le(const void *src); - -/** - * Decode a 64-bit unsigned value from memory, in little-endian convention - * (least significant byte comes first). This function assumes that the - * source address is suitably aligned for a direct access, if the platform - * supports such things; it can thus be marginally faster than the generic - * sph_dec64le() function. This function is defined only - * if a suitable 64-bit type was detected and used for sph_u64. - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u64 sph_dec64le_aligned(const void *src); - -/** - * Encode a 64-bit unsigned value into memory, in little-endian convention - * (least significant byte comes first). This function is defined only - * if a suitable 64-bit type was detected and used for sph_u64. - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc64le(void *dst, sph_u64 val); - -/** - * Encode a 64-bit unsigned value into memory, in little-endian convention - * (least significant byte comes first). This function assumes that the - * destination address is suitably aligned for a direct access, if the - * platform supports such things; it can thus be marginally faster than - * the generic sph_enc64le() function. This function is defined - * only if a suitable 64-bit type was detected and used for - * sph_u64. - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc64le_aligned(void *dst, sph_u64 val); - -/** - * Decode a 64-bit unsigned value from memory, in big-endian convention - * (most significant byte comes first). This function is defined only - * if a suitable 64-bit type was detected and used for sph_u64. - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u64 sph_dec64be(const void *src); - -/** - * Decode a 64-bit unsigned value from memory, in big-endian convention - * (most significant byte comes first). This function assumes that the - * source address is suitably aligned for a direct access, if the platform - * supports such things; it can thus be marginally faster than the generic - * sph_dec64be() function. This function is defined only - * if a suitable 64-bit type was detected and used for sph_u64. - * - * @param src the source address - * @return the decoded value - */ -static inline sph_u64 sph_dec64be_aligned(const void *src); - -/** - * Encode a 64-bit unsigned value into memory, in big-endian convention - * (most significant byte comes first). This function is defined only - * if a suitable 64-bit type was detected and used for sph_u64. - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc64be(void *dst, sph_u64 val); - -/** - * Encode a 64-bit unsigned value into memory, in big-endian convention - * (most significant byte comes first). This function assumes that the - * destination address is suitably aligned for a direct access, if the - * platform supports such things; it can thus be marginally faster than - * the generic sph_enc64be() function. This function is defined - * only if a suitable 64-bit type was detected and used for - * sph_u64. - * - * @param dst the destination buffer - * @param val the value to encode - */ -static inline void sph_enc64be_aligned(void *dst, sph_u64 val); - -#endif - -/* ============== END documentation block for Doxygen ============= */ - -#ifndef DOXYGEN_IGNORE - -/* - * We want to define the types "sph_u32" and "sph_u64" which hold - * unsigned values of at least, respectively, 32 and 64 bits. These - * tests should select appropriate types for most platforms. The - * macro "SPH_64" is defined if the 64-bit is supported. - */ - -#undef SPH_64 -#undef SPH_64_TRUE - -#if defined __STDC__ && __STDC_VERSION__ >= 199901L - -/* - * On C99 implementations, we can use to get an exact 64-bit - * type, if any, or otherwise use a wider type (which must exist, for - * C99 conformance). - */ - -#include - -#ifdef UINT32_MAX -typedef uint32_t sph_u32; -typedef int32_t sph_s32; -#else -typedef uint_fast32_t sph_u32; -typedef int_fast32_t sph_s32; -#endif -#if !SPH_NO_64 -#ifdef UINT64_MAX -typedef uint64_t sph_u64; -typedef int64_t sph_s64; -#else -typedef uint_fast64_t sph_u64; -typedef int_fast64_t sph_s64; -#endif -#endif - -#define SPH_C32(x) ((sph_u32)(x)) -#if !SPH_NO_64 -#define SPH_C64(x) ((sph_u64)(x)) -#define SPH_64 1 -#endif - -#else - -/* - * On non-C99 systems, we use "unsigned int" if it is wide enough, - * "unsigned long" otherwise. This supports all "reasonable" architectures. - * We have to be cautious: pre-C99 preprocessors handle constants - * differently in '#if' expressions. Hence the shifts to test UINT_MAX. - */ - -#if ((UINT_MAX >> 11) >> 11) >= 0x3FF - -typedef unsigned int sph_u32; -typedef int sph_s32; - -#define SPH_C32(x) ((sph_u32)(x ## U)) - -#else - -typedef unsigned long sph_u32; -typedef long sph_s32; - -#define SPH_C32(x) ((sph_u32)(x ## UL)) - -#endif - -#if !SPH_NO_64 - -/* - * We want a 64-bit type. We use "unsigned long" if it is wide enough (as - * is common on 64-bit architectures such as AMD64, Alpha or Sparcv9), - * "unsigned long long" otherwise, if available. We use ULLONG_MAX to - * test whether "unsigned long long" is available; we also know that - * gcc features this type, even if the libc header do not know it. - */ - -#if ((ULONG_MAX >> 31) >> 31) >= 3 - -typedef unsigned long sph_u64; -typedef long sph_s64; - -#define SPH_C64(x) ((sph_u64)(x ## UL)) - -#define SPH_64 1 - -#elif ((ULLONG_MAX >> 31) >> 31) >= 3 || defined __GNUC__ - -typedef unsigned long long sph_u64; -typedef long long sph_s64; - -#define SPH_C64(x) ((sph_u64)(x ## ULL)) - -#define SPH_64 1 - -#else - -/* - * No 64-bit type... - */ - -#endif - -#endif - -#endif - -/* - * If the "unsigned long" type has length 64 bits or more, then this is - * a "true" 64-bit architectures. This is also true with Visual C on - * amd64, even though the "long" type is limited to 32 bits. - */ -#if SPH_64 && (((ULONG_MAX >> 31) >> 31) >= 3 || defined _M_X64) -#define SPH_64_TRUE 1 -#endif - -/* - * Implementation note: some processors have specific opcodes to perform - * a rotation. Recent versions of gcc recognize the expression above and - * use the relevant opcodes, when appropriate. - */ - -#define SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) -#define SPH_ROTL32(x, n) SPH_T32(((x) << (n)) | ((x) >> (32 - (n)))) -#define SPH_ROTR32(x, n) SPH_ROTL32(x, (32 - (n))) - -#if SPH_64 - -#define SPH_T64(x) ((x) & SPH_C64(0xFFFFFFFFFFFFFFFF)) -#define SPH_ROTL64(x, n) SPH_T64(((x) << (n)) | ((x) >> (64 - (n)))) -#define SPH_ROTR64(x, n) SPH_ROTL64(x, (64 - (n))) - -#endif - -#ifndef DOXYGEN_IGNORE -/* - * Define SPH_INLINE to be an "inline" qualifier, if available. We define - * some small macro-like functions which benefit greatly from being inlined. - */ -#if (defined __STDC__ && __STDC_VERSION__ >= 199901L) || defined __GNUC__ -#define SPH_INLINE inline -#elif defined _MSC_VER -#define SPH_INLINE __inline -#else -#define SPH_INLINE -#endif -#endif - -/* - * We define some macros which qualify the architecture. These macros - * may be explicit set externally (e.g. as compiler parameters). The - * code below sets those macros if they are not already defined. - * - * Most macros are boolean, thus evaluate to either zero or non-zero. - * The SPH_UPTR macro is special, in that it evaluates to a C type, - * or is not defined. - * - * SPH_UPTR if defined: unsigned type to cast pointers into - * - * SPH_UNALIGNED non-zero if unaligned accesses are efficient - * SPH_LITTLE_ENDIAN non-zero if architecture is known to be little-endian - * SPH_BIG_ENDIAN non-zero if architecture is known to be big-endian - * SPH_LITTLE_FAST non-zero if little-endian decoding is fast - * SPH_BIG_FAST non-zero if big-endian decoding is fast - * - * If SPH_UPTR is defined, then encoding and decoding of 32-bit and 64-bit - * values will try to be "smart". Either SPH_LITTLE_ENDIAN or SPH_BIG_ENDIAN - * _must_ be non-zero in those situations. The 32-bit and 64-bit types - * _must_ also have an exact width. - * - * SPH_SPARCV9_GCC_32 UltraSPARC-compatible with gcc, 32-bit mode - * SPH_SPARCV9_GCC_64 UltraSPARC-compatible with gcc, 64-bit mode - * SPH_SPARCV9_GCC UltraSPARC-compatible with gcc - * SPH_I386_GCC x86-compatible (32-bit) with gcc - * SPH_I386_MSVC x86-compatible (32-bit) with Microsoft Visual C - * SPH_AMD64_GCC x86-compatible (64-bit) with gcc - * SPH_AMD64_MSVC x86-compatible (64-bit) with Microsoft Visual C - * SPH_PPC32_GCC PowerPC, 32-bit, with gcc - * SPH_PPC64_GCC PowerPC, 64-bit, with gcc - * - * TODO: enhance automatic detection, for more architectures and compilers. - * Endianness is the most important. SPH_UNALIGNED and SPH_UPTR help with - * some very fast functions (e.g. MD4) when using unaligned input data. - * The CPU-specific-with-GCC macros are useful only for inline assembly, - * normally restrained to this header file. - */ - -/* - * 32-bit x86, aka "i386 compatible". - */ -#if defined __i386__ || defined _M_IX86 - -#define SPH_DETECT_UNALIGNED 1 -#define SPH_DETECT_LITTLE_ENDIAN 1 -#define SPH_DETECT_UPTR sph_u32 -#ifdef __GNUC__ -#define SPH_DETECT_I386_GCC 1 -#endif -#ifdef _MSC_VER -#define SPH_DETECT_I386_MSVC 1 -#endif - -/* - * 64-bit x86, hereafter known as "amd64". - */ -#elif defined __x86_64 || defined _M_X64 - -#define SPH_DETECT_UNALIGNED 1 -#define SPH_DETECT_LITTLE_ENDIAN 1 -#define SPH_DETECT_UPTR sph_u64 -#ifdef __GNUC__ -#define SPH_DETECT_AMD64_GCC 1 -#endif -#ifdef _MSC_VER -#define SPH_DETECT_AMD64_MSVC 1 -#endif - -/* - * 64-bit Sparc architecture (implies v9). - */ -#elif ((defined __sparc__ || defined __sparc) && defined __arch64__) \ - || defined __sparcv9 - -#define SPH_DETECT_BIG_ENDIAN 1 -#define SPH_DETECT_UPTR sph_u64 -#ifdef __GNUC__ -#define SPH_DETECT_SPARCV9_GCC_64 1 -#define SPH_DETECT_LITTLE_FAST 1 -#endif - -/* - * 32-bit Sparc. - */ -#elif (defined __sparc__ || defined __sparc) \ - && !(defined __sparcv9 || defined __arch64__) - -#define SPH_DETECT_BIG_ENDIAN 1 -#define SPH_DETECT_UPTR sph_u32 -#if defined __GNUC__ && defined __sparc_v9__ -#define SPH_DETECT_SPARCV9_GCC_32 1 -#define SPH_DETECT_LITTLE_FAST 1 -#endif - -/* - * ARM, little-endian. - */ -#elif defined __arm__ && __ARMEL__ - -#define SPH_DETECT_LITTLE_ENDIAN 1 - -/* - * MIPS, little-endian. - */ -#elif MIPSEL || _MIPSEL || __MIPSEL || __MIPSEL__ - -#define SPH_DETECT_LITTLE_ENDIAN 1 - -/* - * MIPS, big-endian. - */ -#elif MIPSEB || _MIPSEB || __MIPSEB || __MIPSEB__ - -#define SPH_DETECT_BIG_ENDIAN 1 - -/* - * PowerPC. - */ -#elif defined __powerpc__ || defined __POWERPC__ || defined __ppc__ \ - || defined _ARCH_PPC - -/* - * Note: we do not declare cross-endian access to be "fast": even if - * using inline assembly, implementation should still assume that - * keeping the decoded word in a temporary is faster than decoding - * it again. - */ -#if defined __GNUC__ -#if SPH_64_TRUE -#define SPH_DETECT_PPC64_GCC 1 -#else -#define SPH_DETECT_PPC32_GCC 1 -#endif -#endif - -#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN -#define SPH_DETECT_BIG_ENDIAN 1 -#elif defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN -#define SPH_DETECT_LITTLE_ENDIAN 1 -#endif - -/* - * Itanium, 64-bit. - */ -#elif defined __ia64 || defined __ia64__ \ - || defined __itanium__ || defined _M_IA64 - -#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN -#define SPH_DETECT_BIG_ENDIAN 1 -#else -#define SPH_DETECT_LITTLE_ENDIAN 1 -#endif -#if defined __LP64__ || defined _LP64 -#define SPH_DETECT_UPTR sph_u64 -#else -#define SPH_DETECT_UPTR sph_u32 -#endif - -#endif - -#if defined SPH_DETECT_SPARCV9_GCC_32 || defined SPH_DETECT_SPARCV9_GCC_64 -#define SPH_DETECT_SPARCV9_GCC 1 -#endif - -#if defined SPH_DETECT_UNALIGNED && !defined SPH_UNALIGNED -#define SPH_UNALIGNED SPH_DETECT_UNALIGNED -#endif -#if defined SPH_DETECT_UPTR && !defined SPH_UPTR -#define SPH_UPTR SPH_DETECT_UPTR -#endif -#if defined SPH_DETECT_LITTLE_ENDIAN && !defined SPH_LITTLE_ENDIAN -#define SPH_LITTLE_ENDIAN SPH_DETECT_LITTLE_ENDIAN -#endif -#if defined SPH_DETECT_BIG_ENDIAN && !defined SPH_BIG_ENDIAN -#define SPH_BIG_ENDIAN SPH_DETECT_BIG_ENDIAN -#endif -#if defined SPH_DETECT_LITTLE_FAST && !defined SPH_LITTLE_FAST -#define SPH_LITTLE_FAST SPH_DETECT_LITTLE_FAST -#endif -#if defined SPH_DETECT_BIG_FAST && !defined SPH_BIG_FAST -#define SPH_BIG_FAST SPH_DETECT_BIG_FAST -#endif -#if defined SPH_DETECT_SPARCV9_GCC_32 && !defined SPH_SPARCV9_GCC_32 -#define SPH_SPARCV9_GCC_32 SPH_DETECT_SPARCV9_GCC_32 -#endif -#if defined SPH_DETECT_SPARCV9_GCC_64 && !defined SPH_SPARCV9_GCC_64 -#define SPH_SPARCV9_GCC_64 SPH_DETECT_SPARCV9_GCC_64 -#endif -#if defined SPH_DETECT_SPARCV9_GCC && !defined SPH_SPARCV9_GCC -#define SPH_SPARCV9_GCC SPH_DETECT_SPARCV9_GCC -#endif -#if defined SPH_DETECT_I386_GCC && !defined SPH_I386_GCC -#define SPH_I386_GCC SPH_DETECT_I386_GCC -#endif -#if defined SPH_DETECT_I386_MSVC && !defined SPH_I386_MSVC -#define SPH_I386_MSVC SPH_DETECT_I386_MSVC -#endif -#if defined SPH_DETECT_AMD64_GCC && !defined SPH_AMD64_GCC -#define SPH_AMD64_GCC SPH_DETECT_AMD64_GCC -#endif -#if defined SPH_DETECT_AMD64_MSVC && !defined SPH_AMD64_MSVC -#define SPH_AMD64_MSVC SPH_DETECT_AMD64_MSVC -#endif -#if defined SPH_DETECT_PPC32_GCC && !defined SPH_PPC32_GCC -#define SPH_PPC32_GCC SPH_DETECT_PPC32_GCC -#endif -#if defined SPH_DETECT_PPC64_GCC && !defined SPH_PPC64_GCC -#define SPH_PPC64_GCC SPH_DETECT_PPC64_GCC -#endif - -#if SPH_LITTLE_ENDIAN && !defined SPH_LITTLE_FAST -#define SPH_LITTLE_FAST 1 -#endif -#if SPH_BIG_ENDIAN && !defined SPH_BIG_FAST -#define SPH_BIG_FAST 1 -#endif - -#if defined SPH_UPTR && !(SPH_LITTLE_ENDIAN || SPH_BIG_ENDIAN) -#error SPH_UPTR defined, but endianness is not known. -#endif - -#if SPH_I386_GCC && !SPH_NO_ASM - -/* - * On x86 32-bit, with gcc, we use the bswapl opcode to byte-swap 32-bit - * values. - */ - -static SPH_INLINE sph_u32 -sph_bswap32(sph_u32 x) -{ - __asm__ __volatile__ ("bswapl %0" : "=r" (x) : "0" (x)); - return x; -} - -#if SPH_64 - -static SPH_INLINE sph_u64 -sph_bswap64(sph_u64 x) -{ - return ((sph_u64)sph_bswap32((sph_u32)x) << 32) - | (sph_u64)sph_bswap32((sph_u32)(x >> 32)); -} - -#endif - -#elif SPH_AMD64_GCC && !SPH_NO_ASM - -/* - * On x86 64-bit, with gcc, we use the bswapl opcode to byte-swap 32-bit - * and 64-bit values. - */ - -static SPH_INLINE sph_u32 -sph_bswap32(sph_u32 x) -{ - __asm__ __volatile__ ("bswapl %0" : "=r" (x) : "0" (x)); - return x; -} - -#if SPH_64 - -static SPH_INLINE sph_u64 -sph_bswap64(sph_u64 x) -{ - __asm__ __volatile__ ("bswapq %0" : "=r" (x) : "0" (x)); - return x; -} - -#endif - -/* - * Disabled code. Apparently, Microsoft Visual C 2005 is smart enough - * to generate proper opcodes for endianness swapping with the pure C - * implementation below. - * - -#elif SPH_I386_MSVC && !SPH_NO_ASM - -static __inline sph_u32 __declspec(naked) __fastcall -sph_bswap32(sph_u32 x) -{ - __asm { - bswap ecx - mov eax,ecx - ret - } -} - -#if SPH_64 - -static SPH_INLINE sph_u64 -sph_bswap64(sph_u64 x) -{ - return ((sph_u64)sph_bswap32((sph_u32)x) << 32) - | (sph_u64)sph_bswap32((sph_u32)(x >> 32)); -} - -#endif - - * - * [end of disabled code] - */ - -#else - -static SPH_INLINE sph_u32 -sph_bswap32(sph_u32 x) -{ - x = SPH_T32((x << 16) | (x >> 16)); - x = ((x & SPH_C32(0xFF00FF00)) >> 8) - | ((x & SPH_C32(0x00FF00FF)) << 8); - return x; -} - -#if SPH_64 - -/** - * Byte-swap a 64-bit value. - * - * @param x the input value - * @return the byte-swapped value - */ -static SPH_INLINE sph_u64 -sph_bswap64(sph_u64 x) -{ - x = SPH_T64((x << 32) | (x >> 32)); - x = ((x & SPH_C64(0xFFFF0000FFFF0000)) >> 16) - | ((x & SPH_C64(0x0000FFFF0000FFFF)) << 16); - x = ((x & SPH_C64(0xFF00FF00FF00FF00)) >> 8) - | ((x & SPH_C64(0x00FF00FF00FF00FF)) << 8); - return x; -} - -#endif - -#endif - -#if SPH_SPARCV9_GCC && !SPH_NO_ASM - -/* - * On UltraSPARC systems, native ordering is big-endian, but it is - * possible to perform little-endian read accesses by specifying the - * address space 0x88 (ASI_PRIMARY_LITTLE). Basically, either we use - * the opcode "lda [%reg]0x88,%dst", where %reg is the register which - * contains the source address and %dst is the destination register, - * or we use "lda [%reg+imm]%asi,%dst", which uses the %asi register - * to get the address space name. The latter format is better since it - * combines an addition and the actual access in a single opcode; but - * it requires the setting (and subsequent resetting) of %asi, which is - * slow. Some operations (i.e. MD5 compression function) combine many - * successive little-endian read accesses, which may share the same - * %asi setting. The macros below contain the appropriate inline - * assembly. - */ - -#define SPH_SPARCV9_SET_ASI \ - sph_u32 sph_sparcv9_asi; \ - __asm__ __volatile__ ( \ - "rd %%asi,%0\n\twr %%g0,0x88,%%asi" : "=r" (sph_sparcv9_asi)); - -#define SPH_SPARCV9_RESET_ASI \ - __asm__ __volatile__ ("wr %%g0,%0,%%asi" : : "r" (sph_sparcv9_asi)); - -#define SPH_SPARCV9_DEC32LE(base, idx) ({ \ - sph_u32 sph_sparcv9_tmp; \ - __asm__ __volatile__ ("lda [%1+" #idx "*4]%%asi,%0" \ - : "=r" (sph_sparcv9_tmp) : "r" (base)); \ - sph_sparcv9_tmp; \ - }) - -#endif - -static SPH_INLINE void -sph_enc16be(void *dst, unsigned val) -{ - ((unsigned char *)dst)[0] = (val >> 8); - ((unsigned char *)dst)[1] = val; -} - -static SPH_INLINE unsigned -sph_dec16be(const void *src) -{ - return ((unsigned)(((const unsigned char *)src)[0]) << 8) - | (unsigned)(((const unsigned char *)src)[1]); -} - -static SPH_INLINE void -sph_enc16le(void *dst, unsigned val) -{ - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = val >> 8; -} - -static SPH_INLINE unsigned -sph_dec16le(const void *src) -{ - return (unsigned)(((const unsigned char *)src)[0]) - | ((unsigned)(((const unsigned char *)src)[1]) << 8); -} - -/** - * Encode a 32-bit value into the provided buffer (big endian convention). - * - * @param dst the destination buffer - * @param val the 32-bit value to encode - */ -static SPH_INLINE void -sph_enc32be(void *dst, sph_u32 val) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_LITTLE_ENDIAN - val = sph_bswap32(val); -#endif - *(sph_u32 *)dst = val; -#else - if (((SPH_UPTR)dst & 3) == 0) { -#if SPH_LITTLE_ENDIAN - val = sph_bswap32(val); -#endif - *(sph_u32 *)dst = val; - } else { - ((unsigned char *)dst)[0] = (val >> 24); - ((unsigned char *)dst)[1] = (val >> 16); - ((unsigned char *)dst)[2] = (val >> 8); - ((unsigned char *)dst)[3] = val; - } -#endif -#else - ((unsigned char *)dst)[0] = (val >> 24); - ((unsigned char *)dst)[1] = (val >> 16); - ((unsigned char *)dst)[2] = (val >> 8); - ((unsigned char *)dst)[3] = val; -#endif -} - -/** - * Encode a 32-bit value into the provided buffer (big endian convention). - * The destination buffer must be properly aligned. - * - * @param dst the destination buffer (32-bit aligned) - * @param val the value to encode - */ -static SPH_INLINE void -sph_enc32be_aligned(void *dst, sph_u32 val) -{ -#if SPH_LITTLE_ENDIAN - *(sph_u32 *)dst = sph_bswap32(val); -#elif SPH_BIG_ENDIAN - *(sph_u32 *)dst = val; -#else - ((unsigned char *)dst)[0] = (val >> 24); - ((unsigned char *)dst)[1] = (val >> 16); - ((unsigned char *)dst)[2] = (val >> 8); - ((unsigned char *)dst)[3] = val; -#endif -} - -/** - * Decode a 32-bit value from the provided buffer (big endian convention). - * - * @param src the source buffer - * @return the decoded value - */ -static SPH_INLINE sph_u32 -sph_dec32be(const void *src) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_LITTLE_ENDIAN - return sph_bswap32(*(const sph_u32 *)src); -#else - return *(const sph_u32 *)src; -#endif -#else - if (((SPH_UPTR)src & 3) == 0) { -#if SPH_LITTLE_ENDIAN - return sph_bswap32(*(const sph_u32 *)src); -#else - return *(const sph_u32 *)src; -#endif - } else { - return ((sph_u32)(((const unsigned char *)src)[0]) << 24) - | ((sph_u32)(((const unsigned char *)src)[1]) << 16) - | ((sph_u32)(((const unsigned char *)src)[2]) << 8) - | (sph_u32)(((const unsigned char *)src)[3]); - } -#endif -#else - return ((sph_u32)(((const unsigned char *)src)[0]) << 24) - | ((sph_u32)(((const unsigned char *)src)[1]) << 16) - | ((sph_u32)(((const unsigned char *)src)[2]) << 8) - | (sph_u32)(((const unsigned char *)src)[3]); -#endif -} - -/** - * Decode a 32-bit value from the provided buffer (big endian convention). - * The source buffer must be properly aligned. - * - * @param src the source buffer (32-bit aligned) - * @return the decoded value - */ -static SPH_INLINE sph_u32 -sph_dec32be_aligned(const void *src) -{ -#if SPH_LITTLE_ENDIAN - return sph_bswap32(*(const sph_u32 *)src); -#elif SPH_BIG_ENDIAN - return *(const sph_u32 *)src; -#else - return ((sph_u32)(((const unsigned char *)src)[0]) << 24) - | ((sph_u32)(((const unsigned char *)src)[1]) << 16) - | ((sph_u32)(((const unsigned char *)src)[2]) << 8) - | (sph_u32)(((const unsigned char *)src)[3]); -#endif -} - -/** - * Encode a 32-bit value into the provided buffer (little endian convention). - * - * @param dst the destination buffer - * @param val the 32-bit value to encode - */ -static SPH_INLINE void -sph_enc32le(void *dst, sph_u32 val) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_BIG_ENDIAN - val = sph_bswap32(val); -#endif - *(sph_u32 *)dst = val; -#else - if (((SPH_UPTR)dst & 3) == 0) { -#if SPH_BIG_ENDIAN - val = sph_bswap32(val); -#endif - *(sph_u32 *)dst = val; - } else { - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = (val >> 8); - ((unsigned char *)dst)[2] = (val >> 16); - ((unsigned char *)dst)[3] = (val >> 24); - } -#endif -#else - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = (val >> 8); - ((unsigned char *)dst)[2] = (val >> 16); - ((unsigned char *)dst)[3] = (val >> 24); -#endif -} - -/** - * Encode a 32-bit value into the provided buffer (little endian convention). - * The destination buffer must be properly aligned. - * - * @param dst the destination buffer (32-bit aligned) - * @param val the value to encode - */ -static SPH_INLINE void -sph_enc32le_aligned(void *dst, sph_u32 val) -{ -#if SPH_LITTLE_ENDIAN - *(sph_u32 *)dst = val; -#elif SPH_BIG_ENDIAN - *(sph_u32 *)dst = sph_bswap32(val); -#else - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = (val >> 8); - ((unsigned char *)dst)[2] = (val >> 16); - ((unsigned char *)dst)[3] = (val >> 24); -#endif -} - -/** - * Decode a 32-bit value from the provided buffer (little endian convention). - * - * @param src the source buffer - * @return the decoded value - */ -static SPH_INLINE sph_u32 -sph_dec32le(const void *src) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_BIG_ENDIAN - return sph_bswap32(*(const sph_u32 *)src); -#else - return *(const sph_u32 *)src; -#endif -#else - if (((SPH_UPTR)src & 3) == 0) { -#if SPH_BIG_ENDIAN -#if SPH_SPARCV9_GCC && !SPH_NO_ASM - sph_u32 tmp; - - /* - * "__volatile__" is needed here because without it, - * gcc-3.4.3 miscompiles the code and performs the - * access before the test on the address, thus triggering - * a bus error... - */ - __asm__ __volatile__ ( - "lda [%1]0x88,%0" : "=r" (tmp) : "r" (src)); - return tmp; -/* - * On PowerPC, this turns out not to be worth the effort: the inline - * assembly makes GCC optimizer uncomfortable, which tends to nullify - * the decoding gains. - * - * For most hash functions, using this inline assembly trick changes - * hashing speed by less than 5% and often _reduces_ it. The biggest - * gains are for MD4 (+11%) and CubeHash (+30%). For all others, it is - * less then 10%. The speed gain on CubeHash is probably due to the - * chronic shortage of registers that CubeHash endures; for the other - * functions, the generic code appears to be efficient enough already. - * -#elif (SPH_PPC32_GCC || SPH_PPC64_GCC) && !SPH_NO_ASM - sph_u32 tmp; - - __asm__ __volatile__ ( - "lwbrx %0,0,%1" : "=r" (tmp) : "r" (src)); - return tmp; - */ -#else - return sph_bswap32(*(const sph_u32 *)src); -#endif -#else - return *(const sph_u32 *)src; -#endif - } else { - return (sph_u32)(((const unsigned char *)src)[0]) - | ((sph_u32)(((const unsigned char *)src)[1]) << 8) - | ((sph_u32)(((const unsigned char *)src)[2]) << 16) - | ((sph_u32)(((const unsigned char *)src)[3]) << 24); - } -#endif -#else - return (sph_u32)(((const unsigned char *)src)[0]) - | ((sph_u32)(((const unsigned char *)src)[1]) << 8) - | ((sph_u32)(((const unsigned char *)src)[2]) << 16) - | ((sph_u32)(((const unsigned char *)src)[3]) << 24); -#endif -} - -/** - * Decode a 32-bit value from the provided buffer (little endian convention). - * The source buffer must be properly aligned. - * - * @param src the source buffer (32-bit aligned) - * @return the decoded value - */ -static SPH_INLINE sph_u32 -sph_dec32le_aligned(const void *src) -{ -#if SPH_LITTLE_ENDIAN - return *(const sph_u32 *)src; -#elif SPH_BIG_ENDIAN -#if SPH_SPARCV9_GCC && !SPH_NO_ASM - sph_u32 tmp; - - __asm__ __volatile__ ("lda [%1]0x88,%0" : "=r" (tmp) : "r" (src)); - return tmp; -/* - * Not worth it generally. - * -#elif (SPH_PPC32_GCC || SPH_PPC64_GCC) && !SPH_NO_ASM - sph_u32 tmp; - - __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (tmp) : "r" (src)); - return tmp; - */ -#else - return sph_bswap32(*(const sph_u32 *)src); -#endif -#else - return (sph_u32)(((const unsigned char *)src)[0]) - | ((sph_u32)(((const unsigned char *)src)[1]) << 8) - | ((sph_u32)(((const unsigned char *)src)[2]) << 16) - | ((sph_u32)(((const unsigned char *)src)[3]) << 24); -#endif -} - -#if SPH_64 - -/** - * Encode a 64-bit value into the provided buffer (big endian convention). - * - * @param dst the destination buffer - * @param val the 64-bit value to encode - */ -static SPH_INLINE void -sph_enc64be(void *dst, sph_u64 val) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_LITTLE_ENDIAN - val = sph_bswap64(val); -#endif - *(sph_u64 *)dst = val; -#else - if (((SPH_UPTR)dst & 7) == 0) { -#if SPH_LITTLE_ENDIAN - val = sph_bswap64(val); -#endif - *(sph_u64 *)dst = val; - } else { - ((unsigned char *)dst)[0] = (val >> 56); - ((unsigned char *)dst)[1] = (val >> 48); - ((unsigned char *)dst)[2] = (val >> 40); - ((unsigned char *)dst)[3] = (val >> 32); - ((unsigned char *)dst)[4] = (val >> 24); - ((unsigned char *)dst)[5] = (val >> 16); - ((unsigned char *)dst)[6] = (val >> 8); - ((unsigned char *)dst)[7] = val; - } -#endif -#else - ((unsigned char *)dst)[0] = (val >> 56); - ((unsigned char *)dst)[1] = (val >> 48); - ((unsigned char *)dst)[2] = (val >> 40); - ((unsigned char *)dst)[3] = (val >> 32); - ((unsigned char *)dst)[4] = (val >> 24); - ((unsigned char *)dst)[5] = (val >> 16); - ((unsigned char *)dst)[6] = (val >> 8); - ((unsigned char *)dst)[7] = val; -#endif -} - -/** - * Encode a 64-bit value into the provided buffer (big endian convention). - * The destination buffer must be properly aligned. - * - * @param dst the destination buffer (64-bit aligned) - * @param val the value to encode - */ -static SPH_INLINE void -sph_enc64be_aligned(void *dst, sph_u64 val) -{ -#if SPH_LITTLE_ENDIAN - *(sph_u64 *)dst = sph_bswap64(val); -#elif SPH_BIG_ENDIAN - *(sph_u64 *)dst = val; -#else - ((unsigned char *)dst)[0] = (val >> 56); - ((unsigned char *)dst)[1] = (val >> 48); - ((unsigned char *)dst)[2] = (val >> 40); - ((unsigned char *)dst)[3] = (val >> 32); - ((unsigned char *)dst)[4] = (val >> 24); - ((unsigned char *)dst)[5] = (val >> 16); - ((unsigned char *)dst)[6] = (val >> 8); - ((unsigned char *)dst)[7] = val; -#endif -} - -/** - * Decode a 64-bit value from the provided buffer (big endian convention). - * - * @param src the source buffer - * @return the decoded value - */ -static SPH_INLINE sph_u64 -sph_dec64be(const void *src) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_LITTLE_ENDIAN - return sph_bswap64(*(const sph_u64 *)src); -#else - return *(const sph_u64 *)src; -#endif -#else - if (((SPH_UPTR)src & 7) == 0) { -#if SPH_LITTLE_ENDIAN - return sph_bswap64(*(const sph_u64 *)src); -#else - return *(const sph_u64 *)src; -#endif - } else { - return ((sph_u64)(((const unsigned char *)src)[0]) << 56) - | ((sph_u64)(((const unsigned char *)src)[1]) << 48) - | ((sph_u64)(((const unsigned char *)src)[2]) << 40) - | ((sph_u64)(((const unsigned char *)src)[3]) << 32) - | ((sph_u64)(((const unsigned char *)src)[4]) << 24) - | ((sph_u64)(((const unsigned char *)src)[5]) << 16) - | ((sph_u64)(((const unsigned char *)src)[6]) << 8) - | (sph_u64)(((const unsigned char *)src)[7]); - } -#endif -#else - return ((sph_u64)(((const unsigned char *)src)[0]) << 56) - | ((sph_u64)(((const unsigned char *)src)[1]) << 48) - | ((sph_u64)(((const unsigned char *)src)[2]) << 40) - | ((sph_u64)(((const unsigned char *)src)[3]) << 32) - | ((sph_u64)(((const unsigned char *)src)[4]) << 24) - | ((sph_u64)(((const unsigned char *)src)[5]) << 16) - | ((sph_u64)(((const unsigned char *)src)[6]) << 8) - | (sph_u64)(((const unsigned char *)src)[7]); -#endif -} - -/** - * Decode a 64-bit value from the provided buffer (big endian convention). - * The source buffer must be properly aligned. - * - * @param src the source buffer (64-bit aligned) - * @return the decoded value - */ -static SPH_INLINE sph_u64 -sph_dec64be_aligned(const void *src) -{ -#if SPH_LITTLE_ENDIAN - return sph_bswap64(*(const sph_u64 *)src); -#elif SPH_BIG_ENDIAN - return *(const sph_u64 *)src; -#else - return ((sph_u64)(((const unsigned char *)src)[0]) << 56) - | ((sph_u64)(((const unsigned char *)src)[1]) << 48) - | ((sph_u64)(((const unsigned char *)src)[2]) << 40) - | ((sph_u64)(((const unsigned char *)src)[3]) << 32) - | ((sph_u64)(((const unsigned char *)src)[4]) << 24) - | ((sph_u64)(((const unsigned char *)src)[5]) << 16) - | ((sph_u64)(((const unsigned char *)src)[6]) << 8) - | (sph_u64)(((const unsigned char *)src)[7]); -#endif -} - -/** - * Encode a 64-bit value into the provided buffer (little endian convention). - * - * @param dst the destination buffer - * @param val the 64-bit value to encode - */ -static SPH_INLINE void -sph_enc64le(void *dst, sph_u64 val) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_BIG_ENDIAN - val = sph_bswap64(val); -#endif - *(sph_u64 *)dst = val; -#else - if (((SPH_UPTR)dst & 7) == 0) { -#if SPH_BIG_ENDIAN - val = sph_bswap64(val); -#endif - *(sph_u64 *)dst = val; - } else { - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = (val >> 8); - ((unsigned char *)dst)[2] = (val >> 16); - ((unsigned char *)dst)[3] = (val >> 24); - ((unsigned char *)dst)[4] = (val >> 32); - ((unsigned char *)dst)[5] = (val >> 40); - ((unsigned char *)dst)[6] = (val >> 48); - ((unsigned char *)dst)[7] = (val >> 56); - } -#endif -#else - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = (val >> 8); - ((unsigned char *)dst)[2] = (val >> 16); - ((unsigned char *)dst)[3] = (val >> 24); - ((unsigned char *)dst)[4] = (val >> 32); - ((unsigned char *)dst)[5] = (val >> 40); - ((unsigned char *)dst)[6] = (val >> 48); - ((unsigned char *)dst)[7] = (val >> 56); -#endif -} - -/** - * Encode a 64-bit value into the provided buffer (little endian convention). - * The destination buffer must be properly aligned. - * - * @param dst the destination buffer (64-bit aligned) - * @param val the value to encode - */ -static SPH_INLINE void -sph_enc64le_aligned(void *dst, sph_u64 val) -{ -#if SPH_LITTLE_ENDIAN - *(sph_u64 *)dst = val; -#elif SPH_BIG_ENDIAN - *(sph_u64 *)dst = sph_bswap64(val); -#else - ((unsigned char *)dst)[0] = val; - ((unsigned char *)dst)[1] = (val >> 8); - ((unsigned char *)dst)[2] = (val >> 16); - ((unsigned char *)dst)[3] = (val >> 24); - ((unsigned char *)dst)[4] = (val >> 32); - ((unsigned char *)dst)[5] = (val >> 40); - ((unsigned char *)dst)[6] = (val >> 48); - ((unsigned char *)dst)[7] = (val >> 56); -#endif -} - -/** - * Decode a 64-bit value from the provided buffer (little endian convention). - * - * @param src the source buffer - * @return the decoded value - */ -static SPH_INLINE sph_u64 -sph_dec64le(const void *src) -{ -#if defined SPH_UPTR -#if SPH_UNALIGNED -#if SPH_BIG_ENDIAN - return sph_bswap64(*(const sph_u64 *)src); -#else - return *(const sph_u64 *)src; -#endif -#else - if (((SPH_UPTR)src & 7) == 0) { -#if SPH_BIG_ENDIAN -#if SPH_SPARCV9_GCC_64 && !SPH_NO_ASM - sph_u64 tmp; - - __asm__ __volatile__ ( - "ldxa [%1]0x88,%0" : "=r" (tmp) : "r" (src)); - return tmp; -/* - * Not worth it generally. - * -#elif SPH_PPC32_GCC && !SPH_NO_ASM - return (sph_u64)sph_dec32le_aligned(src) - | ((sph_u64)sph_dec32le_aligned( - (const char *)src + 4) << 32); -#elif SPH_PPC64_GCC && !SPH_NO_ASM - sph_u64 tmp; - - __asm__ __volatile__ ( - "ldbrx %0,0,%1" : "=r" (tmp) : "r" (src)); - return tmp; - */ -#else - return sph_bswap64(*(const sph_u64 *)src); -#endif -#else - return *(const sph_u64 *)src; -#endif - } else { - return (sph_u64)(((const unsigned char *)src)[0]) - | ((sph_u64)(((const unsigned char *)src)[1]) << 8) - | ((sph_u64)(((const unsigned char *)src)[2]) << 16) - | ((sph_u64)(((const unsigned char *)src)[3]) << 24) - | ((sph_u64)(((const unsigned char *)src)[4]) << 32) - | ((sph_u64)(((const unsigned char *)src)[5]) << 40) - | ((sph_u64)(((const unsigned char *)src)[6]) << 48) - | ((sph_u64)(((const unsigned char *)src)[7]) << 56); - } -#endif -#else - return (sph_u64)(((const unsigned char *)src)[0]) - | ((sph_u64)(((const unsigned char *)src)[1]) << 8) - | ((sph_u64)(((const unsigned char *)src)[2]) << 16) - | ((sph_u64)(((const unsigned char *)src)[3]) << 24) - | ((sph_u64)(((const unsigned char *)src)[4]) << 32) - | ((sph_u64)(((const unsigned char *)src)[5]) << 40) - | ((sph_u64)(((const unsigned char *)src)[6]) << 48) - | ((sph_u64)(((const unsigned char *)src)[7]) << 56); -#endif -} - -/** - * Decode a 64-bit value from the provided buffer (little endian convention). - * The source buffer must be properly aligned. - * - * @param src the source buffer (64-bit aligned) - * @return the decoded value - */ -static SPH_INLINE sph_u64 -sph_dec64le_aligned(const void *src) -{ -#if SPH_LITTLE_ENDIAN - return *(const sph_u64 *)src; -#elif SPH_BIG_ENDIAN -#if SPH_SPARCV9_GCC_64 && !SPH_NO_ASM - sph_u64 tmp; - - __asm__ __volatile__ ("ldxa [%1]0x88,%0" : "=r" (tmp) : "r" (src)); - return tmp; -/* - * Not worth it generally. - * -#elif SPH_PPC32_GCC && !SPH_NO_ASM - return (sph_u64)sph_dec32le_aligned(src) - | ((sph_u64)sph_dec32le_aligned((const char *)src + 4) << 32); -#elif SPH_PPC64_GCC && !SPH_NO_ASM - sph_u64 tmp; - - __asm__ __volatile__ ("ldbrx %0,0,%1" : "=r" (tmp) : "r" (src)); - return tmp; - */ -#else - return sph_bswap64(*(const sph_u64 *)src); -#endif -#else - return (sph_u64)(((const unsigned char *)src)[0]) - | ((sph_u64)(((const unsigned char *)src)[1]) << 8) - | ((sph_u64)(((const unsigned char *)src)[2]) << 16) - | ((sph_u64)(((const unsigned char *)src)[3]) << 24) - | ((sph_u64)(((const unsigned char *)src)[4]) << 32) - | ((sph_u64)(((const unsigned char *)src)[5]) << 40) - | ((sph_u64)(((const unsigned char *)src)[6]) << 48) - | ((sph_u64)(((const unsigned char *)src)[7]) << 56); -#endif -} - -#endif - -#endif /* Doxygen excluded block */ - -#endif diff --git a/src/cubehash.c b/src/cubehash.c old mode 100644 new mode 100755 diff --git a/src/darksend-relay.cpp b/src/darksend-relay.cpp old mode 100644 new mode 100755 index 2c69fccf0..4c2099336 --- a/src/darksend-relay.cpp +++ b/src/darksend-relay.cpp @@ -85,7 +85,7 @@ bool CDarkSendRelay::VerifyMessage(std::string strSharedKey) void CDarkSendRelay::Relay() { - int nCount = std::min(static_cast(mnodeman.CountEnabled()), 20); + int nCount = std::min(mnodeman.CountEnabled(), 20); int nRank1 = (rand() % nCount)+1; int nRank2 = (rand() % nCount)+1; diff --git a/src/darksend-relay.h b/src/darksend-relay.h old mode 100644 new mode 100755 diff --git a/src/darksend.cpp b/src/darksend.cpp old mode 100644 new mode 100755 index 13b72739a..cf73652a5 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -563,11 +563,11 @@ void CDarksendPool::Check() txNew.vin.push_back(s); } - // use BIP69 implementation for improved anonymity - // https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki - sort(txNew.vin.begin(), txNew.vin.end(), CompareInputBIP69()); - sort(txNew.vout.begin(), txNew.vout.end(), CompareOutputBIP69()); - + // shuffle the outputs for improved anonymity + std::random_shuffle ( txNew.vin.begin(), txNew.vin.end(), randomizeList); + std::random_shuffle ( txNew.vout.begin(), txNew.vout.end(), randomizeList); + + if(fDebug) LogPrintf("Transaction 1: %s\n", txNew.ToString().c_str()); finalTransaction = txNew; @@ -688,7 +688,8 @@ void CDarksendPool::ChargeFees(){ if(fMasterNode) { //we don't need to charge collateral for every offence. int offences = 0; - if(GetRandInt(100) > 33) return; + int r = rand()%100; + if(r > 33) return; if(state == POOL_STATUS_ACCEPTING_ENTRIES){ BOOST_FOREACH(const CTransaction& txCollateral, vecSessionCollateral) { @@ -719,10 +720,11 @@ void CDarksendPool::ChargeFees(){ } } + r = rand()%100; int target = 0; //mostly offending? - if(offences >= POOL_MAX_TRANSACTIONS-1 && GetRandInt(100) > 33) return; + if(offences >= POOL_MAX_TRANSACTIONS-1 && r > 33) return; //everyone is an offender? That's not right if(offences >= POOL_MAX_TRANSACTIONS) return; @@ -730,6 +732,9 @@ void CDarksendPool::ChargeFees(){ //charge one of the offenders randomly if(offences > 1) target = 50; + //pick random client to charge + r = rand()%100; + if(state == POOL_STATUS_ACCEPTING_ENTRIES){ BOOST_FOREACH(const CTransaction& txCollateral, vecSessionCollateral) { bool found = false; @@ -740,7 +745,7 @@ void CDarksendPool::ChargeFees(){ } // This queue entry didn't send us the promised transaction - if(!found && GetRandInt(100) > target){ + if(!found && r > target){ LogPrintf("CDarksendPool::ChargeFees -- found uncooperative node (didn't send transaction). charging fees.\n"); CWalletTx wtxCollateral = CWalletTx(pwalletMain, txCollateral); @@ -761,11 +766,11 @@ void CDarksendPool::ChargeFees(){ // who didn't sign? BOOST_FOREACH(const CDarkSendEntry v, entries) { BOOST_FOREACH(const CTxDSIn s, v.sev) { - if(!s.fHasSig && GetRandInt(100) > target){ + if(!s.fHasSig && r > target){ LogPrintf("CDarksendPool::ChargeFees -- found uncooperative node (didn't sign). charging fees.\n"); CWalletTx wtxCollateral = CWalletTx(pwalletMain, v.collateral); - LOCK(cs_main); + // Broadcast if (!wtxCollateral.AcceptToMemoryPool(false)) { @@ -785,13 +790,10 @@ void CDarksendPool::ChargeFees(){ // - Darksend is completely free, to pay miners we randomly pay the collateral of users. void CDarksendPool::ChargeRandomFees(){ if(fMasterNode) { - - LOCK(cs_main); - int i = 0; BOOST_FOREACH(const CTransaction& txCollateral, vecSessionCollateral) { - int r = GetRandInt(100); + int r = rand()%100; /* Collateral Fee Charges: @@ -834,27 +836,23 @@ void CDarksendPool::CheckTimeout(){ } } - { - TRY_LOCK(cs_darksend, lockDS); - if(!lockDS) return; // it's ok to fail here, we run this quite frequently - // check Darksend queue objects for timeouts - int c = 0; - vector::iterator it; - for(it=vecDarksendQueue.begin();it::iterator it; + for(it=vecDarksendQueue.begin();it *vec = &myEntries; @@ -1477,7 +1475,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) // initial phase, find a Masternode if(!sessionFoundMasternode){ - int nUseQueue = GetRandInt(100); + int nUseQueue = rand()%100; UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); sessionTotalValue = pwalletMain->GetTotalValue(vCoins); @@ -1663,6 +1661,43 @@ bool CDarksendPool::PrepareDarksendDenominate() return false; } +bool CDarksendPool::SendRandomPaymentToSelf() +{ + int64_t nBalance = pwalletMain->GetBalance(); + int64_t nPayment = (nBalance*0.35) + (rand() % nBalance); + + if(nPayment > nBalance) nPayment = nBalance-(0.1*COIN); + + // make our change address + CReserveKey reservekey(pwalletMain); + + CScript scriptChange; + CPubKey vchPubKey; + assert(reservekey.GetReservedKey(vchPubKey)); // should never fail, as we just unlocked + scriptChange.SetDestination(vchPubKey.GetID()); + + CWalletTx wtx; + int64_t nFeeRet = 0; + std::string strFail = ""; + vector< pair > vecSend; + + // ****** Add fees ************ / + vecSend.push_back(make_pair(scriptChange, nPayment)); + + CCoinControl *coinControl=NULL; + bool success = pwalletMain->CreateTransaction(vecSend, wtx, reservekey, nFeeRet, strFail, coinControl, ONLY_DENOMINATED); + if(!success){ + LogPrintf("SendRandomPaymentToSelf: Error - %s\n", strFail.c_str()); + return false; + } + + pwalletMain->CommitTransaction(wtx, reservekey); + + LogPrintf("SendRandomPaymentToSelf Success: tx %s\n", wtx.GetHash().GetHex().c_str()); + + return true; +} + // Split up large inputs or create fee sized inputs bool CDarksendPool::MakeCollateralAmounts() { @@ -1806,7 +1841,7 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla if(sessionUsers < 0) sessionUsers = 0; if(sessionUsers == 0) { - sessionID = 1 + (GetRandInt(100) % 999999); + sessionID = 1 + (rand() % 999999); sessionDenom = nDenom; sessionUsers++; lastTimeChanged = GetTimeMillis(); @@ -2078,21 +2113,13 @@ bool CDarksendQueue::Sign() bool CDarksendQueue::Relay() { - std::vector vNodesCopy; - { - LOCK(cs_vNodes); - vNodesCopy = vNodes; - BOOST_FOREACH(CNode* pnode, vNodesCopy) - pnode->AddRef(); - } - BOOST_FOREACH(CNode* pnode, vNodesCopy) - pnode->PushMessage("dsq", (*this)); - { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodesCopy) - pnode->Release(); + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes){ + // always relay to everyone + pnode->PushMessage("dsq", (*this)); } + return true; } diff --git a/src/darksend.h b/src/darksend.h old mode 100644 new mode 100755 index f75cae126..80612b402 --- a/src/darksend.h +++ b/src/darksend.h @@ -394,7 +394,7 @@ class CDarksendPool void UpdateState(unsigned int newState) { if (fMasterNode && (newState == POOL_STATUS_ERROR || newState == POOL_STATUS_SUCCESS)){ - // LogPrintf("CDarksendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a Masternode. \n"); + LogPrintf("CDarksendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a Masternode. \n"); return; } @@ -467,7 +467,7 @@ class CDarksendPool void CompletedTransaction(bool error, std::string lastMessageNew); void ClearLastMessage(); /// Used for liquidity providers - // bool SendRandomPaymentToSelf(); + bool SendRandomPaymentToSelf(); /// Split up large inputs or make fee sized inputs bool MakeCollateralAmounts(); @@ -496,34 +496,6 @@ class CDarksendPool void RelayCompletedTransaction(const int sessionID, const bool error, const std::string errorMessage); }; -/** Implementation of BIP69 -* https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki -*/ -struct CompareInputBIP69 -{ - inline bool operator()(const CTxIn& a, const CTxIn& b) const - { - if (a.prevout.hash == b.prevout.hash) return a.prevout.n < b.prevout.n; - - uint256 hasha = a.prevout.hash; - uint256 hashb = b.prevout.hash; - - typedef std::reverse_iterator rev_it; - rev_it rita = rev_it(hasha.end()); - rev_it ritb = rev_it(hashb.end()); - - return std::lexicographical_compare(rita, rita + hasha.size(), ritb, ritb + hashb.size()); - } -}; - -struct CompareOutputBIP69 -{ - inline bool operator()(const CTxOut& a, const CTxOut& b) const - { - return a.nValue < b.nValue || (a.nValue == b.nValue && a.scriptPubKey < b.scriptPubKey); - } -}; - void ThreadCheckDarkSendPool(); #endif diff --git a/src/db.cpp b/src/db.cpp old mode 100644 new mode 100755 diff --git a/src/db.h b/src/db.h old mode 100644 new mode 100755 diff --git a/src/depends/.gitignore b/src/depends/.gitignore old mode 100644 new mode 100755 diff --git a/src/depends/README b/src/depends/README old mode 100644 new mode 100755 diff --git a/src/depends/README.packages b/src/depends/README.packages old mode 100644 new mode 100755 diff --git a/src/depends/README.usage b/src/depends/README.usage old mode 100644 new mode 100755 diff --git a/src/depends/builders/darwin.mk b/src/depends/builders/darwin.mk old mode 100644 new mode 100755 diff --git a/src/depends/builders/default.mk b/src/depends/builders/default.mk old mode 100644 new mode 100755 diff --git a/src/depends/builders/linux.mk b/src/depends/builders/linux.mk old mode 100644 new mode 100755 diff --git a/src/depends/config.site.in b/src/depends/config.site.in old mode 100644 new mode 100755 diff --git a/src/depends/funcs.mk b/src/depends/funcs.mk old mode 100644 new mode 100755 diff --git a/src/depends/hosts/darwin.mk b/src/depends/hosts/darwin.mk old mode 100644 new mode 100755 diff --git a/src/depends/hosts/default.mk b/src/depends/hosts/default.mk old mode 100644 new mode 100755 diff --git a/src/depends/hosts/linux.mk b/src/depends/hosts/linux.mk old mode 100644 new mode 100755 diff --git a/src/depends/hosts/mingw32.mk b/src/depends/hosts/mingw32.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/bdb.mk b/src/depends/packages/bdb.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/boost.mk b/src/depends/packages/boost.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/dbus.mk b/src/depends/packages/dbus.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/expat.mk b/src/depends/packages/expat.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/fontconfig.mk b/src/depends/packages/fontconfig.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/freetype.mk b/src/depends/packages/freetype.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/libICE.mk b/src/depends/packages/libICE.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/libSM.mk b/src/depends/packages/libSM.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/libX11.mk b/src/depends/packages/libX11.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/libXau.mk b/src/depends/packages/libXau.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/libXext.mk b/src/depends/packages/libXext.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/libxcb.mk b/src/depends/packages/libxcb.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/miniupnpc.mk b/src/depends/packages/miniupnpc.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_ccache.mk b/src/depends/packages/native_ccache.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_cctools.mk b/src/depends/packages/native_cctools.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_cdrkit.mk b/src/depends/packages/native_cdrkit.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_comparisontool.mk b/src/depends/packages/native_comparisontool.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_libdmg-hfsplus.mk b/src/depends/packages/native_libdmg-hfsplus.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_libuuid.mk b/src/depends/packages/native_libuuid.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_openssl.mk b/src/depends/packages/native_openssl.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/native_protobuf.mk b/src/depends/packages/native_protobuf.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/openssl.mk b/src/depends/packages/openssl.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/packages.mk b/src/depends/packages/packages.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/protobuf.mk b/src/depends/packages/protobuf.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/qrencode.mk b/src/depends/packages/qrencode.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/qt.mk b/src/depends/packages/qt.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/qt46.mk b/src/depends/packages/qt46.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/xcb_proto.mk b/src/depends/packages/xcb_proto.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/xextproto.mk b/src/depends/packages/xextproto.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/xproto.mk b/src/depends/packages/xproto.mk old mode 100644 new mode 100755 diff --git a/src/depends/packages/xtrans.mk b/src/depends/packages/xtrans.mk old mode 100644 new mode 100755 diff --git a/src/depends/patches/qt/mac-qmake.conf b/src/depends/patches/qt/mac-qmake.conf old mode 100644 new mode 100755 diff --git a/src/doc/Doxyfile b/src/doc/Doxyfile old mode 100644 new mode 100755 diff --git a/src/doc/README.md b/src/doc/README.md old mode 100644 new mode 100755 diff --git a/src/doc/README_osx.txt b/src/doc/README_osx.txt old mode 100644 new mode 100755 diff --git a/src/doc/README_windows.txt b/src/doc/README_windows.txt old mode 100644 new mode 100755 diff --git a/src/doc/assets-attribution.md b/src/doc/assets-attribution.md old mode 100644 new mode 100755 diff --git a/src/doc/bitcoin_logo_doxygen.png b/src/doc/bitcoin_logo_doxygen.png old mode 100644 new mode 100755 diff --git a/src/doc/bootstrap.md b/src/doc/bootstrap.md old mode 100644 new mode 100755 diff --git a/src/doc/build-msw.md b/src/doc/build-msw.md old mode 100644 new mode 100755 diff --git a/src/doc/build-osx.md b/src/doc/build-osx.md old mode 100644 new mode 100755 diff --git a/src/doc/build-unix.md b/src/doc/build-unix.md old mode 100644 new mode 100755 diff --git a/src/doc/coding.md b/src/doc/coding.md old mode 100644 new mode 100755 diff --git a/src/doc/files.md b/src/doc/files.md old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building.md b/src/doc/gitian-building.md old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/create_vm_file_location_size.png b/src/doc/gitian-building/create_vm_file_location_size.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/create_vm_hard_drive.png b/src/doc/gitian-building/create_vm_hard_drive.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/create_vm_hard_drive_file_type.png b/src/doc/gitian-building/create_vm_hard_drive_file_type.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/create_vm_memsize.png b/src/doc/gitian-building/create_vm_memsize.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/create_vm_page1.png b/src/doc/gitian-building/create_vm_page1.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/create_vm_storage_physical_hard_drive.png b/src/doc/gitian-building/create_vm_storage_physical_hard_drive.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_10_configure_clock.png b/src/doc/gitian-building/debian_install_10_configure_clock.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_11_partition_disks.png b/src/doc/gitian-building/debian_install_11_partition_disks.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_12_choose_disk.png b/src/doc/gitian-building/debian_install_12_choose_disk.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_13_partition_scheme.png b/src/doc/gitian-building/debian_install_13_partition_scheme.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_14_finish.png b/src/doc/gitian-building/debian_install_14_finish.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_15_write_changes.png b/src/doc/gitian-building/debian_install_15_write_changes.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_16_choose_a_mirror.png b/src/doc/gitian-building/debian_install_16_choose_a_mirror.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_17_choose_a_mirror2.png b/src/doc/gitian-building/debian_install_17_choose_a_mirror2.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_18_proxy_settings.png b/src/doc/gitian-building/debian_install_18_proxy_settings.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_19_software_selection.png b/src/doc/gitian-building/debian_install_19_software_selection.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_1_boot_menu.png b/src/doc/gitian-building/debian_install_1_boot_menu.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_20_install_grub.png b/src/doc/gitian-building/debian_install_20_install_grub.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_21_finish_installation.png b/src/doc/gitian-building/debian_install_21_finish_installation.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_2_select_a_language.png b/src/doc/gitian-building/debian_install_2_select_a_language.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_3_select_location.png b/src/doc/gitian-building/debian_install_3_select_location.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_4_configure_keyboard.png b/src/doc/gitian-building/debian_install_4_configure_keyboard.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_5_configure_the_network.png b/src/doc/gitian-building/debian_install_5_configure_the_network.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_6_domain_name.png b/src/doc/gitian-building/debian_install_6_domain_name.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_6a_set_up_root_password.png b/src/doc/gitian-building/debian_install_6a_set_up_root_password.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_7_set_up_user_fullname.png b/src/doc/gitian-building/debian_install_7_set_up_user_fullname.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_8_set_up_username.png b/src/doc/gitian-building/debian_install_8_set_up_username.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/debian_install_9_user_password.png b/src/doc/gitian-building/debian_install_9_user_password.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/network_settings.png b/src/doc/gitian-building/network_settings.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/port_forwarding_rules.png b/src/doc/gitian-building/port_forwarding_rules.png old mode 100644 new mode 100755 diff --git a/src/doc/gitian-building/select_startup_disk.png b/src/doc/gitian-building/select_startup_disk.png old mode 100644 new mode 100755 diff --git a/src/doc/guide-startmany.md b/src/doc/guide-startmany.md old mode 100644 new mode 100755 diff --git a/src/doc/img/bootstrap1.png b/src/doc/img/bootstrap1.png old mode 100644 new mode 100755 diff --git a/src/doc/img/bootstrap2.png b/src/doc/img/bootstrap2.png old mode 100644 new mode 100755 diff --git a/src/doc/img/bootstrap3.png b/src/doc/img/bootstrap3.png old mode 100644 new mode 100755 diff --git a/src/doc/img/bootstrap4.png b/src/doc/img/bootstrap4.png old mode 100644 new mode 100755 diff --git a/src/doc/img/bootstrap5.png b/src/doc/img/bootstrap5.png old mode 100644 new mode 100755 diff --git a/src/doc/keepass.md b/src/doc/keepass.md old mode 100644 new mode 100755 diff --git a/src/doc/masternode_conf.md b/src/doc/masternode_conf.md old mode 100644 new mode 100755 diff --git a/src/doc/multiwallet-qt.md b/src/doc/multiwallet-qt.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes.md b/src/doc/release-notes.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.12.md b/src/doc/release-notes/bitcoin/release-notes-0.3.12.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.13.md b/src/doc/release-notes/bitcoin/release-notes-0.3.13.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.14.md b/src/doc/release-notes/bitcoin/release-notes-0.3.14.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.15.md b/src/doc/release-notes/bitcoin/release-notes-0.3.15.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.16.md b/src/doc/release-notes/bitcoin/release-notes-0.3.16.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.17.md b/src/doc/release-notes/bitcoin/release-notes-0.3.17.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.18.md b/src/doc/release-notes/bitcoin/release-notes-0.3.18.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.19.md b/src/doc/release-notes/bitcoin/release-notes-0.3.19.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.20.1.md b/src/doc/release-notes/bitcoin/release-notes-0.3.20.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.20.2.md b/src/doc/release-notes/bitcoin/release-notes-0.3.20.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.20.md b/src/doc/release-notes/bitcoin/release-notes-0.3.20.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.21.md b/src/doc/release-notes/bitcoin/release-notes-0.3.21.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.22.md b/src/doc/release-notes/bitcoin/release-notes-0.3.22.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.23.md b/src/doc/release-notes/bitcoin/release-notes-0.3.23.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.3.24.md b/src/doc/release-notes/bitcoin/release-notes-0.3.24.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.0.md b/src/doc/release-notes/bitcoin/release-notes-0.4.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.1.md b/src/doc/release-notes/bitcoin/release-notes-0.4.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.2.md b/src/doc/release-notes/bitcoin/release-notes-0.4.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.3.md b/src/doc/release-notes/bitcoin/release-notes-0.4.3.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.4.md b/src/doc/release-notes/bitcoin/release-notes-0.4.4.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.5.md b/src/doc/release-notes/bitcoin/release-notes-0.4.5.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.4.6.md b/src/doc/release-notes/bitcoin/release-notes-0.4.6.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.5.0.md b/src/doc/release-notes/bitcoin/release-notes-0.5.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.5.1.md b/src/doc/release-notes/bitcoin/release-notes-0.5.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.5.2.md b/src/doc/release-notes/bitcoin/release-notes-0.5.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.5.3.md b/src/doc/release-notes/bitcoin/release-notes-0.5.3.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.5.4.md b/src/doc/release-notes/bitcoin/release-notes-0.5.4.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.5.5.md b/src/doc/release-notes/bitcoin/release-notes-0.5.5.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.6.0.md b/src/doc/release-notes/bitcoin/release-notes-0.6.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.6.1.md b/src/doc/release-notes/bitcoin/release-notes-0.6.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.6.2.md b/src/doc/release-notes/bitcoin/release-notes-0.6.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.6.3.md b/src/doc/release-notes/bitcoin/release-notes-0.6.3.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.7.0.md b/src/doc/release-notes/bitcoin/release-notes-0.7.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.7.1.md b/src/doc/release-notes/bitcoin/release-notes-0.7.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.7.2.md b/src/doc/release-notes/bitcoin/release-notes-0.7.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.0.md b/src/doc/release-notes/bitcoin/release-notes-0.8.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.1.md b/src/doc/release-notes/bitcoin/release-notes-0.8.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.2.md b/src/doc/release-notes/bitcoin/release-notes-0.8.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.3.md b/src/doc/release-notes/bitcoin/release-notes-0.8.3.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.4.md b/src/doc/release-notes/bitcoin/release-notes-0.8.4.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.5.md b/src/doc/release-notes/bitcoin/release-notes-0.8.5.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/bitcoin/release-notes-0.8.6.md b/src/doc/release-notes/bitcoin/release-notes-0.8.6.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/dash/release-notes-0.10.0.md b/src/doc/release-notes/dash/release-notes-0.10.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/dash/release-notes-0.11.0.md b/src/doc/release-notes/dash/release-notes-0.11.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/dash/release-notes-0.11.1.md b/src/doc/release-notes/dash/release-notes-0.11.1.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/dash/release-notes-0.11.2.md b/src/doc/release-notes/dash/release-notes-0.11.2.md old mode 100644 new mode 100755 diff --git a/src/doc/release-notes/dash/release-notes-0.9.0.md b/src/doc/release-notes/dash/release-notes-0.9.0.md old mode 100644 new mode 100755 diff --git a/src/doc/release-process.md b/src/doc/release-process.md old mode 100644 new mode 100755 diff --git a/src/doc/tor.md b/src/doc/tor.md old mode 100644 new mode 100755 diff --git a/src/doc/translation_process.md b/src/doc/translation_process.md old mode 100644 new mode 100755 diff --git a/src/doc/unit-tests.md b/src/doc/unit-tests.md old mode 100644 new mode 100755 diff --git a/src/echo.c b/src/echo.c old mode 100644 new mode 100755 diff --git a/src/groestl.c b/src/groestl.c old mode 100644 new mode 100755 diff --git a/src/hash.cpp b/src/hash.cpp old mode 100644 new mode 100755 diff --git a/src/hash.h b/src/hash.h old mode 100644 new mode 100755 diff --git a/src/hmac_sha256.cpp b/src/hmac_sha256.cpp deleted file mode 100644 index b3f36bdda..000000000 --- a/src/hmac_sha256.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "hmac_sha256.h" - -#include - -CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen) -{ - unsigned char rkey[64]; - if (keylen <= 64) { - memcpy(rkey, key, keylen); - memset(rkey + keylen, 0, 64 - keylen); - } else { - CSHA256().Write(key, keylen).Finalize(rkey); - memset(rkey + 32, 0, 32); - } - - for (int n = 0; n < 64; n++) - rkey[n] ^= 0x5c; - outer.Write(rkey, 64); - - for (int n = 0; n < 64; n++) - rkey[n] ^= 0x5c ^ 0x36; - inner.Write(rkey, 64); -} - -void CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) -{ - unsigned char temp[32]; - inner.Finalize(temp); - outer.Write(temp, 32).Finalize(hash); -} diff --git a/src/hmac_sha256.h b/src/hmac_sha256.h deleted file mode 100644 index 0a3f5c43c..000000000 --- a/src/hmac_sha256.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_HMAC_SHA256_H -#define BITCOIN_CRYPTO_HMAC_SHA256_H - -#include "sha256.h" - -#include -#include - -/** A hasher class for HMAC-SHA-512. */ -class CHMAC_SHA256 -{ -private: - CSHA256 outer; - CSHA256 inner; - -public: - static const size_t OUTPUT_SIZE = 32; - - CHMAC_SHA256(const unsigned char* key, size_t keylen); - CHMAC_SHA256& Write(const unsigned char* data, size_t len) - { - inner.Write(data, len); - return *this; - } - void Finalize(unsigned char hash[OUTPUT_SIZE]); -}; - -#endif // BITCOIN_CRYPTO_HMAC_SHA256_H diff --git a/src/init.cpp b/src/init.cpp index 729685bb0..26f4e1e5d 100755 --- a/src/init.cpp +++ b/src/init.cpp @@ -10,8 +10,6 @@ #include "init.h" -#include "torcontrol.h" - #include "addrman.h" #include "checkpoints.h" #include "key.h" @@ -144,7 +142,6 @@ void Shutdown() RenameThread("interzone-shutoff"); mempool.AddTransactionsUpdated(1); - InterruptTorControl(); StopRPCThreads(); ShutdownRPCMining(); #ifdef ENABLE_WALLET @@ -154,7 +151,6 @@ void Shutdown() #endif StopNode(); DumpMasternodes(); - StopTorControl(); UnregisterNodeSignals(GetNodeSignals()); { LOCK(cs_main); @@ -269,7 +265,6 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; strUsage += " -socks= " + _("Select SOCKS version for -proxy (4 or 5, default: 5)") + "\n"; strUsage += " -timeout= " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n"; - strUsage += " -torcontrol=:" + _("Tor control port to use if onion listening enabled (default: 1)") + "\n"; #ifdef USE_UPNP #if USE_UPNP strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n"; @@ -1382,9 +1377,6 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); #endif - if (GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) - StartTorControl(threadGroup); - StartNode(threadGroup); // InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly. InitRPCMining(); diff --git a/src/instantx.cpp b/src/instantx.cpp old mode 100644 new mode 100755 diff --git a/src/instantx.h b/src/instantx.h old mode 100644 new mode 100755 diff --git a/src/interzone-cli-res.rc b/src/interzone-cli-res.rc old mode 100644 new mode 100755 diff --git a/src/interzone-cli.cpp b/src/interzone-cli.cpp old mode 100644 new mode 100755 index a39765a30..328ab9338 --- a/src/interzone-cli.cpp +++ b/src/interzone-cli.cpp @@ -23,8 +23,7 @@ static bool AppInitRPC(int argc, char* argv[]) // Parameters // ParseParameters(argc, argv); - bool datadirFromCmdLine = mapArgs.count("-datadir") != 0; - if (datadirFromCmdLine && !boost::filesystem::is_directory(GetDataDir(false))) + if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; @@ -35,10 +34,6 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - if (!datadirFromCmdLine && !boost::filesystem::is_directory(GetDataDir(false))) { - fprintf(stderr, "Error: Specified data directory \"%s\" from config file does not exist.\n", mapArgs["-datadir"].c_str()); - return EXIT_FAILURE; - } // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); diff --git a/src/interzone-config.h b/src/interzone-config.h deleted file mode 100644 index 19612ee81..000000000 --- a/src/interzone-config.h +++ /dev/null @@ -1,352 +0,0 @@ -/* src/interzone-config.h. Generated from interzone-config.h.in by configure. */ -/* src/interzone-config.h.in. Generated from configure.ac by autoheader. */ - -#ifndef CHAINCOIN_CONFIG_H - -#define CHAINCOIN_CONFIG_H - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* Version Build */ -#define CLIENT_VERSION_BUILD 0 - -/* Version is release */ -#define CLIENT_VERSION_IS_RELEASE true - -/* Major version */ -#define CLIENT_VERSION_MAJOR 0 - -/* Minor version */ -#define CLIENT_VERSION_MINOR 9 - -/* Build revision */ -#define CLIENT_VERSION_REVISION 3 - -/* Version is release */ -#define COPYRIGHT_YEAR 2017 - -/* Define to 1 to enable wallet functions */ -#define ENABLE_WALLET 1 - -/* parameter and return value type for __fdelt_chk */ -/* #undef FDELT_TYPE */ - -/* define if the Boost library is available */ -#define HAVE_BOOST /**/ - -/* define if the Boost::Chrono library is available */ -#define HAVE_BOOST_CHRONO /**/ - -/* define if the Boost::Filesystem library is available */ -#define HAVE_BOOST_FILESYSTEM /**/ - -/* define if the Boost::PROGRAM_OPTIONS library is available */ -#define HAVE_BOOST_PROGRAM_OPTIONS /**/ - -/* define if the Boost::System library is available */ -#define HAVE_BOOST_SYSTEM /**/ - -/* define if the Boost::Thread library is available */ -#define HAVE_BOOST_THREAD /**/ - -/* define if the Boost::Unit_Test_Framework library is available */ -/* #undef HAVE_BOOST_UNIT_TEST_FRAMEWORK */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_BYTESWAP_H */ - -/* Define to 1 if you have the declaration of `be16toh', and to 0 if you - don't. */ -#define HAVE_DECL_BE16TOH 0 - -/* Define to 1 if you have the declaration of `be32toh', and to 0 if you - don't. */ -#define HAVE_DECL_BE32TOH 0 - -/* Define to 1 if you have the declaration of `be64toh', and to 0 if you - don't. */ -#define HAVE_DECL_BE64TOH 0 - -/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you - don't. */ -#define HAVE_DECL_BSWAP_16 0 - -/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you - don't. */ -#define HAVE_DECL_BSWAP_32 0 - -/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you - don't. */ -#define HAVE_DECL_BSWAP_64 0 - -/* Define to 1 if you have the declaration of `htobe16', and to 0 if you - don't. */ -#define HAVE_DECL_HTOBE16 0 - -/* Define to 1 if you have the declaration of `htobe32', and to 0 if you - don't. */ -#define HAVE_DECL_HTOBE32 0 - -/* Define to 1 if you have the declaration of `htobe64', and to 0 if you - don't. */ -#define HAVE_DECL_HTOBE64 0 - -/* Define to 1 if you have the declaration of `htole16', and to 0 if you - don't. */ -#define HAVE_DECL_HTOLE16 0 - -/* Define to 1 if you have the declaration of `htole32', and to 0 if you - don't. */ -#define HAVE_DECL_HTOLE32 0 - -/* Define to 1 if you have the declaration of `htole64', and to 0 if you - don't. */ -#define HAVE_DECL_HTOLE64 0 - -/* Define to 1 if you have the declaration of `le16toh', and to 0 if you - don't. */ -#define HAVE_DECL_LE16TOH 0 - -/* Define to 1 if you have the declaration of `le32toh', and to 0 if you - don't. */ -#define HAVE_DECL_LE32TOH 0 - -/* Define to 1 if you have the declaration of `le64toh', and to 0 if you - don't. */ -#define HAVE_DECL_LE64TOH 0 - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#define HAVE_DECL_STRERROR_R 1 - -/* Define to 1 if you have the declaration of `__builtin_clz', and to 0 if you - don't. */ -#define HAVE_DECL___BUILTIN_CLZ 0 - -/* Define to 1 if you have the declaration of `__builtin_clzl', and to 0 if - you don't. */ -#define HAVE_DECL___BUILTIN_CLZL 0 - -/* Define to 1 if you have the declaration of `__builtin_clzll', and to 0 if - you don't. */ -#define HAVE_DECL___BUILTIN_CLZLL 0 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ENDIAN_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `advapi32' library (-ladvapi32). */ -/* #undef HAVE_LIBADVAPI32 */ - -/* Define to 1 if you have the `comctl32' library (-lcomctl32). */ -/* #undef HAVE_LIBCOMCTL32 */ - -/* Define to 1 if you have the `comdlg32' library (-lcomdlg32). */ -/* #undef HAVE_LIBCOMDLG32 */ - -/* Define to 1 if you have the `crypt32' library (-lcrypt32). */ -/* #undef HAVE_LIBCRYPT32 */ - -/* Define to 1 if you have the `crypto' library (-lcrypto). */ -/* #undef HAVE_LIBCRYPTO */ - -/* Define to 1 if you have the `gdi32' library (-lgdi32). */ -/* #undef HAVE_LIBGDI32 */ - -/* Define to 1 if you have the `imm32' library (-limm32). */ -/* #undef HAVE_LIBIMM32 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `kernel32' library (-lkernel32). */ -/* #undef HAVE_LIBKERNEL32 */ - -/* Define to 1 if you have the `mingwthrd' library (-lmingwthrd). */ -/* #undef HAVE_LIBMINGWTHRD */ - -/* Define to 1 if you have the `miniupnpc' library (-lminiupnpc). */ -/* #undef HAVE_LIBMINIUPNPC */ - -/* Define to 1 if you have the `mswsock' library (-lmswsock). */ -/* #undef HAVE_LIBMSWSOCK */ - -/* Define to 1 if you have the `ole32' library (-lole32). */ -/* #undef HAVE_LIBOLE32 */ - -/* Define to 1 if you have the `oleaut32' library (-loleaut32). */ -/* #undef HAVE_LIBOLEAUT32 */ - -/* Define to 1 if you have the `png ' library (-lpng ). */ -/* #undef HAVE_LIBPNG_ */ - -/* Define to 1 if you have the `protobuf ' library (-lprotobuf ). */ -/* #undef HAVE_LIBPROTOBUF_ */ - -/* Define to 1 if you have the `qrencode' library (-lqrencode). */ -/* #undef HAVE_LIBQRENCODE */ - -/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */ -/* #undef HAVE_LIBRPCRT4 */ - -/* Define to 1 if you have the `shell32' library (-lshell32). */ -/* #undef HAVE_LIBSHELL32 */ - -/* Define to 1 if you have the `shlwapi' library (-lshlwapi). */ -/* #undef HAVE_LIBSHLWAPI */ - -/* Define to 1 if you have the `ssl' library (-lssl). */ -/* #undef HAVE_LIBSSL */ - -/* Define to 1 if you have the `user32' library (-luser32). */ -/* #undef HAVE_LIBUSER32 */ - -/* Define to 1 if you have the `uuid' library (-luuid). */ -/* #undef HAVE_LIBUUID */ - -/* Define to 1 if you have the `winmm' library (-lwinmm). */ -/* #undef HAVE_LIBWINMM */ - -/* Define to 1 if you have the `winspool' library (-lwinspool). */ -/* #undef HAVE_LIBWINSPOOL */ - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the `z ' library (-lz ). */ -/* #undef HAVE_LIBZ_ */ - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MINIUPNPC_MINIUPNPC_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MINIUPNPC_MINIWGET_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MINIUPNPC_UPNPCOMMANDS_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MINIUPNPC_UPNPERRORS_H */ - -/* Define this symbol if you have MSG_NOSIGNAL */ -/* #undef HAVE_MSG_NOSIGNAL */ - -/* Define if you have POSIX threads libraries and header files. */ -#define HAVE_PTHREAD 1 - -/* Have PTHREAD_PRIO_INHERIT. */ -#define HAVE_PTHREAD_PRIO_INHERIT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strerror_r' function. */ -#define HAVE_STRERROR_R 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_ENDIAN_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_PRCTL_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define this symbol if boost sleep works */ -/* #undef HAVE_WORKING_BOOST_SLEEP */ - -/* Define this symbol if boost sleep_for works */ -#define HAVE_WORKING_BOOST_SLEEP_FOR 1 - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "info@interzone.space" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "Interzone Core" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Interzone Core 0.9.3" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "interzone" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "0.9.3" - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -/* #undef PTHREAD_CREATE_JOINABLE */ - -/* Define this symbol if qt plugins are static */ -/* #undef QT_STATICPLUGIN */ - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if strerror_r returns char *. */ -/* #undef STRERROR_R_CHAR_P */ - -/* Define if dbus support should be compiled in */ -/* #undef USE_DBUS */ - -/* Define if QR support should be compiled in */ -/* #undef USE_QRCODE */ - -/* UPnP support not compiled if undefined, otherwise value (0 or 1) determines - default state */ -/* #undef USE_UPNP */ - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -#endif //CHAINCOIN_CONFIG_H diff --git a/src/interzone-config.h.in b/src/interzone-config.h.in deleted file mode 100644 index 80b2e4a3d..000000000 --- a/src/interzone-config.h.in +++ /dev/null @@ -1,351 +0,0 @@ -/* src/interzone-config.h.in. Generated from configure.ac by autoheader. */ - -#ifndef CHAINCOIN_CONFIG_H - -#define CHAINCOIN_CONFIG_H - -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - -/* Version Build */ -#undef CLIENT_VERSION_BUILD - -/* Version is release */ -#undef CLIENT_VERSION_IS_RELEASE - -/* Major version */ -#undef CLIENT_VERSION_MAJOR - -/* Minor version */ -#undef CLIENT_VERSION_MINOR - -/* Build revision */ -#undef CLIENT_VERSION_REVISION - -/* Version is release */ -#undef COPYRIGHT_YEAR - -/* Define to 1 to enable wallet functions */ -#undef ENABLE_WALLET - -/* parameter and return value type for __fdelt_chk */ -#undef FDELT_TYPE - -/* define if the Boost library is available */ -#undef HAVE_BOOST - -/* define if the Boost::Chrono library is available */ -#undef HAVE_BOOST_CHRONO - -/* define if the Boost::Filesystem library is available */ -#undef HAVE_BOOST_FILESYSTEM - -/* define if the Boost::PROGRAM_OPTIONS library is available */ -#undef HAVE_BOOST_PROGRAM_OPTIONS - -/* define if the Boost::System library is available */ -#undef HAVE_BOOST_SYSTEM - -/* define if the Boost::Thread library is available */ -#undef HAVE_BOOST_THREAD - -/* define if the Boost::Unit_Test_Framework library is available */ -#undef HAVE_BOOST_UNIT_TEST_FRAMEWORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_BYTESWAP_H - -/* Define to 1 if you have the declaration of `be16toh', and to 0 if you - don't. */ -#undef HAVE_DECL_BE16TOH - -/* Define to 1 if you have the declaration of `be32toh', and to 0 if you - don't. */ -#undef HAVE_DECL_BE32TOH - -/* Define to 1 if you have the declaration of `be64toh', and to 0 if you - don't. */ -#undef HAVE_DECL_BE64TOH - -/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you - don't. */ -#undef HAVE_DECL_BSWAP_16 - -/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you - don't. */ -#undef HAVE_DECL_BSWAP_32 - -/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you - don't. */ -#undef HAVE_DECL_BSWAP_64 - -/* Define to 1 if you have the declaration of `htobe16', and to 0 if you - don't. */ -#undef HAVE_DECL_HTOBE16 - -/* Define to 1 if you have the declaration of `htobe32', and to 0 if you - don't. */ -#undef HAVE_DECL_HTOBE32 - -/* Define to 1 if you have the declaration of `htobe64', and to 0 if you - don't. */ -#undef HAVE_DECL_HTOBE64 - -/* Define to 1 if you have the declaration of `htole16', and to 0 if you - don't. */ -#undef HAVE_DECL_HTOLE16 - -/* Define to 1 if you have the declaration of `htole32', and to 0 if you - don't. */ -#undef HAVE_DECL_HTOLE32 - -/* Define to 1 if you have the declaration of `htole64', and to 0 if you - don't. */ -#undef HAVE_DECL_HTOLE64 - -/* Define to 1 if you have the declaration of `le16toh', and to 0 if you - don't. */ -#undef HAVE_DECL_LE16TOH - -/* Define to 1 if you have the declaration of `le32toh', and to 0 if you - don't. */ -#undef HAVE_DECL_LE32TOH - -/* Define to 1 if you have the declaration of `le64toh', and to 0 if you - don't. */ -#undef HAVE_DECL_LE64TOH - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR_R - -/* Define to 1 if you have the declaration of `__builtin_clz', and to 0 if you - don't. */ -#undef HAVE_DECL___BUILTIN_CLZ - -/* Define to 1 if you have the declaration of `__builtin_clzl', and to 0 if - you don't. */ -#undef HAVE_DECL___BUILTIN_CLZL - -/* Define to 1 if you have the declaration of `__builtin_clzll', and to 0 if - you don't. */ -#undef HAVE_DECL___BUILTIN_CLZLL - -/* Define to 1 if you have the header file. */ -#undef HAVE_ENDIAN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `advapi32' library (-ladvapi32). */ -#undef HAVE_LIBADVAPI32 - -/* Define to 1 if you have the `comctl32' library (-lcomctl32). */ -#undef HAVE_LIBCOMCTL32 - -/* Define to 1 if you have the `comdlg32' library (-lcomdlg32). */ -#undef HAVE_LIBCOMDLG32 - -/* Define to 1 if you have the `crypt32' library (-lcrypt32). */ -#undef HAVE_LIBCRYPT32 - -/* Define to 1 if you have the `crypto' library (-lcrypto). */ -#undef HAVE_LIBCRYPTO - -/* Define to 1 if you have the `gdi32' library (-lgdi32). */ -#undef HAVE_LIBGDI32 - -/* Define to 1 if you have the `imm32' library (-limm32). */ -#undef HAVE_LIBIMM32 - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -#undef HAVE_LIBIPHLPAPI - -/* Define to 1 if you have the `kernel32' library (-lkernel32). */ -#undef HAVE_LIBKERNEL32 - -/* Define to 1 if you have the `mingwthrd' library (-lmingwthrd). */ -#undef HAVE_LIBMINGWTHRD - -/* Define to 1 if you have the `miniupnpc' library (-lminiupnpc). */ -#undef HAVE_LIBMINIUPNPC - -/* Define to 1 if you have the `mswsock' library (-lmswsock). */ -#undef HAVE_LIBMSWSOCK - -/* Define to 1 if you have the `ole32' library (-lole32). */ -#undef HAVE_LIBOLE32 - -/* Define to 1 if you have the `oleaut32' library (-loleaut32). */ -#undef HAVE_LIBOLEAUT32 - -/* Define to 1 if you have the `png ' library (-lpng ). */ -#undef HAVE_LIBPNG_ - -/* Define to 1 if you have the `protobuf ' library (-lprotobuf ). */ -#undef HAVE_LIBPROTOBUF_ - -/* Define to 1 if you have the `qrencode' library (-lqrencode). */ -#undef HAVE_LIBQRENCODE - -/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */ -#undef HAVE_LIBRPCRT4 - -/* Define to 1 if you have the `shell32' library (-lshell32). */ -#undef HAVE_LIBSHELL32 - -/* Define to 1 if you have the `shlwapi' library (-lshlwapi). */ -#undef HAVE_LIBSHLWAPI - -/* Define to 1 if you have the `ssl' library (-lssl). */ -#undef HAVE_LIBSSL - -/* Define to 1 if you have the `user32' library (-luser32). */ -#undef HAVE_LIBUSER32 - -/* Define to 1 if you have the `uuid' library (-luuid). */ -#undef HAVE_LIBUUID - -/* Define to 1 if you have the `winmm' library (-lwinmm). */ -#undef HAVE_LIBWINMM - -/* Define to 1 if you have the `winspool' library (-lwinspool). */ -#undef HAVE_LIBWINSPOOL - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -#undef HAVE_LIBWS2_32 - -/* Define to 1 if you have the `z ' library (-lz ). */ -#undef HAVE_LIBZ_ - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MINIUPNPC_MINIUPNPC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MINIUPNPC_MINIWGET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MINIUPNPC_UPNPCOMMANDS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MINIUPNPC_UPNPERRORS_H - -/* Define this symbol if you have MSG_NOSIGNAL */ -#undef HAVE_MSG_NOSIGNAL - -/* Define if you have POSIX threads libraries and header files. */ -#undef HAVE_PTHREAD - -/* Have PTHREAD_PRIO_INHERIT. */ -#undef HAVE_PTHREAD_PRIO_INHERIT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ENDIAN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PRCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define this symbol if boost sleep works */ -#undef HAVE_WORKING_BOOST_SLEEP - -/* Define this symbol if boost sleep_for works */ -#undef HAVE_WORKING_BOOST_SLEEP_FOR - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* Define this symbol if qt plugins are static */ -#undef QT_STATICPLUGIN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if strerror_r returns char *. */ -#undef STRERROR_R_CHAR_P - -/* Define if dbus support should be compiled in */ -#undef USE_DBUS - -/* Define if QR support should be compiled in */ -#undef USE_QRCODE - -/* UPnP support not compiled if undefined, otherwise value (0 or 1) determines - default state */ -#undef USE_UPNP - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -#endif //CHAINCOIN_CONFIG_H diff --git a/src/interzoned-res.rc b/src/interzoned-res.rc old mode 100644 new mode 100755 diff --git a/src/interzoned.cpp b/src/interzoned.cpp old mode 100644 new mode 100755 index 634a043d4..192420374 --- a/src/interzoned.cpp +++ b/src/interzoned.cpp @@ -67,8 +67,7 @@ bool AppInit(int argc, char* argv[]) // // If Qt is used, parameters/interzone.conf are parsed in qt/interzone.cpp's main() ParseParameters(argc, argv); - bool datadirFromCmdLine = mapArgs.count("-datadir") != 0; - if (datadirFromCmdLine && !boost::filesystem::is_directory(GetDataDir(false))) + if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; @@ -80,11 +79,6 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - if (!datadirFromCmdLine && !boost::filesystem::is_directory(GetDataDir(false))) - { - fprintf(stderr, "Error: Specified data directory \"%s\" from config file does not exist.\n", mapArgs["-datadir"].c_str()); - return EXIT_FAILURE; - } // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { diff --git a/src/jh.c b/src/jh.c old mode 100644 new mode 100755 diff --git a/src/json/LICENSE.txt b/src/json/LICENSE.txt old mode 100644 new mode 100755 diff --git a/src/json/json_spirit.h b/src/json/json_spirit.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_error_position.h b/src/json/json_spirit_error_position.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_reader.cpp b/src/json/json_spirit_reader.cpp old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_reader.h b/src/json/json_spirit_reader.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_reader_template.h b/src/json/json_spirit_reader_template.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_stream_reader.h b/src/json/json_spirit_stream_reader.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_utils.h b/src/json/json_spirit_utils.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_value.cpp b/src/json/json_spirit_value.cpp old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_value.h b/src/json/json_spirit_value.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_writer.cpp b/src/json/json_spirit_writer.cpp old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_writer.h b/src/json/json_spirit_writer.h old mode 100644 new mode 100755 diff --git a/src/json/json_spirit_writer_template.h b/src/json/json_spirit_writer_template.h old mode 100644 new mode 100755 diff --git a/src/keccak.c b/src/keccak.c old mode 100644 new mode 100755 diff --git a/src/keepass.cpp b/src/keepass.cpp old mode 100644 new mode 100755 diff --git a/src/keepass.h b/src/keepass.h old mode 100644 new mode 100755 diff --git a/src/key.cpp b/src/key.cpp old mode 100644 new mode 100755 diff --git a/src/key.h b/src/key.h old mode 100644 new mode 100755 index 3499857c2..67206ba91 --- a/src/key.h +++ b/src/key.h @@ -82,8 +82,8 @@ class CPubKey { } // Construct a public key from a byte vector. - CPubKey(const std::vector &vecChr) { - Set(vecChr.begin(), vecChr.end()); + CPubKey(const std::vector &vch) { + Set(vch.begin(), vch.end()); } // Simple read-only vector-like interface to the pubkey data. diff --git a/src/keystore.cpp b/src/keystore.cpp old mode 100644 new mode 100755 diff --git a/src/keystore.h b/src/keystore.h old mode 100644 new mode 100755 diff --git a/src/leveldb/.gitignore b/src/leveldb/.gitignore old mode 100644 new mode 100755 diff --git a/src/leveldb/AUTHORS b/src/leveldb/AUTHORS old mode 100644 new mode 100755 diff --git a/src/leveldb/LICENSE b/src/leveldb/LICENSE old mode 100644 new mode 100755 diff --git a/src/leveldb/Makefile b/src/leveldb/Makefile old mode 100644 new mode 100755 diff --git a/src/leveldb/NEWS b/src/leveldb/NEWS old mode 100644 new mode 100755 diff --git a/src/leveldb/README b/src/leveldb/README old mode 100644 new mode 100755 diff --git a/src/leveldb/TODO b/src/leveldb/TODO old mode 100644 new mode 100755 diff --git a/src/leveldb/WINDOWS.md b/src/leveldb/WINDOWS.md old mode 100644 new mode 100755 diff --git a/src/leveldb/db/autocompact_test.cc b/src/leveldb/db/autocompact_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/builder.cc b/src/leveldb/db/builder.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/builder.h b/src/leveldb/db/builder.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/c.cc b/src/leveldb/db/c.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/c_test.c b/src/leveldb/db/c_test.c old mode 100644 new mode 100755 diff --git a/src/leveldb/db/corruption_test.cc b/src/leveldb/db/corruption_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/db_bench.cc b/src/leveldb/db/db_bench.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/db_impl.cc b/src/leveldb/db/db_impl.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/db_impl.h b/src/leveldb/db/db_impl.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/db_iter.cc b/src/leveldb/db/db_iter.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/db_iter.h b/src/leveldb/db/db_iter.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/db_test.cc b/src/leveldb/db/db_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/dbformat.cc b/src/leveldb/db/dbformat.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/dbformat.h b/src/leveldb/db/dbformat.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/dbformat_test.cc b/src/leveldb/db/dbformat_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/filename.cc b/src/leveldb/db/filename.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/filename.h b/src/leveldb/db/filename.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/filename_test.cc b/src/leveldb/db/filename_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/leveldb_main.cc b/src/leveldb/db/leveldb_main.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/log_format.h b/src/leveldb/db/log_format.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/log_reader.cc b/src/leveldb/db/log_reader.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/log_reader.h b/src/leveldb/db/log_reader.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/log_test.cc b/src/leveldb/db/log_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/log_writer.cc b/src/leveldb/db/log_writer.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/log_writer.h b/src/leveldb/db/log_writer.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/memtable.cc b/src/leveldb/db/memtable.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/memtable.h b/src/leveldb/db/memtable.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/repair.cc b/src/leveldb/db/repair.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/skiplist.h b/src/leveldb/db/skiplist.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/skiplist_test.cc b/src/leveldb/db/skiplist_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/snapshot.h b/src/leveldb/db/snapshot.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/table_cache.cc b/src/leveldb/db/table_cache.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/table_cache.h b/src/leveldb/db/table_cache.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/version_edit.cc b/src/leveldb/db/version_edit.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/version_edit.h b/src/leveldb/db/version_edit.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/version_edit_test.cc b/src/leveldb/db/version_edit_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/version_set.cc b/src/leveldb/db/version_set.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/version_set.h b/src/leveldb/db/version_set.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/version_set_test.cc b/src/leveldb/db/version_set_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/write_batch.cc b/src/leveldb/db/write_batch.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/db/write_batch_internal.h b/src/leveldb/db/write_batch_internal.h old mode 100644 new mode 100755 diff --git a/src/leveldb/db/write_batch_test.cc b/src/leveldb/db/write_batch_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/bench/db_bench_sqlite3.cc b/src/leveldb/doc/bench/db_bench_sqlite3.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/bench/db_bench_tree_db.cc b/src/leveldb/doc/bench/db_bench_tree_db.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/benchmark.html b/src/leveldb/doc/benchmark.html old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/doc.css b/src/leveldb/doc/doc.css old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/impl.html b/src/leveldb/doc/impl.html old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/index.html b/src/leveldb/doc/index.html old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/log_format.txt b/src/leveldb/doc/log_format.txt old mode 100644 new mode 100755 diff --git a/src/leveldb/doc/table_format.txt b/src/leveldb/doc/table_format.txt old mode 100644 new mode 100755 diff --git a/src/leveldb/helpers/memenv/memenv.cc b/src/leveldb/helpers/memenv/memenv.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/helpers/memenv/memenv.h b/src/leveldb/helpers/memenv/memenv.h old mode 100644 new mode 100755 diff --git a/src/leveldb/helpers/memenv/memenv_test.cc b/src/leveldb/helpers/memenv/memenv_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/c.h b/src/leveldb/include/leveldb/c.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/cache.h b/src/leveldb/include/leveldb/cache.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/comparator.h b/src/leveldb/include/leveldb/comparator.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/db.h b/src/leveldb/include/leveldb/db.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/env.h b/src/leveldb/include/leveldb/env.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/filter_policy.h b/src/leveldb/include/leveldb/filter_policy.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/iterator.h b/src/leveldb/include/leveldb/iterator.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/options.h b/src/leveldb/include/leveldb/options.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/slice.h b/src/leveldb/include/leveldb/slice.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/status.h b/src/leveldb/include/leveldb/status.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/table.h b/src/leveldb/include/leveldb/table.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/table_builder.h b/src/leveldb/include/leveldb/table_builder.h old mode 100644 new mode 100755 diff --git a/src/leveldb/include/leveldb/write_batch.h b/src/leveldb/include/leveldb/write_batch.h old mode 100644 new mode 100755 diff --git a/src/leveldb/issues/issue178_test.cc b/src/leveldb/issues/issue178_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/issues/issue200_test.cc b/src/leveldb/issues/issue200_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/port/README b/src/leveldb/port/README old mode 100644 new mode 100755 diff --git a/src/leveldb/port/atomic_pointer.h b/src/leveldb/port/atomic_pointer.h old mode 100644 new mode 100755 diff --git a/src/leveldb/port/port.h b/src/leveldb/port/port.h old mode 100644 new mode 100755 diff --git a/src/leveldb/port/port_example.h b/src/leveldb/port/port_example.h old mode 100644 new mode 100755 diff --git a/src/leveldb/port/port_posix.cc b/src/leveldb/port/port_posix.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/port/port_posix.h b/src/leveldb/port/port_posix.h old mode 100644 new mode 100755 diff --git a/src/leveldb/port/port_win.cc b/src/leveldb/port/port_win.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/port/port_win.h b/src/leveldb/port/port_win.h old mode 100644 new mode 100755 diff --git a/src/leveldb/port/thread_annotations.h b/src/leveldb/port/thread_annotations.h old mode 100644 new mode 100755 diff --git a/src/leveldb/port/win/stdint.h b/src/leveldb/port/win/stdint.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/block.cc b/src/leveldb/table/block.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/block.h b/src/leveldb/table/block.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/block_builder.cc b/src/leveldb/table/block_builder.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/block_builder.h b/src/leveldb/table/block_builder.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/filter_block.cc b/src/leveldb/table/filter_block.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/filter_block.h b/src/leveldb/table/filter_block.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/filter_block_test.cc b/src/leveldb/table/filter_block_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/format.cc b/src/leveldb/table/format.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/format.h b/src/leveldb/table/format.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/iterator.cc b/src/leveldb/table/iterator.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/iterator_wrapper.h b/src/leveldb/table/iterator_wrapper.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/merger.cc b/src/leveldb/table/merger.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/merger.h b/src/leveldb/table/merger.h old mode 100644 new mode 100755 diff --git a/src/leveldb/table/table.cc b/src/leveldb/table/table.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/table_builder.cc b/src/leveldb/table/table_builder.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/table_test.cc b/src/leveldb/table/table_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/two_level_iterator.cc b/src/leveldb/table/two_level_iterator.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/table/two_level_iterator.h b/src/leveldb/table/two_level_iterator.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/arena.cc b/src/leveldb/util/arena.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/arena.h b/src/leveldb/util/arena.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/arena_test.cc b/src/leveldb/util/arena_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/bloom.cc b/src/leveldb/util/bloom.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/bloom_test.cc b/src/leveldb/util/bloom_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/cache.cc b/src/leveldb/util/cache.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/cache_test.cc b/src/leveldb/util/cache_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/coding.cc b/src/leveldb/util/coding.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/coding.h b/src/leveldb/util/coding.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/coding_test.cc b/src/leveldb/util/coding_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/comparator.cc b/src/leveldb/util/comparator.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/crc32c.cc b/src/leveldb/util/crc32c.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/crc32c.h b/src/leveldb/util/crc32c.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/crc32c_test.cc b/src/leveldb/util/crc32c_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/env.cc b/src/leveldb/util/env.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/env_posix.cc b/src/leveldb/util/env_posix.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/env_test.cc b/src/leveldb/util/env_test.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/env_win.cc b/src/leveldb/util/env_win.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/filter_policy.cc b/src/leveldb/util/filter_policy.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/hash.cc b/src/leveldb/util/hash.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/hash.h b/src/leveldb/util/hash.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/histogram.cc b/src/leveldb/util/histogram.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/histogram.h b/src/leveldb/util/histogram.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/logging.cc b/src/leveldb/util/logging.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/logging.h b/src/leveldb/util/logging.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/mutexlock.h b/src/leveldb/util/mutexlock.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/options.cc b/src/leveldb/util/options.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/posix_logger.h b/src/leveldb/util/posix_logger.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/random.h b/src/leveldb/util/random.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/status.cc b/src/leveldb/util/status.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/testharness.cc b/src/leveldb/util/testharness.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/testharness.h b/src/leveldb/util/testharness.h old mode 100644 new mode 100755 diff --git a/src/leveldb/util/testutil.cc b/src/leveldb/util/testutil.cc old mode 100644 new mode 100755 diff --git a/src/leveldb/util/testutil.h b/src/leveldb/util/testutil.h old mode 100644 new mode 100755 diff --git a/src/leveldbwrapper.cpp b/src/leveldbwrapper.cpp old mode 100644 new mode 100755 diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h old mode 100644 new mode 100755 diff --git a/src/limitedmap.h b/src/limitedmap.h old mode 100644 new mode 100755 diff --git a/src/luffa.c b/src/luffa.c old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_base.m4 b/src/m4/ax_boost_base.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_chrono.m4 b/src/m4/ax_boost_chrono.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_filesystem.m4 b/src/m4/ax_boost_filesystem.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_program_options.m4 b/src/m4/ax_boost_program_options.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_system.m4 b/src/m4/ax_boost_system.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_thread.m4 b/src/m4/ax_boost_thread.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_boost_unit_test_framework.m4 b/src/m4/ax_boost_unit_test_framework.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_check_compile_flag.m4 b/src/m4/ax_check_compile_flag.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_check_link_flag.m4 b/src/m4/ax_check_link_flag.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_check_preproc_flag.m4 b/src/m4/ax_check_preproc_flag.m4 old mode 100644 new mode 100755 diff --git a/src/m4/ax_pthread.m4 b/src/m4/ax_pthread.m4 old mode 100644 new mode 100755 diff --git a/src/m4/bitcoin_find_bdb48.m4 b/src/m4/bitcoin_find_bdb48.m4 old mode 100644 new mode 100755 diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 old mode 100644 new mode 100755 diff --git a/src/m4/bitcoin_subdir_to_include.m4 b/src/m4/bitcoin_subdir_to_include.m4 old mode 100644 new mode 100755 diff --git a/src/main.cpp b/src/main.cpp old mode 100644 new mode 100755 index eaeb61c3d..60dad256e --- a/src/main.cpp +++ b/src/main.cpp @@ -1450,31 +1450,33 @@ int64_t GetBlockValue(int nBits, int nHeight, int64_t nFees) int64_t GetMasternodePayment(int nHeight, int64_t blockValue) { int64_t ret; - if (nHeight >= Params().RewardForkHeight2()) + + if (nHeight >= 250000) { ret = blockValue * 50 / 100; // 50% } else - if (nHeight >= Params().RewardForkHeight1()) + if (nHeight >= 50000) { ret = blockValue * 25 / 100; // 25% } else { - ret = blockValue/10; // 10% + ret = 0; } + return ret; } -static const int64_t nTargetTimespan = 90; // 3 minutes -static const int64_t nTargetSpacing = 90; // 3 minutes -static const int64_t nInterval = 1; // Retarget every block +static const int64_t nTargetTimespan = 90; // 90 seconds +static const int64_t nTargetSpacing = 90; // 90 seconds +static const int64_t nInterval = 1; // Interzone: retarget every block -static const int64_t nAveragingInterval = 24; // 24 blocks +static const int64_t nAveragingInterval = 24; // 8 blocks static const int64_t nAveragingTargetTimespan = nAveragingInterval * nTargetSpacing; // 12 minutes static const int64_t nMaxAdjustDown = 3; // 3% adjustment down static const int64_t nMaxAdjustUp = 3; // 1% adjustment up -// static const int64_t nTargetTimespanAdjDown = nTargetTimespan * (100 + nMaxAdjustDown) / 100; +static const int64_t nTargetTimespanAdjDown = nTargetTimespan * (100 + nMaxAdjustDown) / 100; // // minimum amount of work that could possibly be required nTime after @@ -4050,17 +4052,14 @@ void static ProcessGetData(CNode* pfrom) { // Send stream from relay memory bool pushed = false; - map::iterator mi; { LOCK(cs_mapRelay); - mi = mapRelay.find(inv); + map::iterator mi = mapRelay.find(inv); if (mi != mapRelay.end()) { + pfrom->PushMessage(inv.GetCommand(), (*mi).second); pushed = true; } } - if (pushed) { - pfrom->PushMessage(inv.GetCommand(), (*mi).second); - } if (!pushed && inv.type == MSG_TX) { @@ -4182,7 +4181,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (pfrom->nVersion != 0) { pfrom->PushMessage("reject", strCommand, REJECT_DUPLICATE, string("Duplicate version message")); - LOCK(cs_main); Misbehaving(pfrom->GetId(), 1); return false; } @@ -4285,7 +4283,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) else if (pfrom->nVersion == 0) { // Must have a version message before anything else - LOCK(cs_main); Misbehaving(pfrom->GetId(), 1); return false; } @@ -4307,7 +4304,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) return true; if (vAddr.size() > 1000) { - LOCK(cs_main); Misbehaving(pfrom->GetId(), 20); return error("message addr size() = %u", vAddr.size()); } @@ -4371,7 +4367,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) vRecv >> vInv; if (vInv.size() > MAX_INV_SZ) { - LOCK(cs_main); Misbehaving(pfrom->GetId(), 20); return error("message inv size() = %u", vInv.size()); } @@ -4416,7 +4411,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) vRecv >> vInv; if (vInv.size() > MAX_INV_SZ) { - LOCK(cs_main); Misbehaving(pfrom->GetId(), 20); return error("message getdata size() = %u", vInv.size()); } @@ -4827,11 +4821,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CBloomFilter filter; vRecv >> filter; - if (!filter.IsWithinSizeConstraints()) { + if (!filter.IsWithinSizeConstraints()) // There is no excuse for sending a too-large filter - LOCK(cs_main); Misbehaving(pfrom->GetId(), 100); - } else { LOCK(pfrom->cs_filter); @@ -4852,17 +4844,13 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) // and thus, the maximum size any matched object can have) in a filteradd message if (vData.size() > MAX_SCRIPT_ELEMENT_SIZE) { - LOCK(cs_main); Misbehaving(pfrom->GetId(), 100); } else { LOCK(pfrom->cs_filter); if (pfrom->pfilter) pfrom->pfilter->insert(vData); else - { - LOCK(cs_main); Misbehaving(pfrom->GetId(), 100); - } } } diff --git a/src/main.h b/src/main.h old mode 100644 new mode 100755 diff --git a/src/masternode-pos.cpp b/src/masternode-pos.cpp old mode 100644 new mode 100755 diff --git a/src/masternode-pos.h b/src/masternode-pos.h old mode 100644 new mode 100755 diff --git a/src/masternode.cpp b/src/masternode.cpp old mode 100644 new mode 100755 index c067120a8..aabf748ed --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -417,7 +417,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) if(nBlockHeight <= nLastBlockHeight) return false; if(!enabled) return false; CMasternodePaymentWinner newWinner; - unsigned int nMinimumAge = mnodeman.CountEnabled(); + int nMinimumAge = mnodeman.CountEnabled(); CScript payeeSource; uint256 hash; diff --git a/src/masternode.h b/src/masternode.h old mode 100644 new mode 100755 index aef7dde76..b62cce061 --- a/src/masternode.h +++ b/src/masternode.h @@ -233,7 +233,7 @@ class CMasternode } } - std::string Status(){ + std::string Status() { std::string strStatus = "ACTIVE"; if(activeState == CMasternode::MASTERNODE_ENABLED) strStatus = "ENABLED"; diff --git a/src/masternodeconfig.cpp b/src/masternodeconfig.cpp old mode 100644 new mode 100755 index 8f1022bce..a12318ee3 --- a/src/masternodeconfig.cpp +++ b/src/masternodeconfig.cpp @@ -51,17 +51,19 @@ bool CMasternodeConfig::read(std::string& strErr) { } } - /*if(Params().NetworkID() == CChainParams::MAIN){ - if(CService(ip).GetPort() != 11994) { - strErr = "Invalid port detected in masternode.conf: " + line + " (must be 11994 for mainnet)"; + /* + if(Params().NetworkID() == CChainParams::MAIN){ + if(CService(ip).GetPort() != 9999) { + strErr = "Invalid port detected in masternode.conf: " + line + " (must be 9999 for mainnet)"; streamConfig.close(); return false; } - } else if(CService(ip).GetPort() == 11994) { - strErr = "Invalid port detected in masternode.conf: " + line + " (11994 must be only on mainnet)"; + } else if(CService(ip).GetPort() == 9999) { + strErr = "Invalid port detected in masternode.conf: " + line + " (9999 must be only on mainnet)"; streamConfig.close(); return false; - }*/ + } + */ add(alias, ip, privKey, txHash, outputIndex, donationAddress, donationPercent); } diff --git a/src/masternodeconfig.h b/src/masternodeconfig.h old mode 100644 new mode 100755 diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp old mode 100644 new mode 100755 index f4cedf325..886823a2a --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -279,12 +279,12 @@ void CMasternodeMan::Clear() nDsqCount = 0; } -unsigned int CMasternodeMan::CountEnabled() +int CMasternodeMan::CountEnabled() { - LOCK(cs); - unsigned int i = 0; - + int i = 0; + BOOST_FOREACH(CMasternode& mn, vMasternodes) { + mn.Check(); if(mn.IsEnabled()) i++; } @@ -293,10 +293,10 @@ unsigned int CMasternodeMan::CountEnabled() int CMasternodeMan::CountMasternodesAboveProtocol(int protocolVersion) { - LOCK(cs); int i = 0; BOOST_FOREACH(CMasternode& mn, vMasternodes) { + mn.Check(); if(mn.protocolVersion < protocolVersion || !mn.IsEnabled()) continue; i++; } @@ -496,7 +496,10 @@ CMasternode* CMasternodeMan::GetMasternodeByRank(int nRank, int64_t nBlockHeight BOOST_FOREACH(CMasternode& mn, vMasternodes) { if(mn.protocolVersion < minProtocol) continue; - if(fOnlyActive && !mn.IsEnabled()) continue; + if(fOnlyActive) { + mn.Check(); + if(!mn.IsEnabled()) continue; + } uint256 n = mn.CalculateScore(1, nBlockHeight); unsigned int n2 = 0; @@ -619,27 +622,11 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } - /*if(chainActive.Height() >= Params().MasternodePortForkHeight()) - { - if(Params().NetworkID() == CChainParams::MAIN) - { - if(addr.GetPort() != 11994) - { - LogPrintf("dsee - Got bad Masternode port\n"); - Misbehaving(pfrom->GetId(), 100); - return; - } - } - else - { - if(addr.GetPort() == 11994) - { - LogPrintf("dsee - Got bad Masternode port\n"); - Misbehaving(pfrom->GetId(), 100); - return; - } - } - }*/ + /* + if(Params().NetworkID() == CChainParams::MAIN){ + if(addr.GetPort() != 9999) return; + } else if(addr.GetPort() == 9999) return; + */ //search existing Masternode list, this is where we update existing Masternodes with new dsee broadcasts CMasternode* pmn = this->Find(vin); @@ -673,11 +660,11 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData // make sure the vout that was signed is related to the transaction that spawned the Masternode // - this is expensive, so it's only done once per Masternode - if(!darkSendSigner.IsVinAssociatedWithPubkey(vin, pubkey)) { - LogPrintf("dsee - Got mismatched pubkey and vin\n"); - Misbehaving(pfrom->GetId(), 100); - return; - } + //if(!darkSendSigner.IsVinAssociatedWithPubkey(vin, pubkey)) { + // LogPrintf("dsee - Got mismatched pubkey and vin\n"); + // Misbehaving(pfrom->GetId(), 100); + // return; + //} if(fDebug) LogPrintf("dsee - Got NEW Masternode entry %s\n", addr.ToString().c_str()); @@ -886,7 +873,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData BOOST_FOREACH(CMasternode& mn, vMasternodes) { - if(mn.addr.IsRFC1918() || mn.addr.IsLocal()) continue; //local network + if(mn.addr.IsRFC1918()) continue; //local network if(mn.IsEnabled()) { diff --git a/src/masternodeman.h b/src/masternodeman.h old mode 100644 new mode 100755 index ee2effc7c..f1b043417 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -100,7 +100,7 @@ class CMasternodeMan /// Clear Masternode vector void Clear(); - unsigned int CountEnabled(); + int CountEnabled(); int CountMasternodesAboveProtocol(int protocolVersion); diff --git a/src/miner.cpp b/src/miner.cpp old mode 100644 new mode 100755 index 10361d86d..b4692dbed --- a/src/miner.cpp +++ b/src/miner.cpp @@ -110,7 +110,7 @@ class TxPriorityCompare CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { // Create new block - unique_ptr pblocktemplate(new CBlockTemplate()); + auto_ptr pblocktemplate(new CBlockTemplate()); if(!pblocktemplate.get()) return NULL; CBlock *pblock = &pblocktemplate->block; // pointer for convenience @@ -542,7 +542,7 @@ void static BitcoinMiner(CWallet *pwallet) CBlockIndex* pindexPrev = chainActive.Tip(); if(!pindexPrev) break; - unique_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); + auto_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); if (!pblocktemplate.get()) return; CBlock *pblock = &pblocktemplate->block; diff --git a/src/miner.h b/src/miner.h old mode 100644 new mode 100755 diff --git a/src/mruset.h b/src/mruset.h old mode 100644 new mode 100755 diff --git a/src/net.cpp b/src/net.cpp old mode 100644 new mode 100755 index de651365f..762e31ab6 --- a/src/net.cpp +++ b/src/net.cpp @@ -127,14 +127,14 @@ bool GetLocal(CService& addr, const CNetAddr *paddrPeer) // get best local address for a particular peer as a CAddress CAddress GetLocalAddress(const CNetAddr *paddrPeer) { - CAddress ret(CService("0.0.0.0",GetListenPort()),0); + CAddress ret(CService("0.0.0.0",0),0); CService addr; if (GetLocal(addr, paddrPeer)) { ret = CAddress(addr); + ret.nServices = nLocalServices; + ret.nTime = GetAdjustedTime(); } - ret.nServices = nLocalServices; - ret.nTime = GetAdjustedTime(); return ret; } @@ -250,14 +250,6 @@ bool AddLocal(const CNetAddr &addr, int nScore) return AddLocal(CService(addr, GetListenPort()), nScore); } -bool RemoveLocal(const CService& addr) -{ - LOCK(cs_mapLocalHost); - LogPrintf("RemoveLocal(%s)\n", addr.ToString()); - mapLocalHost.erase(addr); - return true; -} - /** Make a particular network entirely off-limits (no automatic connects to it) */ void SetLimited(enum Network net, bool fLimited) { @@ -430,7 +422,7 @@ CNode* FindNode(const CNetAddr& ip) return NULL; } -CNode* FindNode(const std::string& addrName) +CNode* FindNode(std::string addrName) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) @@ -455,34 +447,21 @@ CNode* FindNode(const CService& addr) return NULL; } - -//TODO: This is used in only one place in main, and should be removed -CNode* FindNode(const NodeId nodeid) -{ - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - if (pnode->GetId() == nodeid) - return (pnode); - return NULL; -} - CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool darkSendMaster) { if (pszDest == NULL) { if (IsLocal(addrConnect)) return NULL; - - LOCK(cs_vNodes); + // Look for an existing connection CNode* pnode = FindNode((CService)addrConnect); if (pnode) { - // we have connection to this node but not as masternode - // change flag & add reference so we can clear it later - if(darkSendMaster && !pnode->fDarkSendMaster) { - pnode->AddRef(); + pnode->AddRef(); + + if(darkSendMaster) pnode->fDarkSendMaster = true; - } + return pnode; } } @@ -573,7 +552,7 @@ void CNode::PushVersion() -banmap_t CNode::setBanned; +std::map CNode::setBanned; CCriticalSection CNode::cs_setBanned; void CNode::ClearBanned() @@ -581,16 +560,12 @@ void CNode::ClearBanned() setBanned.clear(); } -banmap_t& CNode::GetBanned(){ - return setBanned; -} - bool CNode::IsBanned(CNetAddr ip) { bool fResult = false; { LOCK(cs_setBanned); - banmap_t::iterator i = setBanned.find(ip); + std::map::iterator i = setBanned.find(ip); if (i != setBanned.end()) { int64_t t = (*i).second; @@ -601,8 +576,8 @@ bool CNode::IsBanned(CNetAddr ip) return fResult; } -bool CNode::Ban(const CNetAddr &addr, uint64_t banTime) { - banTime = GetTime()+(!banTime)?GetArg("-bantime", 60*60*24):0; // Default 24-hour ban +bool CNode::Ban(const CNetAddr &addr) { + int64_t banTime = GetTime()+GetArg("-bantime", 60*60*24); // Default 24-hour ban { LOCK(cs_setBanned); if (setBanned[addr] < banTime) @@ -610,12 +585,6 @@ bool CNode::Ban(const CNetAddr &addr, uint64_t banTime) { } return true; } -bool CNode::Unban(const CNetAddr &ip) { - LOCK(cs_setBanned); - if (!setBanned.erase(ip)) - return false; - return true; -} #undef X #define X(name) stats.name = name @@ -764,7 +733,7 @@ void SocketSendData(CNode *pnode) if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { LogPrintf("socket send error %s\n", NetworkErrorString(nErr)); - pnode->fDisconnect = true; + pnode->CloseSocketDisconnect(); } } // couldn't send anything at all @@ -849,13 +818,8 @@ void ThreadSocketHandler() } } } - size_t vNodesSize; - { - LOCK(cs_vNodes); - vNodesSize = vNodes.size(); - } - if(vNodesSize != nPrevNodeCount) { - nPrevNodeCount = vNodesSize; + if(vNodes.size() != nPrevNodeCount) { + nPrevNodeCount = vNodes.size(); uiInterface.NotifyNumConnectionsChanged(nPrevNodeCount); } @@ -1354,7 +1318,7 @@ void ThreadOpenConnections() { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { - if (!pnode->fInbound && !pnode->fDarkSendMaster) { + if (!pnode->fInbound) { setConnected.insert(pnode->addr.GetGroup()); nOutbound++; } @@ -1575,7 +1539,7 @@ void ThreadMessageHandler() if (lockRecv) { if (!g_signals.ProcessMessages(pnode)) - pnode->fDisconnect = true; + pnode->CloseSocketDisconnect(); if (pnode->nSendSize < SendBufferSize()) { diff --git a/src/net.h b/src/net.h old mode 100644 new mode 100755 index 4936a619f..a302b322a --- a/src/net.h +++ b/src/net.h @@ -13,7 +13,6 @@ #include "mruset.h" #include "netbase.h" #include "protocol.h" -#include "random.h" #include "sync.h" #include "uint256.h" #include "util.h" @@ -38,7 +37,6 @@ namespace boost { class thread_group; } -typedef std::map banmap_t; /** The maximum number of entries in an 'inv' protocol message */ static const unsigned int MAX_INV_SZ = 50000; /** The maximum number of entries in mapAskFor */ @@ -58,14 +56,12 @@ CNode* FindNode(const CService& ip); CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool darkSendMaster=false); void MapPort(bool fUseUPnP); unsigned short GetListenPort(); -typedef int NodeId; -CNode* FindNode(const std::string& addrName); -CNode* FindNode(const NodeId id); //TODO: Remove this bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string())); void StartNode(boost::thread_group& threadGroup); bool StopNode(); void SocketSendData(CNode *pnode); +typedef int NodeId; // Signals for message handling struct CNodeSignals @@ -98,7 +94,6 @@ bool IsLimited(enum Network net); bool IsLimited(const CNetAddr& addr); bool AddLocal(const CService& addr, int nScore = LOCAL_NONE); bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE); -bool RemoveLocal(const CService& addr); bool SeenLocal(const CService& addr); bool IsLocal(const CService& addr); bool GetLocal(CService &addr, const CNetAddr *paddrPeer = NULL); @@ -251,7 +246,7 @@ class CNode // Denial-of-service detection/prevention // Key is IP address, value is banned-until-time - static banmap_t setBanned; + static std::map setBanned; static CCriticalSection cs_setBanned; std::vector vecRequestsFulfilled; //keep track of what client has asked for @@ -783,10 +778,8 @@ class CNode // between nodes running old code and nodes running // new code. static void ClearBanned(); // needed for unit testing - static banmap_t &GetBanned(); static bool IsBanned(CNetAddr ip); - static bool Ban(const CNetAddr &ip, uint64_t banTime=0); - static bool Unban(const CNetAddr &ip); + static bool Ban(const CNetAddr &ip); void copyStats(CNodeStats &stats); // Network stats diff --git a/src/netbase.cpp b/src/netbase.cpp old mode 100644 new mode 100755 index 03f0493d5..eb6859e28 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -163,14 +163,6 @@ bool LookupNumeric(const char *pszName, CService& addr, int portDefault) return Lookup(pszName, addr, portDefault, false); } -struct timeval MillisToTimeval(int64_t nTimeout) -{ - struct timeval timeout; - timeout.tv_sec = nTimeout / 1000; - timeout.tv_usec = (nTimeout % 1000) * 1000; - return timeout; -} - bool static Socks4(const CService &addrDest, SOCKET& hSocket) { LogPrintf("SOCKS4 connecting %s\n", addrDest.ToString()); diff --git a/src/netbase.h b/src/netbase.h old mode 100644 new mode 100755 index 4b80a6d9d..b42db1cfa --- a/src/netbase.h +++ b/src/netbase.h @@ -153,6 +153,4 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest /** Return readable error string for a network error code */ std::string NetworkErrorString(int err); -struct timeval MillisToTimeval(int64_t nTimeout); - #endif diff --git a/src/noui.cpp b/src/noui.cpp old mode 100644 new mode 100755 diff --git a/src/noui.h b/src/noui.h old mode 100644 new mode 100755 diff --git a/src/obj-test/.gitignore b/src/obj-test/.gitignore old mode 100644 new mode 100755 diff --git a/src/obj/.gitignore b/src/obj/.gitignore old mode 100644 new mode 100755 diff --git a/src/pkg.m4 b/src/pkg.m4 old mode 100644 new mode 100755 diff --git a/src/prevector.h b/src/prevector.h deleted file mode 100644 index ba5b17e78..000000000 --- a/src/prevector.h +++ /dev/null @@ -1,477 +0,0 @@ -#ifndef _BITCOIN_PREVECTOR_H_ -#define _BITCOIN_PREVECTOR_H_ - -#include -#include -#include - -#include - -#pragma pack(push, 1) -/** Implements a drop-in replacement for std::vector which stores up to N - * elements directly (without heap allocation). The types Size and Diff are - * used to store element counts, and can be any unsigned + signed type. - * - * Storage layout is either: - * - Direct allocation: - * - Size _size: the number of used elements (between 0 and N) - * - T direct[N]: an array of N elements of type T - * (only the first _size are initialized). - * - Indirect allocation: - * - Size _size: the number of used elements plus N + 1 - * - Size capacity: the number of allocated elements - * - T* indirect: a pointer to an array of capacity elements of type T - * (only the first _size are initialized). - * - * The data type T must be movable by memmove/realloc(). Once we switch to C++, - * move constructors can be used instead. - */ -template -class prevector { -public: - typedef Size size_type; - typedef Diff difference_type; - typedef T value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef value_type* pointer; - typedef const value_type* const_pointer; - - class iterator { - T* ptr; - public: - typedef Diff difference_type; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef std::random_access_iterator_tag iterator_category; - iterator(T* ptr_) : ptr(ptr_) {} - T& operator*() const { return *ptr; } - T* operator->() const { return ptr; } - T& operator[](size_type pos) { return ptr[pos]; } - const T& operator[](size_type pos) const { return ptr[pos]; } - iterator& operator++() { ptr++; return *this; } - iterator& operator--() { ptr--; return *this; } - iterator operator++(int) { iterator copy(*this); ++(*this); return copy; } - iterator operator--(int) { iterator copy(*this); --(*this); return copy; } - difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); } - iterator operator+(size_type n) { return iterator(ptr + n); } - iterator& operator+=(size_type n) { ptr += n; return *this; } - iterator operator-(size_type n) { return iterator(ptr - n); } - iterator& operator-=(size_type n) { ptr -= n; return *this; } - bool operator==(iterator x) const { return ptr == x.ptr; } - bool operator!=(iterator x) const { return ptr != x.ptr; } - bool operator>=(iterator x) const { return ptr >= x.ptr; } - bool operator<=(iterator x) const { return ptr <= x.ptr; } - bool operator>(iterator x) const { return ptr > x.ptr; } - bool operator<(iterator x) const { return ptr < x.ptr; } - }; - - class reverse_iterator { - T* ptr; - public: - typedef Diff difference_type; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef std::bidirectional_iterator_tag iterator_category; - reverse_iterator(T* ptr_) : ptr(ptr_) {} - T& operator*() { return *ptr; } - const T& operator*() const { return *ptr; } - T* operator->() { return ptr; } - const T* operator->() const { return ptr; } - reverse_iterator& operator--() { ptr++; return *this; } - reverse_iterator& operator++() { ptr--; return *this; } - reverse_iterator operator++(int) { reverse_iterator copy(*this); ++(*this); return copy; } - reverse_iterator operator--(int) { reverse_iterator copy(*this); --(*this); return copy; } - bool operator==(reverse_iterator x) const { return ptr == x.ptr; } - bool operator!=(reverse_iterator x) const { return ptr != x.ptr; } - }; - - class const_iterator { - const T* ptr; - public: - typedef Diff difference_type; - typedef const T value_type; - typedef const T* pointer; - typedef const T& reference; - typedef std::random_access_iterator_tag iterator_category; - const_iterator(const T* ptr_) : ptr(ptr_) {} - const_iterator(iterator x) : ptr(&(*x)) {} - const T& operator*() const { return *ptr; } - const T* operator->() const { return ptr; } - const T& operator[](size_type pos) const { return ptr[pos]; } - const_iterator& operator++() { ptr++; return *this; } - const_iterator& operator--() { ptr--; return *this; } - const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; } - const_iterator operator--(int) { const_iterator copy(*this); --(*this); return copy; } - difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); } - const_iterator operator+(size_type n) { return const_iterator(ptr + n); } - const_iterator& operator+=(size_type n) { ptr += n; return *this; } - const_iterator operator-(size_type n) { return const_iterator(ptr - n); } - const_iterator& operator-=(size_type n) { ptr -= n; return *this; } - bool operator==(const_iterator x) const { return ptr == x.ptr; } - bool operator!=(const_iterator x) const { return ptr != x.ptr; } - bool operator>=(const_iterator x) const { return ptr >= x.ptr; } - bool operator<=(const_iterator x) const { return ptr <= x.ptr; } - bool operator>(const_iterator x) const { return ptr > x.ptr; } - bool operator<(const_iterator x) const { return ptr < x.ptr; } - }; - - class const_reverse_iterator { - const T* ptr; - public: - typedef Diff difference_type; - typedef const T value_type; - typedef const T* pointer; - typedef const T& reference; - typedef std::bidirectional_iterator_tag iterator_category; - const_reverse_iterator(T* ptr_) : ptr(ptr_) {} - const_reverse_iterator(reverse_iterator x) : ptr(&(*x)) {} - const T& operator*() const { return *ptr; } - const T* operator->() const { return ptr; } - const_reverse_iterator& operator--() { ptr++; return *this; } - const_reverse_iterator& operator++() { ptr--; return *this; } - const_reverse_iterator operator++(int) { const_reverse_iterator copy(*this); ++(*this); return copy; } - const_reverse_iterator operator--(int) { const_reverse_iterator copy(*this); --(*this); return copy; } - bool operator==(const_reverse_iterator x) const { return ptr == x.ptr; } - bool operator!=(const_reverse_iterator x) const { return ptr != x.ptr; } - }; - -private: - size_type _size; - union direct_or_indirect { - char direct[sizeof(T) * N]; - struct { - size_type capacity; - char* indirect; - }; - } _union; - - T* direct_ptr(difference_type pos) { return reinterpret_cast(_union.direct) + pos; } - const T* direct_ptr(difference_type pos) const { return reinterpret_cast(_union.direct) + pos; } - T* indirect_ptr(difference_type pos) { return reinterpret_cast(_union.indirect) + pos; } - const T* indirect_ptr(difference_type pos) const { return reinterpret_cast(_union.indirect) + pos; } - bool is_direct() const { return _size <= N; } - - void change_capacity(size_type new_capacity) { - if (new_capacity <= N) { - if (!is_direct()) { - T* indirect = indirect_ptr(0); - T* src = indirect; - T* dst = direct_ptr(0); - memcpy(dst, src, size() * sizeof(T)); - free(indirect); - _size -= N + 1; - } - } else { - if (!is_direct()) { - _union.indirect = static_cast(realloc(_union.indirect, ((size_t)sizeof(T)) * new_capacity)); - _union.capacity = new_capacity; - } else { - char* new_indirect = static_cast(malloc(((size_t)sizeof(T)) * new_capacity)); - T* src = direct_ptr(0); - T* dst = reinterpret_cast(new_indirect); - memcpy(dst, src, size() * sizeof(T)); - _union.indirect = new_indirect; - _union.capacity = new_capacity; - _size += N + 1; - } - } - } - - T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } - const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } - -public: - void assign(size_type n, const T& val) { - clear(); - if (capacity() < n) { - change_capacity(n); - } - while (size() < n) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(val); - } - } - - template - void assign(InputIterator first, InputIterator last) { - size_type n = last - first; - clear(); - if (capacity() < n) { - change_capacity(n); - } - while (first != last) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(*first); - ++first; - } - } - - prevector() : _size(0) {} - - explicit prevector(size_type n) : _size(0) { - resize(n); - } - - explicit prevector(size_type n, const T& val = T()) : _size(0) { - change_capacity(n); - while (size() < n) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(val); - } - } - - template - prevector(InputIterator first, InputIterator last) : _size(0) { - size_type n = last - first; - change_capacity(n); - while (first != last) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(*first); - ++first; - } - } - - prevector(const prevector& other) : _size(0) { - change_capacity(other.size()); - const_iterator it = other.begin(); - while (it != other.end()) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(*it); - ++it; - } - } - - prevector& operator=(const prevector& other) { - if (&other == this) { - return *this; - } - resize(0); - change_capacity(other.size()); - const_iterator it = other.begin(); - while (it != other.end()) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(*it); - ++it; - } - return *this; - } - - size_type size() const { - return is_direct() ? _size : _size - N - 1; - } - - bool empty() const { - return size() == 0; - } - - iterator begin() { return iterator(item_ptr(0)); } - const_iterator begin() const { return const_iterator(item_ptr(0)); } - iterator end() { return iterator(item_ptr(size())); } - const_iterator end() const { return const_iterator(item_ptr(size())); } - - reverse_iterator rbegin() { return reverse_iterator(item_ptr(size() - 1)); } - const_reverse_iterator rbegin() const { return const_reverse_iterator(item_ptr(size() - 1)); } - reverse_iterator rend() { return reverse_iterator(item_ptr(-1)); } - const_reverse_iterator rend() const { return const_reverse_iterator(item_ptr(-1)); } - - size_t capacity() const { - if (is_direct()) { - return N; - } else { - return _union.capacity; - } - } - - T& operator[](size_type pos) { - return *item_ptr(pos); - } - - const T& operator[](size_type pos) const { - return *item_ptr(pos); - } - - void resize(size_type new_size) { - if (size() > new_size) { - erase(item_ptr(new_size), end()); - } - if (new_size > capacity()) { - change_capacity(new_size); - } - while (size() < new_size) { - _size++; - new(static_cast(item_ptr(size() - 1))) T(); - } - } - - void reserve(size_type new_capacity) { - if (new_capacity > capacity()) { - change_capacity(new_capacity); - } - } - - void shrink_to_fit() { - change_capacity(size()); - } - - void clear() { - resize(0); - } - - iterator insert(iterator pos, const T& value) { - size_type p = pos - begin(); - size_type new_size = size() + 1; - if (capacity() < new_size) { - change_capacity(new_size + (new_size >> 1)); - } - memmove(item_ptr(p + 1), item_ptr(p), (size() - p) * sizeof(T)); - _size++; - new(static_cast(item_ptr(p))) T(value); - return iterator(item_ptr(p)); - } - - void insert(iterator pos, size_type count, const T& value) { - size_type p = pos - begin(); - size_type new_size = size() + count; - if (capacity() < new_size) { - change_capacity(new_size + (new_size >> 1)); - } - memmove(item_ptr(p + count), item_ptr(p), (size() - p) * sizeof(T)); - _size += count; - for (size_type i = 0; i < count; i++) { - new(static_cast(item_ptr(p + i))) T(value); - } - } - - template - void insert(iterator pos, InputIterator first, InputIterator last) { - size_type p = pos - begin(); - difference_type count = last - first; - size_type new_size = size() + count; - if (capacity() < new_size) { - change_capacity(new_size + (new_size >> 1)); - } - memmove(item_ptr(p + count), item_ptr(p), (size() - p) * sizeof(T)); - _size += count; - while (first != last) { - new(static_cast(item_ptr(p))) T(*first); - ++p; - ++first; - } - } - - iterator erase(iterator pos) { - return erase(pos, pos + 1); - } - - iterator erase(iterator first, iterator last) { - iterator p = first; - char* endp = (char*)&(*end()); - while (p != last) { - (*p).~T(); - _size--; - ++p; - } - memmove(&(*first), &(*last), endp - ((char*)(&(*last)))); - return first; - } - - void push_back(const T& value) { - size_type new_size = size() + 1; - if (capacity() < new_size) { - change_capacity(new_size + (new_size >> 1)); - } - new(item_ptr(size())) T(value); - _size++; - } - - void pop_back() { - erase(end() - 1, end()); - } - - T& front() { - return *item_ptr(0); - } - - const T& front() const { - return *item_ptr(0); - } - - T& back() { - return *item_ptr(size() - 1); - } - - const T& back() const { - return *item_ptr(size() - 1); - } - - void swap(prevector& other) { - std::swap(_union, other._union); - std::swap(_size, other._size); - } - - ~prevector() { - clear(); - if (!is_direct()) { - free(_union.indirect); - _union.indirect = NULL; - } - } - - bool operator==(const prevector& other) const { - if (other.size() != size()) { - return false; - } - const_iterator b1 = begin(); - const_iterator b2 = other.begin(); - const_iterator e1 = end(); - while (b1 != e1) { - if ((*b1) != (*b2)) { - return false; - } - ++b1; - ++b2; - } - return true; - } - - bool operator!=(const prevector& other) const { - return !(*this == other); - } - - bool operator<(const prevector& other) const { - if (size() < other.size()) { - return true; - } - if (size() > other.size()) { - return false; - } - const_iterator b1 = begin(); - const_iterator b2 = other.begin(); - const_iterator e1 = end(); - while (b1 != e1) { - if ((*b1) < (*b2)) { - return true; - } - if ((*b2) < (*b1)) { - return false; - } - ++b1; - ++b2; - } - return false; - } - - size_t allocated_memory() const { - if (is_direct()) { - return 0; - } else { - return ((size_t)(sizeof(T))) * _union.capacity; - } - } -}; -#pragma pack(pop) - -#endif diff --git a/src/protocol.cpp b/src/protocol.cpp old mode 100644 new mode 100755 index d2c535962..c42916d40 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -151,11 +151,7 @@ const char* CInv::GetCommand() const std::string CInv::ToString() const { - try { - return strprintf("%s %s", GetCommand(), hash.ToString()); - } catch(const std::out_of_range &) { - return strprintf("0x%08x %s", type, hash.ToString()); - } + return strprintf("%s %s", GetCommand(), hash.ToString()); } void CInv::print() const diff --git a/src/protocol.h b/src/protocol.h old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/.gitignore b/src/qa/rpc-tests/.gitignore old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/README.md b/src/qa/rpc-tests/README.md old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore b/src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py b/src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py b/src/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/python-bitcoinrpc/setup.py b/src/qa/rpc-tests/python-bitcoinrpc/setup.py old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/util.py b/src/qa/rpc-tests/util.py old mode 100644 new mode 100755 diff --git a/src/qa/rpc-tests/util.sh b/src/qa/rpc-tests/util.sh old mode 100644 new mode 100755 diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index 6a14ebceb..677ac56ed 100755 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -59,8 +59,7 @@ QT_FORMS_UI = \ forms/sendcoinsdialog.ui \ forms/sendcoinsentry.ui \ forms/signverifymessagedialog.ui \ - forms/transactiondescdialog.ui \ - forms/masternodelist.ui + forms/transactiondescdialog.ui QT_MOC_CPP = \ moc_addressbookpage.cpp \ @@ -106,10 +105,7 @@ QT_MOC_CPP = \ moc_utilitydialog.cpp \ moc_walletframe.cpp \ moc_walletmodel.cpp \ - moc_walletview.cpp \ - moc_masternodelist.cpp \ - moc_bantablemodel.cpp \ - moc_peertablemodel.cpp + moc_walletview.cpp BITCOIN_MM = \ macdockiconhandler.mm \ @@ -177,10 +173,7 @@ BITCOIN_QT_H = \ walletmodel.h \ walletmodeltransaction.h \ walletview.h \ - winshutdownmonitor.h \ - masternodelist.h \ - bantablemodel.h \ - peertablemodel.h + winshutdownmonitor.h RES_ICONS = \ res/icons/add.png \ @@ -284,10 +277,7 @@ BITCOIN_QT_CPP += \ walletframe.cpp \ walletmodel.cpp \ walletmodeltransaction.cpp \ - walletview.cpp \ - masternodelist.cpp \ - bantablemodel.cpp \ - peertablemodel.cpp + walletview.cpp endif RES_IMAGES = \ @@ -341,7 +331,7 @@ if ENABLE_WALLET interzone_qt_LDADD += $(LIBBITCOIN_WALLET) endif interzone_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) interzone_qt_LDFLAGS = $(QT_LDFLAGS) # forms/foo.h -> forms/ui_foo.h diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp deleted file mode 100755 index 77d850406..000000000 --- a/src/qt/bantablemodel.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) 2011-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "bantablemodel.h" - -#include "clientmodel.h" -#include "guiconstants.h" -#include "guiutil.h" - -#include "sync.h" -//#include "utiltime.h" -#include "../net.h" -#include -#include -#include - -bool BannedNodeLessThan::operator()(const CCombinedBan& left, const CCombinedBan& right) const -{ - const CCombinedBan* pLeft = &left; - const CCombinedBan* pRight = &right; - - if (order == Qt::DescendingOrder) - std::swap(pLeft, pRight); - - switch(column) - { - case BanTableModel::Address: - return pLeft->subnet.ToString().compare(pRight->subnet.ToString()) < 0; - case BanTableModel::Bantime: - return pLeft->banEntry < pRight->banEntry; - } - - return false; -} - -// private implementation -class BanTablePriv -{ -public: - /** Local cache of peer information */ - QList cachedBanlist; - /** Column to sort nodes by */ - int sortColumn; - /** Order (ascending or descending) to sort nodes by */ - Qt::SortOrder sortOrder; - - /** Pull a full list of banned nodes from CNode into our cache */ - void refreshBanlist() - { - banmap_t banMap=CNode::GetBanned(); - - cachedBanlist.clear(); -#if QT_VERSION >= 0x040700 - cachedBanlist.reserve(banMap.size()); -#endif - for (banmap_t::iterator it = banMap.begin(); it != banMap.end(); it++) - { - CCombinedBan banEntry; - banEntry.subnet = (*it).first; - banEntry.banEntry = (*it).second; - cachedBanlist.append(banEntry); - } - - if (sortColumn >= 0) - // sort cachedBanlist (use stable sort to prevent rows jumping around unneceesarily) - qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder)); - } - - int size() const - { - return cachedBanlist.size(); - } - - CCombinedBan *index(int idx) - { - if (idx >= 0 && idx < cachedBanlist.size()) - return &cachedBanlist[idx]; - - return 0; - } -}; - -BanTableModel::BanTableModel(ClientModel *parent) : - QAbstractTableModel(parent), - clientModel(parent) -{ - columns << tr("IP/Netmask") << tr("Banned Until"); - priv = new BanTablePriv(); - // default to unsorted - priv->sortColumn = -1; - - // load initial data - refresh(); -} - -int BanTableModel::rowCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent); - return priv->size(); -} - -int BanTableModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent); - return columns.length(); -} - -QVariant BanTableModel::data(const QModelIndex &index, int role) const -{ - if(!index.isValid()) - return QVariant(); - - CCombinedBan *rec = static_cast(index.internalPointer()); - - if (role == Qt::DisplayRole) { - switch(index.column()) - { - case Address: - return QString::fromStdString(rec->subnet.ToString()); - case Bantime: - QDateTime date = QDateTime::fromMSecsSinceEpoch(0); - date = date.addSecs(rec->banEntry); - return date.toString(Qt::SystemLocaleLongDate); - } - } - - return QVariant(); -} - -QVariant BanTableModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if(orientation == Qt::Horizontal) - { - if(role == Qt::DisplayRole && section < columns.size()) - { - return columns[section]; - } - } - return QVariant(); -} - -Qt::ItemFlags BanTableModel::flags(const QModelIndex &index) const -{ - if(!index.isValid()) - return 0; - - Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; - return retval; -} - -QModelIndex BanTableModel::index(int row, int column, const QModelIndex &parent) const -{ - Q_UNUSED(parent); - CCombinedBan *data = priv->index(row); - - if (data) - return createIndex(row, column, data); - return QModelIndex(); -} - -void BanTableModel::refresh() -{ - Q_EMIT layoutAboutToBeChanged(); - priv->refreshBanlist(); - Q_EMIT layoutChanged(); -} - -void BanTableModel::sort(int column, Qt::SortOrder order) -{ - priv->sortColumn = column; - priv->sortOrder = order; - refresh(); -} - -bool BanTableModel::shouldShow() -{ - if (priv->size() > 0) - return true; - return false; -} diff --git a/src/qt/bantablemodel.h b/src/qt/bantablemodel.h deleted file mode 100755 index 5799e711f..000000000 --- a/src/qt/bantablemodel.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2011-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_QT_BANTABLEMODEL_H -#define BITCOIN_QT_BANTABLEMODEL_H - -#include "net.h" - -#include -#include - -class ClientModel; -class BanTablePriv; - -struct CCombinedBan { - CNetAddr subnet; - int64_t banEntry; -}; - -class BannedNodeLessThan -{ -public: - BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder) : - column(nColumn), order(fOrder) {} - bool operator()(const CCombinedBan& left, const CCombinedBan& right) const; - -private: - int column; - Qt::SortOrder order; -}; - -/** - Qt model providing information about connected peers, similar to the - "getpeerinfo" RPC call. Used by the rpc console UI. - */ -class BanTableModel : public QAbstractTableModel -{ - Q_OBJECT - -public: - explicit BanTableModel(ClientModel *parent = 0); - void startAutoRefresh(); - void stopAutoRefresh(); - - enum ColumnIndex { - Address = 0, - Bantime = 1 - }; - - /** @name Methods overridden from QAbstractTableModel - @{*/ - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QModelIndex index(int row, int column, const QModelIndex &parent) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - void sort(int column, Qt::SortOrder order); - bool shouldShow(); - /*@}*/ - -public Q_SLOTS: - void refresh(); - -private: - ClientModel *clientModel; - QStringList columns; - BanTablePriv *priv; -}; - -#endif // BITCOIN_QT_BANTABLEMODEL_H diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index cc5f35c82..fdd3a0c27 100755 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -271,17 +271,6 @@ void BitcoinGUI::createActions(bool fIsTestnet) #endif tabGroup->addAction(historyAction); - masternodeList = new QAction(QIcon(":/icons/history"), tr("&Masternodes"), this); - masternodeList->setStatusTip(tr("Masternodes")); - masternodeList->setToolTip(masternodeList->statusTip()); - masternodeList->setCheckable(true); -#ifdef Q_OS_MAC - masternodeList->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_5)); -#else - masternodeList->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); -#endif - tabGroup->addAction(masternodeList); - // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -292,7 +281,6 @@ void BitcoinGUI::createActions(bool fIsTestnet) connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); - connect(masternodeList, SIGNAL(triggered()), this, SLOT(gotomasternodeList())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); @@ -443,7 +431,6 @@ void BitcoinGUI::createToolBars() toolbar->addAction(sendCoinsAction); toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); - toolbar->addAction(masternodeList); toolbar->setMovable(false); // remove unused icon in upper left corner overviewAction->setChecked(true); @@ -641,11 +628,6 @@ void BitcoinGUI::openClicked() emit receivedURI(dlg.getURI()); } } -void BitcoinGUI::gotomasternodeList() -{ - masternodeList->setChecked(true); - if (walletFrame) walletFrame->gotomasternodeList(); -} void BitcoinGUI::gotoOverviewPage() { diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 663d38aad..c6d13df84 100755 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -100,7 +100,6 @@ class BitcoinGUI : public QMainWindow QAction *showBackupsAction; QAction *openAction; QAction *showHelpMessageAction; - QAction *masternodeList; QSystemTrayIcon *trayIcon; Notificator *notificator; @@ -163,8 +162,6 @@ public slots: private slots: #ifdef ENABLE_WALLET - /** Switch to master node list Page */ - void gotomasternodeList(); /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index e5b268a69..9b3a48333 100755 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -19,7 +19,7 @@ QList BitcoinUnits::availableUnits() unitlist.append(Interzone); unitlist.append(mInterzone); unitlist.append(uInterzone); - unitlist.append(chuffs); + unitlist.append(burroughs); return unitlist; } @@ -30,7 +30,7 @@ bool BitcoinUnits::valid(int unit) case Interzone: case mInterzone: case uInterzone: - case chuffs: + case burroughs: return true; default: return false; @@ -46,7 +46,7 @@ QString BitcoinUnits::name(int unit) case Interzone: return QString("ITZ"); case mInterzone: return QString("mITZ"); case uInterzone: return QString::fromUtf8("μITZ"); - case chuffs: return QString::fromUtf8("chuffs"); + case burroughs: return QString::fromUtf8("burroughs"); default: return QString("???"); } } @@ -57,7 +57,7 @@ QString BitcoinUnits::name(int unit) case Interzone: return QString("tITZ"); case mInterzone: return QString("mtITZ"); case uInterzone: return QString::fromUtf8("μtITZ"); - case chuffs: return QString::fromUtf8("tchuffs"); + case burroughs: return QString::fromUtf8("tburroughs"); default: return QString("???"); } } @@ -72,7 +72,7 @@ QString BitcoinUnits::description(int unit) case Interzone: return QString("Interzone"); case mInterzone: return QString("Milli-Interzone (1 / 1,000)"); case uInterzone: return QString("Micro-Interzone (1 / 1,000,000)"); - case chuffs: return QString("Ten Nano-Interzone (1 / 100,000,000)"); + case burroughs: return QString("Ten Nano-Interzone (1 / 100,000,000)"); default: return QString("???"); } } @@ -83,7 +83,7 @@ QString BitcoinUnits::description(int unit) case Interzone: return QString("TestInterzones"); case mInterzone: return QString("Milli-TestInterzone (1 / 1,000)"); case uInterzone: return QString("Micro-TestInterzone (1 / 1,000,000)"); - case chuffs: return QString("Ten Nano-TestInterzone (1 / 100,000,000)"); + case burroughs: return QString("Ten Nano-TestInterzone (1 / 100,000,000)"); default: return QString("???"); } } @@ -96,7 +96,7 @@ qint64 BitcoinUnits::factor(int unit) case Interzone: return 100000000; case mInterzone: return 100000; case uInterzone: return 100; - case chuffs: return 1; + case burroughs: return 1; default: return 100000000; } } @@ -108,7 +108,7 @@ qint64 BitcoinUnits::maxAmount(int unit) case Interzone: return Q_INT64_C(21000000); case mInterzone: return Q_INT64_C(21000000000); case uInterzone: return Q_INT64_C(21000000000000); - case chuffs: return Q_INT64_C(2100000000000000); + case burroughs: return Q_INT64_C(2100000000000000); default: return 0; } } @@ -120,7 +120,7 @@ int BitcoinUnits::amountDigits(int unit) case Interzone: return 8; // 21,000,000 (# digits, without commas) case mInterzone: return 11; // 21,000,000,000 case uInterzone: return 14; // 21,000,000,000,000 - case chuffs: return 16; // 2,100,000,000,000,000 + case burroughs: return 16; // 2,100,000,000,000,000 default: return 0; } } @@ -132,7 +132,7 @@ int BitcoinUnits::decimals(int unit) case Interzone: return 8; case mInterzone: return 5; case uInterzone: return 2; - case chuffs: return 0; + case burroughs: return 0; default: return 0; } } diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 2983e7e6a..03fc71f16 100755 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -29,7 +29,7 @@ class BitcoinUnits: public QAbstractListModel Interzone, mInterzone, uInterzone, - chuffs + burroughs }; //! @name Static API diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 8abf7996e..22de607f3 100755 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -5,10 +5,7 @@ #include "clientmodel.h" - -#include "bantablemodel.h" #include "guiconstants.h" -#include "peertablemodel.h" #include "alert.h" #include "chainparams.h" @@ -30,12 +27,8 @@ ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), cachedNumBlocks(0), cachedMasternodeCountString(""), cachedReindexing(0), cachedImporting(0), - numBlocksAtStartup(-1), pollTimer(0), - peerTableModel(0), - banTableModel(0) + numBlocksAtStartup(-1), pollTimer(0) { - peerTableModel = new PeerTableModel(this); - banTableModel = new BanTableModel(this); pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); @@ -209,15 +202,7 @@ OptionsModel *ClientModel::getOptionsModel() { return optionsModel; } -PeerTableModel *ClientModel::getPeerTableModel() -{ - return peerTableModel; -} -BanTableModel *ClientModel::getBanTableModel() -{ - return banTableModel; -} QString ClientModel::formatFullVersion() const { return QString::fromStdString(FormatFullVersion()); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 577a3db1a..a3e1f41db 100755 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -7,13 +7,10 @@ #define CLIENTMODEL_H #include + class AddressTableModel; class OptionsModel; -class BanTableModel; -class PeerTableModel; class TransactionTableModel; -class BanTableModel; -class PeerTableModel; class CWallet; @@ -47,8 +44,6 @@ class ClientModel : public QObject OptionsModel *getOptionsModel(); - PeerTableModel *getPeerTableModel(); - BanTableModel *getBanTableModel(); //! Return number of connections, default is in- and outbound (total) int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const; QString getMasternodeCountString() const; @@ -79,8 +74,6 @@ class ClientModel : public QObject private: OptionsModel *optionsModel; - PeerTableModel *peerTableModel; - BanTableModel *banTableModel; int cachedNumBlocks; QString cachedMasternodeCountString; bool cachedReindexing; diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui index 016d8ceaf..7be8e64b2 100755 --- a/src/qt/forms/aboutdialog.ui +++ b/src/qt/forms/aboutdialog.ui @@ -6,7 +6,7 @@ 0 0 - 992 + 593 319 @@ -23,7 +23,7 @@ - :/images/about + :/images/about @@ -152,7 +152,7 @@ This product includes software developed by the OpenSSL Project for use in the O - + diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index fa72290c8..f58cd42a0 100755 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -60,7 +60,7 @@ &New - + :/icons/add:/icons/add @@ -74,7 +74,7 @@ &Copy - + :/icons/editcopy:/icons/editcopy @@ -88,7 +88,7 @@ &Delete - + :/icons/remove:/icons/remove @@ -115,7 +115,7 @@ &Export - + :/icons/export:/icons/export @@ -138,7 +138,7 @@ - + diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui index 40bc96ab8..f792606c1 100755 --- a/src/qt/forms/coincontroldialog.ui +++ b/src/qt/forms/coincontroldialog.ui @@ -458,7 +458,7 @@ - Perplexion Rounds + Darksend Rounds diff --git a/src/qt/forms/darksendconfig.ui b/src/qt/forms/darksendconfig.ui index d7d6776f9..914431d61 100755 --- a/src/qt/forms/darksendconfig.ui +++ b/src/qt/forms/darksendconfig.ui @@ -11,7 +11,7 @@ - Configure Perplexion + Configure Darksend diff --git a/src/qt/forms/masternodelist.ui b/src/qt/forms/masternodelist.ui deleted file mode 100755 index 203818eae..000000000 --- a/src/qt/forms/masternodelist.ui +++ /dev/null @@ -1,324 +0,0 @@ - - - MasternodeList - - - - 0 - 0 - 930 - 520 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 0 - - - - My Masternodes - - - - - - 0 - - - - - 0 - - - - - Note: Status of your masternodes in local wallet can potentially be slightly incorrect.<br />Always wait for wallet to sync additional data and then double check from another node<br />if your masternode should be running but you still do not see "ENABLED" in "Status" field. - - - - - - - - - - 695 - 0 - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - - Alias - - - - - Address - - - - - Protocol - - - - - Status - - - - - Active - - - - - Last Seen - - - - - Payee - - - - - - - - 0 - - - - - S&tart alias - - - - - - - Start &all - - - - - - - Start &MISSING - - - - - - - &Update status - - - - - - - Status will be updated automatically in (sec): - - - - - - - 0 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Autostart MISSING - - - - - - - - - - - - All Masternodes - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SelectRows - - - true - - - true - - - - Address - - - - - Protocol - - - - - Status - - - - - Active - - - - - Last Seen - - - - - Payee - - - - - - - - 0 - - - - - Filter List: - - - - - - - Filter masternode list - - - - - - - Qt::Horizontal - - - - 10 - 20 - - - - - - - - Node Count: - - - - - - - 0 - - - - - - - - - - - - - - - - diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 7434c64ab..addca8956 100755 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -138,7 +138,7 @@ <html><head/><body><p>This setting determines the amount of individual masternodes that an input will be anonymized through. More rounds of anonymization gives a higher degree of privacy, but also costs more in fees.</p></body></html> - Perplexion rounds to use + Darksend rounds to use @@ -162,7 +162,7 @@ - This amount acts as a threshold to turn off Perplexion once it's reached. + This amount acts as a threshold to turn off Darksend once it's reached. @@ -201,50 +201,6 @@ - - - &SimpleMint - - - - - - - - &Minting threads: - - - Qt::PlainText - - - comboMiningProcLimit - - - - - - - Choose the default mining threads. - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - W&allet diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index dafc88843..a631d4299 100755 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -336,7 +336,7 @@ - Perplexion Balance: + Darksend Balance: @@ -896,7 +896,7 @@ - Try to manually submit a Perplexion. + Try to manually submit a Darksend request. Try Mix @@ -918,7 +918,7 @@ - Reset the current status of Perplexion (can interrupt Perplexion if it's in the process of Mixing, which can cost you money!) + Reset the current status of Darksend (can interrupt Darksend if it's in the process of Mixing, which can cost you money!) false @@ -946,7 +946,7 @@ - Perplexion + Darksend diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 9d272e494..38bcd2c70 100755 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -7,7 +7,7 @@ 0 0 740 - 596 + 450 @@ -17,7 +17,7 @@ - 2 + 0 @@ -401,7 +401,7 @@ - + :/icons/remove:/icons/remove @@ -666,578 +666,6 @@ - - - &Peers - - - - - - 0 - - - - - Qt::ScrollBarAsNeeded - - - false - - - true - - - false - - - - - - - - 0 - 0 - - - - - 300 - 32 - - - - - 16777215 - 32 - - - - - 12 - - - - IBeamCursor - - - Banned peers - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true - - - Qt::NoTextInteraction - - - - - - - - 0 - 0 - - - - Qt::ScrollBarAsNeeded - - - false - - - true - - - false - - - - - - - - - - 0 - 0 - - - - - 300 - 32 - - - - - 10 - - - - IBeamCursor - - - Select a peer to view detailed information. - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 300 - 0 - - - - - - - Whitelisted - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Direction - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Version - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - User Agent - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Services - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Starting Block - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Synced Headers - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Synced Blocks - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Ban Score - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Connection Time - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Last Send - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Last Receive - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Sent - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Received - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Ping Time - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - The duration of a currently outstanding ping. - - - Ping Wait - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Min Ping - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Time Offset - - - - - - - IBeamCursor - - - N/A - - - Qt::PlainText - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - @@ -1254,7 +682,7 @@ - + diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index c6f079650..fb68202d0 100755 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -613,8 +613,8 @@ 0 0 - 828 - 153 + 824 + 138 @@ -671,7 +671,7 @@ S&end - + :/icons/send:/icons/send @@ -694,7 +694,7 @@ Clear &All - + :/icons/remove:/icons/remove @@ -714,7 +714,7 @@ Add &Recipient - + :/icons/add:/icons/add @@ -749,7 +749,7 @@ - Perplexion + Darksend true @@ -812,7 +812,7 @@ - + diff --git a/src/qt/forms/sendcoinsentry.ui b/src/qt/forms/sendcoinsentry.ui index ec0cc489c..260160633 100755 --- a/src/qt/forms/sendcoinsentry.ui +++ b/src/qt/forms/sendcoinsentry.ui @@ -64,7 +64,7 @@ - + :/icons/address-book:/icons/address-book @@ -81,7 +81,7 @@ - + :/icons/editpaste:/icons/editpaste @@ -98,7 +98,7 @@ - + :/icons/remove:/icons/remove @@ -622,7 +622,7 @@ - + :/icons/remove:/icons/remove @@ -1158,7 +1158,7 @@ - + :/icons/remove:/icons/remove @@ -1230,7 +1230,7 @@ deleteButton_s - + diff --git a/src/qt/forms/signverifymessagedialog.ui b/src/qt/forms/signverifymessagedialog.ui index 057822e86..7e790c033 100755 --- a/src/qt/forms/signverifymessagedialog.ui +++ b/src/qt/forms/signverifymessagedialog.ui @@ -58,7 +58,7 @@ - + :/icons/address-book:/icons/address-book @@ -78,7 +78,7 @@ - + :/icons/editpaste:/icons/editpaste @@ -134,7 +134,7 @@ - + :/icons/editcopy:/icons/editcopy @@ -155,7 +155,7 @@ Sign &Message - + :/icons/edit:/icons/edit @@ -172,7 +172,7 @@ Clear &All - + :/icons/remove:/icons/remove @@ -268,7 +268,7 @@ - + :/icons/address-book:/icons/address-book @@ -298,7 +298,7 @@ Verify &Message - + :/icons/transaction_0:/icons/transaction_0 @@ -315,7 +315,7 @@ Clear &All - + :/icons/remove:/icons/remove @@ -381,7 +381,7 @@ - + diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 0f09e71d3..98c34dfa5 100755 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -103,25 +103,7 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) widget->setValidator(new BitcoinAddressEntryValidator(parent)); widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); } -QString formatDurationStr(int secs) -{ - QStringList strList; - int days = secs / 86400; - int hours = (secs % 86400) / 3600; - int mins = (secs % 3600) / 60; - int seconds = secs % 60; - - if (days) - strList.append(QString(QObject::tr("%1 d")).arg(days)); - if (hours) - strList.append(QString(QObject::tr("%1 h")).arg(hours)); - if (mins) - strList.append(QString(QObject::tr("%1 m")).arg(mins)); - if (seconds || (!days && !hours && !mins)) - strList.append(QString(QObject::tr("%1 s")).arg(seconds)); - return strList.join(" "); -} void setupAmountWidget(QLineEdit *widget, QWidget *parent) { QDoubleValidator *amountValidator = new QDoubleValidator(parent); @@ -523,45 +505,9 @@ void TableViewLastColumnResizingFixer::adjustTableColumnsWidth() resizeColumn(secondToLastColumnIndex,getAvailableWidthForColumn(secondToLastColumnIndex)); } } -QString formatPingTime(double dPingTime) -{ - return dPingTime == 0 ? QObject::tr("N/A") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(dPingTime * 1000), 10)); -} -QString formatServicesStr(quint64 mask) -{ - QStringList strList; - // Just scan the last 8 bits for now. - for (int i = 0; i < 8; i++) { - uint64_t check = 1 << i; - if (mask & check) - { - - strList.append(QString("%1[%2]").arg("UNKNOWN").arg(check)); - - } - } - - if (strList.size()) - return strList.join(" & "); - else - return QObject::tr("None"); -} - -QString getEntryData(QAbstractItemView *view, int column, int role) -{ - if(!view || !view->selectionModel()) - return QString(); - QModelIndexList selection = view->selectionModel()->selectedRows(column); - - if(!selection.isEmpty()) { - // Return first item - return (selection.at(0).data(role).toString()); - } - return QString(); -} // Make column use all the space available, useful during window resizing. -void TableViewLastColumnResizingFixer::stretchColumnWidth(int column) +void TableViewLastColumnResizingFixer::stretITZolumnWidth(int column) { disconnectViewHeadersSignals(); resizeColumn(column, getAvailableWidthForColumn(column)); diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index eba0dd56a..411f99ee2 100755 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -47,15 +47,7 @@ namespace GUIUtil bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); QString formatBitcoinURI(const SendCoinsRecipient &info); - /* Format CNodeStats.nServices bitmask into a user-readable string */ - QString formatServicesStr(quint64 mask); - - /* Convert seconds into a QString with days, hours, mins, secs */ - QString formatDurationStr(int secs); - /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/ - QString formatPingTime(double dPingTime); // Returns true if given address+amount meets "dust" definition - QString getEntryData(QAbstractItemView *view, int column, int role); bool isDust(const QString& address, qint64 amount); // HTML escaping for rich text controls @@ -156,7 +148,7 @@ namespace GUIUtil public: TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth); - void stretchColumnWidth(int column); + void stretITZolumnWidth(int column); private: QTableView* tableView; diff --git a/src/qt/interzonestrings.cpp b/src/qt/interzonestrings.cpp index 8e0d8f0fb..0136afb91 100755 --- a/src/qt/interzonestrings.cpp +++ b/src/qt/interzonestrings.cpp @@ -1,4 +1,4 @@ -Perplexion + // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers @@ -44,15 +44,15 @@ QT_TRANSLATE_NOOP("interzone-core", "" "Continuously rate-limit free transactions to *1000 bytes per minute " "(default:15)"), QT_TRANSLATE_NOOP("interzone-core", "" -"Perplexion uses exact denominated amounts to send funds, you might simply need " +"Darksend uses exact denominated amounts to send funds, you might simply need " "to anonymize some more coins."), QT_TRANSLATE_NOOP("interzone-core", "" -"Disable all Masternode and Perplexion related functionality (0-1, default: 0)"), +"Disable all Masternode and Darksend related functionality (0-1, default: 0)"), QT_TRANSLATE_NOOP("interzone-core", "" "Enable instantx, show confirmations for locked transactions (bool, default: " "true)"), QT_TRANSLATE_NOOP("interzone-core", "" -"Enable use of automated Perplexion for funds stored in this wallet (0-1, " +"Enable use of automated darksend for funds stored in this wallet (0-1, " "default: 0)"), QT_TRANSLATE_NOOP("interzone-core", "" "Enter regression test mode, which uses a special chain in which blocks can " @@ -108,7 +108,7 @@ QT_TRANSLATE_NOOP("interzone-core", "" QT_TRANSLATE_NOOP("interzone-core", "" "Output debugging information (default: 0, supplying is optional)"), QT_TRANSLATE_NOOP("interzone-core", "" -"Provide liquidity to Perplexion by infrequently mixing coins on a continual " +"Provide liquidity to Darksend by infrequently mixing coins on a continual " "basis (0-100, default: 0, 1=very frequent, high fees, 100=very infrequent, " "low fees)"), QT_TRANSLATE_NOOP("interzone-core", "" @@ -134,12 +134,12 @@ QT_TRANSLATE_NOOP("interzone-core", "" "Unable to bind to %s on this computer. Interzone Core is probably already " "running."), QT_TRANSLATE_NOOP("interzone-core", "" -"Unable to locate enough Perplexion denominated funds for this transaction."), +"Unable to locate enough Darksend denominated funds for this transaction."), QT_TRANSLATE_NOOP("interzone-core", "" -"Unable to locate enough Perplexion non-denominated funds for this transaction " +"Unable to locate enough Darksend non-denominated funds for this transaction " "that are not equal 1000 Interzone."), QT_TRANSLATE_NOOP("interzone-core", "" -"Unable to locate enough Perplexion non-denominated funds for this transaction."), +"Unable to locate enough Darksend non-denominated funds for this transaction."), QT_TRANSLATE_NOOP("interzone-core", "" "Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -" "proxy)"), @@ -199,8 +199,8 @@ QT_TRANSLATE_NOOP("interzone-core", "Connection options:"), QT_TRANSLATE_NOOP("interzone-core", "Corrupted block database detected"), QT_TRANSLATE_NOOP("interzone-core", "Interzone Core Daemon"), QT_TRANSLATE_NOOP("interzone-core", "Interzone Core RPC client version"), -QT_TRANSLATE_NOOP("interzone-core", "Perplexion is disabled."), -QT_TRANSLATE_NOOP("interzone-core", "Perplexion options:"), +QT_TRANSLATE_NOOP("interzone-core", "Darksend is disabled."), +QT_TRANSLATE_NOOP("interzone-core", "Darksend options:"), QT_TRANSLATE_NOOP("interzone-core", "Debugging/Testing options:"), QT_TRANSLATE_NOOP("interzone-core", "Disable safemode, override a real safe mode event (default: 0)"), QT_TRANSLATE_NOOP("interzone-core", "Discover own IP address (default: 1 when listening and no -externalip)"), @@ -223,7 +223,7 @@ QT_TRANSLATE_NOOP("interzone-core", "Error recovering public key."), QT_TRANSLATE_NOOP("interzone-core", "Error"), QT_TRANSLATE_NOOP("interzone-core", "Error: Disk space is low!"), QT_TRANSLATE_NOOP("interzone-core", "Error: Wallet locked, unable to create transaction!"), -QT_TRANSLATE_NOOP("interzone-core", "Error: You already have pending entries in the Perplexion pool"), +QT_TRANSLATE_NOOP("interzone-core", "Error: You already have pending entries in the Darksend pool"), QT_TRANSLATE_NOOP("interzone-core", "Error: system error: "), QT_TRANSLATE_NOOP("interzone-core", "Failed to listen on any port. Use -listen=0 if you want this."), QT_TRANSLATE_NOOP("interzone-core", "Failed to read block info"), @@ -269,8 +269,8 @@ QT_TRANSLATE_NOOP("interzone-core", "KeePassHttp key for AES encrypted communica QT_TRANSLATE_NOOP("interzone-core", "Keep N interzone anonymized (default: 0)"), QT_TRANSLATE_NOOP("interzone-core", "Keep at most unconnectable blocks in memory (default: %u)"), QT_TRANSLATE_NOOP("interzone-core", "Keep at most unconnectable transactions in memory (default: %u)"), -QT_TRANSLATE_NOOP("interzone-core", "Last Perplexion was too recent."), -QT_TRANSLATE_NOOP("interzone-core", "Last successful Perplexion action was too recent."), +QT_TRANSLATE_NOOP("interzone-core", "Last Darksend was too recent."), +QT_TRANSLATE_NOOP("interzone-core", "Last successful darksend action was too recent."), QT_TRANSLATE_NOOP("interzone-core", "Limit size of signature cache to entries (default: 50000)"), QT_TRANSLATE_NOOP("interzone-core", "List commands"), QT_TRANSLATE_NOOP("interzone-core", "Listen for connections on (default: 9999 or testnet: 19999)"), @@ -371,7 +371,7 @@ QT_TRANSLATE_NOOP("interzone-core", "Use UPnP to map the listening port (default QT_TRANSLATE_NOOP("interzone-core", "Use UPnP to map the listening port (default: 1 when listening)"), QT_TRANSLATE_NOOP("interzone-core", "Use the test network"), QT_TRANSLATE_NOOP("interzone-core", "Username for JSON-RPC connections"), -QT_TRANSLATE_NOOP("interzone-core", "Value more than Perplexion pool maximum allows."), +QT_TRANSLATE_NOOP("interzone-core", "Value more than Darksend pool maximum allows."), QT_TRANSLATE_NOOP("interzone-core", "Verifying blocks..."), QT_TRANSLATE_NOOP("interzone-core", "Verifying wallet..."), QT_TRANSLATE_NOOP("interzone-core", "Wait for RPC server to start"), diff --git a/src/qt/masternodelist.cpp b/src/qt/masternodelist.cpp deleted file mode 100755 index bf4da9d0d..000000000 --- a/src/qt/masternodelist.cpp +++ /dev/null @@ -1,456 +0,0 @@ -#include "masternodelist.h" -#include "ui_masternodelist.h" - -#include "activemasternode.h" -#include "clientmodel.h" -#include "init.h" -#include "guiutil.h" -//#include "masternode-sync.h" -#include "masternodeconfig.h" -#include "../masternodeman.h" -#include "sync.h" -#include "wallet.h" -#include "walletmodel.h" - -#include -#include -#include - -MasternodeList::MasternodeList(QWidget *parent) : - QWidget(parent), - ui(new Ui::MasternodeList), - clientModel(0), - walletModel(0) -{ - ui->setupUi(this); - - ui->startButton->setEnabled(false); - - int columnAliasWidth = 100; - int columnAddressWidth = 200; - int columnProtocolWidth = 60; - int columnStatusWidth = 80; - int columnActiveWidth = 130; - int columnLastSeenWidth = 130; - - ui->tableWidgetMyMasternodes->setColumnWidth(0, columnAliasWidth); - ui->tableWidgetMyMasternodes->setColumnWidth(1, columnAddressWidth); - ui->tableWidgetMyMasternodes->setColumnWidth(2, columnProtocolWidth); - ui->tableWidgetMyMasternodes->setColumnWidth(3, columnStatusWidth); - ui->tableWidgetMyMasternodes->setColumnWidth(4, columnActiveWidth); - ui->tableWidgetMyMasternodes->setColumnWidth(5, columnLastSeenWidth); - - ui->tableWidgetMasternodes->setColumnWidth(0, columnAddressWidth); - ui->tableWidgetMasternodes->setColumnWidth(1, columnProtocolWidth); - ui->tableWidgetMasternodes->setColumnWidth(2, columnStatusWidth); - ui->tableWidgetMasternodes->setColumnWidth(3, columnActiveWidth); - ui->tableWidgetMasternodes->setColumnWidth(4, columnLastSeenWidth); - - ui->tableWidgetMyMasternodes->setContextMenuPolicy(Qt::CustomContextMenu); - - QAction *startAliasAction = new QAction(tr("Start alias"), this); - contextMenu = new QMenu(); - contextMenu->addAction(startAliasAction); - connect(ui->tableWidgetMyMasternodes, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); - connect(startAliasAction, SIGNAL(triggered()), this, SLOT(on_startButton_clicked())); - - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(updateNodeList())); - connect(timer, SIGNAL(timeout()), this, SLOT(updateMyNodeList())); - - timer->start(1000); - - fFilterUpdated = false; - nTimeFilterUpdated = GetTime(); - updateNodeList(); -} - -MasternodeList::~MasternodeList() -{ - delete ui; -} -static bool ParsePrechecks(const std::string& str) -{ - if (str.empty()) // No empty string allowed - return false; - if (str.size() >= 1 && (isspace(str[0]) || isspace(str[str.size()-1]))) // No padding allowed - return false; - if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed - return false; - return true; -} - -static bool ParseInt32(const std::string& str, int32_t *out) -{ - if (!ParsePrechecks(str)) - return false; - char *endp = NULL; - errno = 0; // strtol will not set errno if valid - long int n = strtol(str.c_str(), &endp, 10); - if(out) *out = (int32_t)n; - // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow - // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit - // platforms the size of these types may be different. - return endp && *endp == 0 && !errno && - n >= std::numeric_limits::min() && - n <= std::numeric_limits::max(); -} -void MasternodeList::setClientModel(ClientModel *model) -{ - this->clientModel = model; - if(model) { - // try to update list when masternode count changes - connect(clientModel, SIGNAL(strMasternodesChanged(QString)), this, SLOT(updateNodeList())); - } -} - -void MasternodeList::setWalletModel(WalletModel *model) -{ - this->walletModel = model; -} - -void MasternodeList::showContextMenu(const QPoint &point) -{ - QTableWidgetItem *item = ui->tableWidgetMyMasternodes->itemAt(point); - if(item) contextMenu->exec(QCursor::pos()); -} - -void MasternodeList::StartAlias(std::string strAlias) -{ - std::string strStatusHtml; - strStatusHtml += "
Alias: " + strAlias; - - BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { - if(mne.getAlias() == strAlias) { - std::string strError; - - std::string strDonateAddress = mne.getDonationAddress(); - std::string strDonationPercentage = mne.getDonationPercentage(); - - bool result = activeMasternode.Register(mne.getIp(), mne.getPrivKey(), mne.getTxHash(), mne.getOutputIndex(), strDonateAddress, strDonationPercentage, strError); - - if(result) { - strStatusHtml += "
Successfully started masternode."; - } else { - strStatusHtml += "
Failed to start masternode.
Error: " + strError; - } - break; - } - } - strStatusHtml += "
"; - - QMessageBox msg; - msg.setText(QString::fromStdString(strStatusHtml)); - msg.exec(); - - updateMyNodeList(true); -} - -void MasternodeList::StartAll(std::string strCommand) -{ - int nCountSuccessful = 0; - int nCountFailed = 0; - std::string strFailedHtml; - - BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { - std::string strError; - std::string strDonateAddress = mne.getDonationAddress(); - std::string strDonationPercentage = mne.getDonationPercentage(); - - CTxIn txin = CTxIn(uint256(ParseHex(mne.getTxHash())), QString::fromStdString(mne.getOutputIndex()).toInt()); - if(strCommand == "start-missing" && mnodeman.Find(txin)) continue; - - bool result = activeMasternode.Register(mne.getIp(), mne.getPrivKey(), mne.getTxHash(), mne.getOutputIndex(), strDonateAddress, strDonationPercentage, strError); - - if(result) { - nCountSuccessful++; - } else { - nCountFailed++; - strFailedHtml += "\nFailed to start " + mne.getAlias() + ". Error: " + strError; - } - } - pwalletMain->Lock(); - - std::string returnObj; - returnObj = strprintf("Successfully started %d masternodes, failed to start %d, total %d", nCountSuccessful, nCountFailed, nCountFailed + nCountSuccessful); - if (nCountFailed > 0) { - returnObj += strFailedHtml; - } - - QMessageBox msg; - msg.setText(QString::fromStdString(returnObj)); - msg.exec(); - - updateMyNodeList(true); -} - -void MasternodeList::updateMyMasternodeInfo(QString strAlias, QString strAddr,CMasternode* infoMn) -{ - bool fOldRowFound = false; - int nNewRow = 0; - - for(int i = 0; i < ui->tableWidgetMyMasternodes->rowCount(); i++) { - if(ui->tableWidgetMyMasternodes->item(i, 0)->text() == strAlias) { - fOldRowFound = true; - nNewRow = i; - break; - } - } - - if(nNewRow == 0 && !fOldRowFound) { - nNewRow = ui->tableWidgetMyMasternodes->rowCount(); - ui->tableWidgetMyMasternodes->insertRow(nNewRow); - } - - QTableWidgetItem *aliasItem = new QTableWidgetItem(strAlias); - QTableWidgetItem *addrItem = new QTableWidgetItem(strAddr); - QTableWidgetItem *protocolItem; - QTableWidgetItem *statusItem; - QTableWidgetItem *activeSecondsItem; - QTableWidgetItem *lastSeenItem; - QTableWidgetItem *pubkeyItem; - - if (infoMn == NULL) - { - protocolItem = new QTableWidgetItem(QString::number(0)); - statusItem = new QTableWidgetItem(QString("")); - activeSecondsItem = new QTableWidgetItem(QString("")); - lastSeenItem = new QTableWidgetItem(QString("")); - pubkeyItem = new QTableWidgetItem(QString("")); - } - else - { - protocolItem = new QTableWidgetItem(QString::number(infoMn->protocolVersion)); - statusItem = new QTableWidgetItem(QString::fromStdString(infoMn->Status())); - activeSecondsItem = new QTableWidgetItem(QString::fromStdString(DurationToDHMS(infoMn->lastTimeSeen - infoMn->sigTime))); - lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M", - infoMn->sigTime + QDateTime::currentDateTime().utcOffset()))); - pubkeyItem = new QTableWidgetItem(QString::fromStdString(CBitcoinAddress(infoMn->pubkey.GetID()).ToString())); - } - - ui->tableWidgetMyMasternodes->setItem(nNewRow, 0, aliasItem); - ui->tableWidgetMyMasternodes->setItem(nNewRow, 1, addrItem); - ui->tableWidgetMyMasternodes->setItem(nNewRow, 2, protocolItem); - ui->tableWidgetMyMasternodes->setItem(nNewRow, 3, statusItem); - ui->tableWidgetMyMasternodes->setItem(nNewRow, 4, activeSecondsItem); - ui->tableWidgetMyMasternodes->setItem(nNewRow, 5, lastSeenItem); - ui->tableWidgetMyMasternodes->setItem(nNewRow, 6, pubkeyItem); -} - -void MasternodeList::updateMyNodeList(bool fForce) -{ - TRY_LOCK(cs_mymnlist, fLockAcquired); - if(!fLockAcquired) { - return; - } - static int64_t nTimeMyListUpdated = 0; - - // automatically update my masternode list only once in MY_MASTERNODELIST_UPDATE_SECONDS seconds, - // this update still can be triggered manually at any time via button click - int64_t nSecondsTillUpdate = nTimeMyListUpdated + MY_MASTERNODELIST_UPDATE_SECONDS - GetTime(); - ui->secondsLabel->setText(QString::number(nSecondsTillUpdate)); - - if(nSecondsTillUpdate > 0 && !fForce) return; - nTimeMyListUpdated = GetTime(); - ui->tableWidgetMasternodes->setSortingEnabled(false); - - BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { - int32_t nOutputIndex = 0; - if(!ParseInt32(mne.getOutputIndex(), &nOutputIndex)) { - continue; - } - - CTxIn txin = CTxIn(uint256(mne.getTxHash()), nOutputIndex); - - CMasternode *infoMn = mnodeman.Find(txin); - if (!infoMn && bAutostartMissing) { - StartAll("start-missing"); - return; - } - - updateMyMasternodeInfo(QString::fromStdString(mne.getAlias()), QString::fromStdString(mne.getIp()), infoMn); - } - ui->tableWidgetMasternodes->setSortingEnabled(true); - - // reset "timer" - ui->secondsLabel->setText("0"); -} - -void MasternodeList::updateNodeList() -{ - TRY_LOCK(cs_mnlist, fLockAcquired); - if(!fLockAcquired) { - return; - } - - static int64_t nTimeListUpdated = GetTime(); - - // to prevent high cpu usage update only once in MASTERNODELIST_UPDATE_SECONDS seconds - // or MASTERNODELIST_FILTER_COOLDOWN_SECONDS seconds after filter was last changed - int64_t nSecondsToWait = fFilterUpdated - ? nTimeFilterUpdated - GetTime() + MASTERNODELIST_FILTER_COOLDOWN_SECONDS - : nTimeListUpdated - GetTime() + MASTERNODELIST_UPDATE_SECONDS; - - if(fFilterUpdated) ui->countLabel->setText(QString::fromStdString(strprintf("Please wait... %d", nSecondsToWait))); - if(nSecondsToWait > 0) return; - - nTimeListUpdated = GetTime(); - fFilterUpdated = false; - - QString strToFilter; - ui->countLabel->setText("Updating..."); - ui->tableWidgetMasternodes->setSortingEnabled(false); - ui->tableWidgetMasternodes->clearContents(); - ui->tableWidgetMasternodes->setRowCount(0); - std::vector vMasternodes = mnodeman.GetFullMasternodeVector(); - - BOOST_FOREACH(CMasternode& mn, vMasternodes) - { - // populate list - // Address, Protocol, Status, Active Seconds, Last Seen, Pub Key - QTableWidgetItem *addressItem = new QTableWidgetItem(QString::fromStdString(mn.addr.ToString())); - QTableWidgetItem *protocolItem = new QTableWidgetItem(QString::number(mn.protocolVersion)); - QTableWidgetItem *statusItem = new QTableWidgetItem(QString::fromStdString(mn.Status())); - QTableWidgetItem *activeSecondsItem = new QTableWidgetItem(QString::fromStdString(DurationToDHMS(mn.lastTimeSeen - mn.sigTime))); - QTableWidgetItem *lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M", mn.lastTimeSeen + QDateTime::currentDateTime().utcOffset()))); - QTableWidgetItem *pubkeyItem = new QTableWidgetItem(QString::fromStdString(CBitcoinAddress(mn.pubkey.GetID()).ToString())); - - if (strCurrentFilter != "") - { - strToFilter = addressItem->text() + " " + - protocolItem->text() + " " + - statusItem->text() + " " + - activeSecondsItem->text() + " " + - lastSeenItem->text() + " " + - pubkeyItem->text(); - if (!strToFilter.contains(strCurrentFilter)) continue; - } - - ui->tableWidgetMasternodes->insertRow(0); - ui->tableWidgetMasternodes->setItem(0, 0, addressItem); - ui->tableWidgetMasternodes->setItem(0, 1, protocolItem); - ui->tableWidgetMasternodes->setItem(0, 2, statusItem); - ui->tableWidgetMasternodes->setItem(0, 3, activeSecondsItem); - ui->tableWidgetMasternodes->setItem(0, 4, lastSeenItem); - ui->tableWidgetMasternodes->setItem(0, 5, pubkeyItem); - } - - ui->countLabel->setText(QString::number(ui->tableWidgetMasternodes->rowCount())); - ui->tableWidgetMasternodes->setSortingEnabled(true); -} - -void MasternodeList::on_filterLineEdit_textChanged(const QString &strFilterIn) -{ - strCurrentFilter = strFilterIn; - nTimeFilterUpdated = GetTime(); - fFilterUpdated = true; - ui->countLabel->setText(QString::fromStdString(strprintf("Please wait... %d", MASTERNODELIST_FILTER_COOLDOWN_SECONDS))); -} - -void MasternodeList::on_startButton_clicked() -{ - std::string strAlias; - { - LOCK(cs_mymnlist); - // Find selected node alias - QItemSelectionModel* selectionModel = ui->tableWidgetMyMasternodes->selectionModel(); - QModelIndexList selected = selectionModel->selectedRows(); - - if(selected.count() == 0) return; - - QModelIndex index = selected.at(0); - int nSelectedRow = index.row(); - strAlias = ui->tableWidgetMyMasternodes->item(nSelectedRow, 0)->text().toStdString(); - } - - // Display message box - QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm masternode start"), - tr("Are you sure you want to start masternode %1?").arg(QString::fromStdString(strAlias)), - QMessageBox::Yes | QMessageBox::Cancel, - QMessageBox::Cancel); - - if(retval != QMessageBox::Yes) return; - - WalletModel::EncryptionStatus encStatus = walletModel->getEncryptionStatus(); - if(encStatus == walletModel->Locked || encStatus == walletModel->UnlockedForAnonymizationOnly){ - WalletModel::UnlockContext ctx(walletModel->requestUnlock(true)); - - if(!ctx.isValid()) return; // Unlock wallet was cancelled - - StartAlias(strAlias); - return; - } - - StartAlias(strAlias); -} - -void MasternodeList::on_startAllButton_clicked() -{ - // Display message box - QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm all masternodes start"), - tr("Are you sure you want to start ALL masternodes?"), - QMessageBox::Yes | QMessageBox::Cancel, - QMessageBox::Cancel); - - if(retval != QMessageBox::Yes) return; - - WalletModel::EncryptionStatus encStatus = walletModel->getEncryptionStatus(); - if(encStatus == walletModel->Locked || encStatus == walletModel->UnlockedForAnonymizationOnly){ - WalletModel::UnlockContext ctx(walletModel->requestUnlock(true)); - - if(!ctx.isValid()) return; // Unlock wallet was cancelled - - StartAll(); - return; - } - - StartAll(); -} - -void MasternodeList::on_startMissingButton_clicked() -{ - -// if(!masternodeSync.IsMasternodeListSynced()) { -// QMessageBox::critical(this, tr("Command is not available right now"), -// tr("You can't use this command until masternode list is synced")); -// return; -// } - - // Display message box - QMessageBox::StandardButton retval = QMessageBox::question(this, - tr("Confirm missing masternodes start"), - tr("Are you sure you want to start MISSING masternodes?"), - QMessageBox::Yes | QMessageBox::Cancel, - QMessageBox::Cancel); - - if(retval != QMessageBox::Yes) return; - - WalletModel::EncryptionStatus encStatus = walletModel->getEncryptionStatus(); - if(encStatus == walletModel->Locked || encStatus == walletModel->UnlockedForAnonymizationOnly){ - WalletModel::UnlockContext ctx(walletModel->requestUnlock(true)); - - if(!ctx.isValid()) return; // Unlock wallet was cancelled - - StartAll("start-missing"); - return; - } - - StartAll("start-missing"); -} - -void MasternodeList::on_tableWidgetMyMasternodes_itemSelectionChanged() -{ - if(ui->tableWidgetMyMasternodes->selectedItems().count() > 0) { - ui->startButton->setEnabled(true); - } -} - -void MasternodeList::on_UpdateButton_clicked() -{ - updateMyNodeList(true); -} - -void MasternodeList::on_cbxAutoStartMissingMNs_stateChanged(int arg1) -{ - this->bAutostartMissing = ui->cbxAutoStartMissingMNs->isChecked(); -} diff --git a/src/qt/masternodelist.h b/src/qt/masternodelist.h deleted file mode 100755 index beeedebc6..000000000 --- a/src/qt/masternodelist.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef MASTERNODELIST_H -#define MASTERNODELIST_H - -#include "../masternode.h" -#include "sync.h" -#include "util.h" - -#include -#include -#include -#include - -#define MY_MASTERNODELIST_UPDATE_SECONDS 60 -#define MASTERNODELIST_UPDATE_SECONDS 15 -#define MASTERNODELIST_FILTER_COOLDOWN_SECONDS 3 - -namespace Ui { - class MasternodeList; -} - -class ClientModel; -class WalletModel; - -QT_BEGIN_NAMESPACE -class QModelIndex; -QT_END_NAMESPACE - -/** Masternode Manager page widget */ -class MasternodeList : public QWidget -{ - Q_OBJECT - -public: - explicit MasternodeList(QWidget *parent = 0); - ~MasternodeList(); - - void setClientModel(ClientModel *clientModel); - void setWalletModel(WalletModel *walletModel); - void StartAlias(std::string strAlias); - void StartAll(std::string strCommand = "start-all"); - -private: - QMenu *contextMenu; - int64_t nTimeFilterUpdated; - bool fFilterUpdated; - bool bAutostartMissing = false; - -public Q_SLOTS: - void updateMyMasternodeInfo(QString strAlias, QString strAddr, CMasternode *info); - void updateMyNodeList(bool fForce = false); - void updateNodeList(); - -Q_SIGNALS: - -private: - QTimer *timer; - Ui::MasternodeList *ui; - ClientModel *clientModel; - WalletModel *walletModel; - - // Protects tableWidgetMasternodes - CCriticalSection cs_mnlist; - - // Protects tableWidgetMyMasternodes - CCriticalSection cs_mymnlist; - - QString strCurrentFilter; - -private Q_SLOTS: - void showContextMenu(const QPoint &); - void on_filterLineEdit_textChanged(const QString &strFilterIn); - void on_startButton_clicked(); - void on_startAllButton_clicked(); - void on_startMissingButton_clicked(); - void on_tableWidgetMyMasternodes_itemSelectionChanged(); - void on_UpdateButton_clicked(); - void on_cbxAutoStartMissingMNs_stateChanged(int arg1); -}; -#endif // MASTERNODELIST_H diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 04915da69..efbd0ffcb 100755 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -110,16 +110,6 @@ OptionsDialog::OptionsDialog(QWidget *parent) : ui->unit->setModel(new BitcoinUnits(this)); ui->transactionFee->setSingleStep(CTransaction::nMinTxFee); - - /* Mining tab */ - ui->comboMiningProcLimit->setEnabled(true); - ui->comboMiningProcLimit->addItem("Disabled", 0); - ui->comboMiningProcLimit->addItem("1 thread", 1); - ui->comboMiningProcLimit->addItem("2 threads", 2); - ui->comboMiningProcLimit->addItem("3 threads", 3); - ui->comboMiningProcLimit->addItem("4 threads", 4); - ui->comboMiningProcLimit->addItem("Maximum", -1); - ui->comboMiningProcLimit->setCurrentIndex(1); /* Widget-to-option mapper */ mapper = new MonitoredDataMapper(this); @@ -183,8 +173,6 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif); mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache); - mapper->addMapping(ui->comboMiningProcLimit, OptionsModel::MiningIntensity); - /* Wallet */ mapper->addMapping(ui->transactionFee, OptionsModel::Fee); mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 9ad6cc677..b350b3460 100755 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -113,9 +113,7 @@ void OptionsModel::Init() if (!SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool())) addOverriddenOption("-spendzeroconfchange"); #endif - // Mining - if (!settings.contains("nMiningIntensity")) - settings.setValue("bMiningIntensity", 1); + // Network if (!settings.contains("fUseUPnP")) #ifdef USE_UPNP @@ -146,20 +144,7 @@ void OptionsModel::Init() settings.setValue("language", ""); if (!SoftSetArg("-lang", settings.value("language").toString().toStdString())) addOverriddenOption("-lang"); - - // Mining options - if (settings.contains("nMiningIntensity")) - { - int nMiningIntensity = settings.value("nMiningIntensity").toInt(); - if (nMiningIntensity != 0) - { - SoftSetArg("-gen", "1"); - SoftSetArg("-genproclimit", settings.value("nMiningIntensity").toString().toStdString()); - addOverriddenOption("-gen"); - addOverriddenOption("-genproclimit"); - } - } - + if (settings.contains("nDarksendRounds")) SoftSetArg("-darksendrounds", settings.value("nDarksendRounds").toString().toStdString()); if (settings.contains("nAnonymizeDarkcoinAmount")) @@ -251,8 +236,6 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("nDatabaseCache"); case ThreadsScriptVerif: return settings.value("nThreadsScriptVerif"); - case MiningIntensity: - return settings.value("nMiningIntensity"); case DarksendRounds: return QVariant(nDarksendRounds); case AnonymizeDarkcoinAmount: @@ -296,13 +279,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in setRestartRequired(true); } break; - - case MiningIntensity: - if (settings.value("nMiningIntensity") != value.toInt()) { - settings.setValue("nMiningIntensity", value.toInt()); - setRestartRequired(true); - } - case ProxyIP: { // contains current IP at index 0 and current port at index 1 QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 5426382f2..f410c2c79 100755 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -43,7 +43,6 @@ class OptionsModel : public QAbstractListModel ThreadsScriptVerif, // int DatabaseCache, // int SpendZeroConfChange, // bool - MiningIntensity, // int DarksendRounds, // int AnonymizeDarkcoinAmount, //int OptionIDRowCount, @@ -64,8 +63,6 @@ class OptionsModel : public QAbstractListModel QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; } bool getProxySettings(QNetworkProxy& proxy) const; bool getCoinControlFeatures() { return fCoinControlFeatures; } - bool bMiningEnabled; - int nMiningIntensity; const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; } /* Restart flag helper */ diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp deleted file mode 100755 index 1a821b019..000000000 --- a/src/qt/peertablemodel.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) 2011-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "peertablemodel.h" - -#include "clientmodel.h" -#include "guiconstants.h" -#include "guiutil.h" - -#include "sync.h" - -#include -#include -#include - -bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const -{ - const CNodeStats *pLeft = &(left.nodeStats); - const CNodeStats *pRight = &(right.nodeStats); - - if (order == Qt::DescendingOrder) - std::swap(pLeft, pRight); - - switch(column) - { - case PeerTableModel::Address: - return pLeft->addrName.compare(pRight->addrName) < 0; - case PeerTableModel::Subversion: - return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0; - case PeerTableModel::Ping: - return pLeft->dPingTime < pRight->dPingTime; - } - - return false; -} - -// private implementation -class PeerTablePriv -{ -public: - /** Local cache of peer information */ - QList cachedNodeStats; - /** Column to sort nodes by */ - int sortColumn; - /** Order (ascending or descending) to sort nodes by */ - Qt::SortOrder sortOrder; - /** Index of rows by node ID */ - std::map mapNodeRows; - - /** Pull a full list of peers from vNodes into our cache */ - void refreshPeers() - { - { - TRY_LOCK(cs_vNodes, lockNodes); - if (!lockNodes) - { - // skip the refresh if we can't immediately get the lock - return; - } - cachedNodeStats.clear(); -#if QT_VERSION >= 0x040700 - cachedNodeStats.reserve(vNodes.size()); -#endif - Q_FOREACH (CNode* pnode, vNodes) - { - CNodeCombinedStats stats; - stats.nodeStateStats.nMisbehavior = 0; -// stats.nodeStateStats.nSyncHeight = -1; -// stats.nodeStateStats.nCommonHeight = -1; - stats.fNodeStateStatsAvailable = false; - pnode->copyStats(stats.nodeStats); - cachedNodeStats.append(stats); - } - } - - // Try to retrieve the CNodeStateStats for each node. - { - TRY_LOCK(cs_main, lockMain); - if (lockMain) - { - BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) - stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats); - } - } - - if (sortColumn >= 0) - // sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily) - qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder)); - - // build index map - mapNodeRows.clear(); - int row = 0; - Q_FOREACH (const CNodeCombinedStats& stats, cachedNodeStats) - mapNodeRows.insert(std::pair(stats.nodeStats.nodeid, row++)); - } - - int size() const - { - return cachedNodeStats.size(); - } - - CNodeCombinedStats *index(int idx) - { - if (idx >= 0 && idx < cachedNodeStats.size()) - return &cachedNodeStats[idx]; - - return 0; - } -}; - -PeerTableModel::PeerTableModel(ClientModel *parent) : - QAbstractTableModel(parent), - clientModel(parent), - timer(0) -{ - columns << tr("Node/Service") << tr("User Agent") << tr("Ping Time"); - priv = new PeerTablePriv(); - // default to unsorted - priv->sortColumn = -1; - - // set up timer for auto refresh - timer = new QTimer(); - connect(timer, SIGNAL(timeout()), SLOT(refresh())); - timer->setInterval(MODEL_UPDATE_DELAY); - - // load initial data - refresh(); -} - -void PeerTableModel::startAutoRefresh() -{ - timer->start(); -} - -void PeerTableModel::stopAutoRefresh() -{ - timer->stop(); -} - -int PeerTableModel::rowCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent); - return priv->size(); -} - -int PeerTableModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent); - return columns.length(); -} - -QVariant PeerTableModel::data(const QModelIndex &index, int role) const -{ - if(!index.isValid()) - return QVariant(); - - CNodeCombinedStats *rec = static_cast(index.internalPointer()); - - if (role == Qt::DisplayRole) { - switch(index.column()) - { - case Address: - return QString::fromStdString(rec->nodeStats.addrName); - case Subversion: - return QString::fromStdString(rec->nodeStats.cleanSubVer); - case Ping: - return GUIUtil::formatPingTime(rec->nodeStats.dPingTime); - } - } else if (role == Qt::TextAlignmentRole) { - if (index.column() == Ping) - return (QVariant)(Qt::AlignRight | Qt::AlignVCenter); - } - - return QVariant(); -} - -QVariant PeerTableModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if(orientation == Qt::Horizontal) - { - if(role == Qt::DisplayRole && section < columns.size()) - { - return columns[section]; - } - } - return QVariant(); -} - -Qt::ItemFlags PeerTableModel::flags(const QModelIndex &index) const -{ - if(!index.isValid()) - return 0; - - Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; - return retval; -} - -QModelIndex PeerTableModel::index(int row, int column, const QModelIndex &parent) const -{ - Q_UNUSED(parent); - CNodeCombinedStats *data = priv->index(row); - - if (data) - return createIndex(row, column, data); - return QModelIndex(); -} - -const CNodeCombinedStats *PeerTableModel::getNodeStats(int idx) -{ - return priv->index(idx); -} - -void PeerTableModel::refresh() -{ - Q_EMIT layoutAboutToBeChanged(); - priv->refreshPeers(); - Q_EMIT layoutChanged(); -} - -int PeerTableModel::getRowByNodeId(NodeId nodeid) -{ - std::map::iterator it = priv->mapNodeRows.find(nodeid); - if (it == priv->mapNodeRows.end()) - return -1; - - return it->second; -} - -void PeerTableModel::sort(int column, Qt::SortOrder order) -{ - priv->sortColumn = column; - priv->sortOrder = order; - refresh(); -} diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h deleted file mode 100755 index a2aaaa5d2..000000000 --- a/src/qt/peertablemodel.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2011-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_QT_PEERTABLEMODEL_H -#define BITCOIN_QT_PEERTABLEMODEL_H - -#include "main.h" // For CNodeStateStats -#include "net.h" - -#include -#include - -class ClientModel; -class PeerTablePriv; - -QT_BEGIN_NAMESPACE -class QTimer; -QT_END_NAMESPACE - -struct CNodeCombinedStats { - CNodeStats nodeStats; - CNodeStateStats nodeStateStats; - bool fNodeStateStatsAvailable; -}; - -class NodeLessThan -{ -public: - NodeLessThan(int nColumn, Qt::SortOrder fOrder) : - column(nColumn), order(fOrder) {} - bool operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const; - -private: - int column; - Qt::SortOrder order; -}; - -/** - Qt model providing information about connected peers, similar to the - "getpeerinfo" RPC call. Used by the rpc console UI. - */ -class PeerTableModel : public QAbstractTableModel -{ - Q_OBJECT - -public: - explicit PeerTableModel(ClientModel *parent = 0); - const CNodeCombinedStats *getNodeStats(int idx); - int getRowByNodeId(NodeId nodeid); - void startAutoRefresh(); - void stopAutoRefresh(); - - enum ColumnIndex { - Address = 0, - Subversion = 1, - Ping = 2 - }; - - /** @name Methods overridden from QAbstractTableModel - @{*/ - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QModelIndex index(int row, int column, const QModelIndex &parent) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - void sort(int column, Qt::SortOrder order); - /*@}*/ - -public Q_SLOTS: - void refresh(); - -private: - ClientModel *clientModel; - QStringList columns; - PeerTablePriv *priv; - QTimer *timer; -}; - -#endif // BITCOIN_QT_PEERTABLEMODEL_H diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index f2c76c835..169883813 100755 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -202,7 +202,7 @@ void ReceiveCoinsDialog::on_removeRequestButton_clicked() void ReceiveCoinsDialog::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); - columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message); + columnResizingFixer->stretITZolumnWidth(RecentRequestsTableModel::Message); } void ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event) diff --git a/src/qt/res/interzone-qt-res.rc b/src/qt/res/interzone-qt-res.rc old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-000.png b/src/qt/res/movies/spinner-000.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-001.png b/src/qt/res/movies/spinner-001.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-002.png b/src/qt/res/movies/spinner-002.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-003.png b/src/qt/res/movies/spinner-003.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-004.png b/src/qt/res/movies/spinner-004.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-005.png b/src/qt/res/movies/spinner-005.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-006.png b/src/qt/res/movies/spinner-006.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-007.png b/src/qt/res/movies/spinner-007.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-008.png b/src/qt/res/movies/spinner-008.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-009.png b/src/qt/res/movies/spinner-009.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-010.png b/src/qt/res/movies/spinner-010.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-011.png b/src/qt/res/movies/spinner-011.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-012.png b/src/qt/res/movies/spinner-012.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-013.png b/src/qt/res/movies/spinner-013.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-014.png b/src/qt/res/movies/spinner-014.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-015.png b/src/qt/res/movies/spinner-015.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-016.png b/src/qt/res/movies/spinner-016.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-017.png b/src/qt/res/movies/spinner-017.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-018.png b/src/qt/res/movies/spinner-018.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-019.png b/src/qt/res/movies/spinner-019.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-020.png b/src/qt/res/movies/spinner-020.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-021.png b/src/qt/res/movies/spinner-021.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-022.png b/src/qt/res/movies/spinner-022.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-023.png b/src/qt/res/movies/spinner-023.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-024.png b/src/qt/res/movies/spinner-024.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-025.png b/src/qt/res/movies/spinner-025.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-026.png b/src/qt/res/movies/spinner-026.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-027.png b/src/qt/res/movies/spinner-027.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-028.png b/src/qt/res/movies/spinner-028.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-029.png b/src/qt/res/movies/spinner-029.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-030.png b/src/qt/res/movies/spinner-030.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-031.png b/src/qt/res/movies/spinner-031.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-032.png b/src/qt/res/movies/spinner-032.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-033.png b/src/qt/res/movies/spinner-033.png old mode 100644 new mode 100755 diff --git a/src/qt/res/movies/spinner-034.png b/src/qt/res/movies/spinner-034.png old mode 100644 new mode 100755 diff --git a/src/qt/res/src/bitcoin.svg b/src/qt/res/src/bitcoin.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/clock1.svg b/src/qt/res/src/clock1.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/clock2.svg b/src/qt/res/src/clock2.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/clock3.svg b/src/qt/res/src/clock3.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/clock4.svg b/src/qt/res/src/clock4.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/clock5.svg b/src/qt/res/src/clock5.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/clock_green.svg b/src/qt/res/src/clock_green.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/inout.svg b/src/qt/res/src/inout.svg old mode 100644 new mode 100755 diff --git a/src/qt/res/src/questionmark.svg b/src/qt/res/src/questionmark.svg old mode 100644 new mode 100755 diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index c570f9075..1c9d382c2 100755 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -9,15 +9,8 @@ #include "clientmodel.h" #include "guiutil.h" -#include "bantablemodel.h" -#include "peertablemodel.h" -#include - -#include "chainparams.h" #include "rpcserver.h" #include "rpcclient.h" -#include "util.h" - #include "json/json_spirit_value.h" #include @@ -201,8 +194,7 @@ RPCConsole::RPCConsole(QWidget *parent) : QDialog(parent), ui(new Ui::RPCConsole), clientModel(0), - historyPtr(0), - peersTableContextMenu(0) + historyPtr(0) { ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); @@ -270,55 +262,12 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event) return QDialog::eventFilter(obj, event); } - -//void RPCConsole::setClientModel(ClientModel *model) -//{ -// clientModel = model; -// ui->trafficGraph->setClientModel(model); -// if(model) -// { -// // Keep up to date with client -// setNumConnections(model->getNumConnections()); -// connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); - -// setNumBlocks(model->getNumBlocks()); -// connect(model, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int))); - -// setMasternodeCount(model->getMasternodeCountString()); -// connect(model, SIGNAL(strMasternodesChanged(QString)), this, SLOT(setMasternodeCount(QString))); - -// updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent()); -// connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64))); - - -// // peer table signal handling - update peer details when selecting new node -// connect(ui->peerWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), -// this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); - - - -//// Provide initial values -// ui->clientVersion->setText(model->formatFullVersion()); -// ui->clientName->setText(model->clientName()); -// ui->buildDate->setText(model->formatBuildDate()); -// ui->startupTime->setText(model->formatClientStartupTime()); - -// ui->networkName->setText(model->getNetworkName()); -// } -//} - -//void RPCConsole::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers) -//{ -// if (!headers) { -// ui->numberOfBlocks->setText(QString::number(count)); -// ui->lastBlockTime->setText(blockDate.toString()); -// } -//} void RPCConsole::setClientModel(ClientModel *model) { clientModel = model; ui->trafficGraph->setClientModel(model); - if (model && clientModel->getPeerTableModel() && clientModel->getBanTableModel()) { + if(model) + { // Keep up to date with client setNumConnections(model->getNumConnections()); connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); @@ -326,119 +275,19 @@ void RPCConsole::setClientModel(ClientModel *model) setNumBlocks(model->getNumBlocks()); connect(model, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int))); + setMasternodeCount(model->getMasternodeCountString()); + connect(model, SIGNAL(strMasternodesChanged(QString)), this, SLOT(setMasternodeCount(QString))); + updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent()); connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64))); - connect(model, SIGNAL(mempoolSizeChanged(long,size_t)), this, SLOT(setMempoolSize(long,size_t))); - - // set up peer table - ui->peerWidget->setModel(model->getPeerTableModel()); - ui->peerWidget->verticalHeader()->hide(); - ui->peerWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); - ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows); - ui->peerWidget->setSelectionMode(QAbstractItemView::SingleSelection); - ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu); -// ui->peerWidget->setColumnWidth(PeerTableModel::Address, ADDRESS_COLUMN_WIDTH); -// ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH); -// ui->peerWidget->setColumnWidth(PeerTableModel::Ping, PING_COLUMN_WIDTH); - ui->peerWidget->horizontalHeader()->setStretchLastSection(true); - - // create peer table context menu actions - QAction* disconnectAction = new QAction(tr("&Disconnect Node"), this); - QAction* banAction1h = new QAction(tr("Ban Node for") + " " + tr("1 &hour"), this); - QAction* banAction24h = new QAction(tr("Ban Node for") + " " + tr("1 &day"), this); - QAction* banAction7d = new QAction(tr("Ban Node for") + " " + tr("1 &week"), this); - QAction* banAction365d = new QAction(tr("Ban Node for") + " " + tr("1 &year"), this); - - // create peer table context menu - peersTableContextMenu = new QMenu(this); -// peersTableContextMenu->setFont(GUIUtil::fixedPitchFont()); - peersTableContextMenu->addAction(disconnectAction); - peersTableContextMenu->addAction(banAction1h); - peersTableContextMenu->addAction(banAction24h); - peersTableContextMenu->addAction(banAction7d); - peersTableContextMenu->addAction(banAction365d); - - // Add a signal mapping to allow dynamic context menu arguments. - // We need to use int (instead of int64_t), because signal mapper only supports - // int or objects, which is okay because max bantime (1 year) is < int_max. - QSignalMapper* signalMapper = new QSignalMapper(this); - signalMapper->setMapping(banAction1h, 60*60); - signalMapper->setMapping(banAction24h, 60*60*24); - signalMapper->setMapping(banAction7d, 60*60*24*7); - signalMapper->setMapping(banAction365d, 60*60*24*365); - connect(banAction1h, SIGNAL(triggered()), signalMapper, SLOT(map())); - connect(banAction24h, SIGNAL(triggered()), signalMapper, SLOT(map())); - connect(banAction7d, SIGNAL(triggered()), signalMapper, SLOT(map())); - connect(banAction365d, SIGNAL(triggered()), signalMapper, SLOT(map())); - connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(banSelectedNode(int))); - - // peer table context menu signals - connect(ui->peerWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showPeersTableContextMenu(const QPoint&))); - connect(disconnectAction, SIGNAL(triggered()), this, SLOT(disconnectSelectedNode())); - - // peer table signal handling - update peer details when selecting new node - connect(ui->peerWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), - this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); - // peer table signal handling - update peer details when new nodes are added to the model - connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged())); - - // set up ban table - ui->banlistWidget->setModel(model->getBanTableModel()); - ui->banlistWidget->verticalHeader()->hide(); - ui->banlistWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); - ui->banlistWidget->setSelectionBehavior(QAbstractItemView::SelectRows); - ui->banlistWidget->setSelectionMode(QAbstractItemView::SingleSelection); - ui->banlistWidget->setContextMenuPolicy(Qt::CustomContextMenu); -// ui->banlistWidget->setColumnWidth(BanTableModel::Address, BANSUBNET_COLUMN_WIDTH); -// ui->banlistWidget->setColumnWidth(BanTableModel::Bantime, BANTIME_COLUMN_WIDTH); - ui->banlistWidget->horizontalHeader()->setStretchLastSection(true); - - // create ban table context menu action - QAction* unbanAction = new QAction(tr("&Unban Node"), this); - - // create ban table context menu - banTableContextMenu = new QMenu(this); -// banTableContextMenu->setFont(GUIUtil::fixedPitchFont()); - banTableContextMenu->addAction(unbanAction); - - // ban table context menu signals - connect(ui->banlistWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showBanTableContextMenu(const QPoint&))); - connect(unbanAction, SIGNAL(triggered()), this, SLOT(unbanSelectedNode())); - - // ban table signal handling - clear peer details when clicking a peer in the ban table - connect(ui->banlistWidget, SIGNAL(clicked(const QModelIndex&)), this, SLOT(clearSelectedNode())); - // ban table signal handling - ensure ban table is shown or hidden (if empty) - connect(model->getBanTableModel(), SIGNAL(layoutChanged()), this, SLOT(showOrHideBanTableIfRequired())); - showOrHideBanTableIfRequired(); - // Provide initial values - - // Provide initial values ui->clientVersion->setText(model->formatFullVersion()); ui->clientName->setText(model->clientName()); ui->buildDate->setText(model->formatBuildDate()); ui->startupTime->setText(model->formatClientStartupTime()); ui->networkName->setText(model->getNetworkName()); - -// ui->clientVersion->setText(model->formatFullVersion()); -// ui->clientUserAgent->setText(model->formatSubVersion()); -// ui->dataDir->setText(model->dataDir()); -// ui->startupTime->setText(model->formatClientStartupTime()); -// ui->networkName->setText(QString::fromStdString(Params().NetworkIDString())); - - //Setup autocomplete and attach it -// QStringList wordList; -// std::vector commandList = tableRPC.listCommands(); -// for (size_t i = 0; i < commandList.size(); ++i) -// { -// wordList << commandList[i].c_str(); -// } - -// autoCompleter = new QCompleter(wordList, this); -// ui->lineEdit->setCompleter(autoCompleter); -// autoCompleter->popup()->installEventFilter(this); } } @@ -618,35 +467,7 @@ void RPCConsole::on_sldGraphRange_valueChanged(int value) int mins = value * multiplier; setTrafficGraphRange(mins); } -void RPCConsole::showPeersTableContextMenu(const QPoint& point) -{ - QModelIndex index = ui->peerWidget->indexAt(point); - if (index.isValid()) - peersTableContextMenu->exec(QCursor::pos()); -} - -void RPCConsole::showBanTableContextMenu(const QPoint& point) -{ - QModelIndex index = ui->banlistWidget->indexAt(point); - if (index.isValid()) - banTableContextMenu->exec(QCursor::pos()); -} -void RPCConsole::showOrHideBanTableIfRequired() -{ - if (!clientModel) - return; - bool visible = clientModel->getBanTableModel()->shouldShow(); - ui->banlistWidget->setVisible(visible); - ui->banHeading->setVisible(visible); -} -void RPCConsole::clearSelectedNode() -{ - ui->peerWidget->selectionModel()->clearSelection(); - cachedNodeid = -1; - ui->detailWidget->hide(); - ui->peerHeading->setText(tr("Select a peer to view detailed information.")); -} QString RPCConsole::FormatBytes(quint64 bytes) { if(bytes < 1024) @@ -680,79 +501,7 @@ void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut) ui->lblBytesIn->setText(FormatBytes(totalBytesIn)); ui->lblBytesOut->setText(FormatBytes(totalBytesOut)); } -void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) -{ - // Update cached nodeid - cachedNodeid = stats->nodeStats.nodeid; - - // update the detail ui with latest node information - QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + " "); - peerAddrDetails += tr("(node id: %1)").arg(QString::number(stats->nodeStats.nodeid)); - if (!stats->nodeStats.addrLocal.empty()) - peerAddrDetails += "
" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal)); - ui->peerHeading->setText(peerAddrDetails); - ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices)); - ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nLastSend) : tr("never")); - ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nLastRecv) : tr("never")); - ui->peerBytesSent->setText(FormatBytes(stats->nodeStats.nSendBytes)); - ui->peerBytesRecv->setText(FormatBytes(stats->nodeStats.nRecvBytes)); - ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nTimeConnected)); - ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingTime)); - ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingWait)); -// ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset)); - ui->peerVersion->setText(QString("%1").arg(QString::number(stats->nodeStats.nVersion))); - ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); - ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound")); - ui->peerHeight->setText(QString("%1").arg(QString::number(stats->nodeStats.nStartingHeight))); -// ui->peerWhitelisted->setText(stats->nodeStats.fWhitelisted ? tr("Yes") : tr("No")); - -// This check fails for example if the lock was busy and -// nodeStateStats couldn't be fetched. - if (stats->fNodeStateStatsAvailable) { - // Ban score is init to 0 - ui->peerBanScore->setText(QString("%1").arg(stats->nodeStateStats.nMisbehavior)); - -// // Sync height is init to -1 -// if (stats->nodeStateStats.nSyncHeight > -1) -// ui->peerSyncHeight->setText(QString("%1").arg(stats->nodeStateStats.nSyncHeight)); -// else -// ui->peerSyncHeight->setText(tr("Unknown")); - -// // Common height is init to -1 -// if (stats->nodeStateStats.nCommonHeight > -1) -// ui->peerCommonHeight->setText(QString("%1").arg(stats->nodeStateStats.nCommonHeight)); -// else -// ui->peerCommonHeight->setText(tr("Unknown")); - } - - ui->detailWidget->show(); -} -//void RPCConsole::resizeEvent(QResizeEvent *event) -//{ -// QWidget::resizeEvent(event); -// ui->tabWidget->setStyleSheet(QString("QTabBar::tab {width:%0;}").arg(this->width()/4.3)); -//} -void RPCConsole::showEvent(QShowEvent *event) -{ - QWidget::showEvent(event); - if (!clientModel || !clientModel->getPeerTableModel()) - return; - - // start PeerTableModel auto refresh - clientModel->getPeerTableModel()->startAutoRefresh(); -} - -void RPCConsole::hideEvent(QHideEvent *event) -{ - QWidget::hideEvent(event); - - if (!clientModel || !clientModel->getPeerTableModel()) - return; - - // stop PeerTableModel auto refresh - clientModel->getPeerTableModel()->stopAutoRefresh(); -} void RPCConsole::showInfo() { ui->tabWidget->setCurrentIndex(0); @@ -780,110 +529,3 @@ void RPCConsole::showBackups() { GUIUtil::showBackups(); } - -void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected) -{ - Q_UNUSED(deselected); - - if (!clientModel || !clientModel->getPeerTableModel() || selected.indexes().isEmpty()) - return; - - const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(selected.indexes().first().row()); - if (stats) - updateNodeDetail(stats); -} -void RPCConsole::peerLayoutChanged() -{ - if (!clientModel || !clientModel->getPeerTableModel()) - return; - - const CNodeCombinedStats *stats = NULL; - bool fUnselect = false; - bool fReselect = false; - - if (cachedNodeid == -1) // no node selected yet - return; - - // find the currently selected row - int selectedRow = -1; - QModelIndexList selectedModelIndex = ui->peerWidget->selectionModel()->selectedIndexes(); - if (!selectedModelIndex.isEmpty()) { - selectedRow = selectedModelIndex.first().row(); - } - - // check if our detail node has a row in the table (it may not necessarily - // be at selectedRow since its position can change after a layout change) - int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(cachedNodeid); - - if (detailNodeRow < 0) - { - // detail node disappeared from table (node disconnected) - fUnselect = true; - } - else - { - if (detailNodeRow != selectedRow) - { - // detail node moved position - fUnselect = true; - fReselect = true; - } - - // get fresh stats on the detail node. - stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow); - } - - if (fUnselect && selectedRow >= 0) { - clearSelectedNode(); - } - - if (fReselect) - { - ui->peerWidget->selectRow(detailNodeRow); - } - - if (stats) - updateNodeDetail(stats); -} -void RPCConsole::disconnectSelectedNode() -{ - // Get currently selected peer address - QString strNode = GUIUtil::getEntryData(ui->peerWidget, 0, PeerTableModel::Address); - // Find the node, disconnect it and clear the selected node - if (CNode *bannedNode = FindNode(strNode.toStdString())) { - bannedNode->fDisconnect = true; - clearSelectedNode(); - } -} - -void RPCConsole::banSelectedNode(int bantime) -{ - if (!clientModel) - return; - - // Get currently selected peer address - QString strNode = GUIUtil::getEntryData(ui->peerWidget, 0, PeerTableModel::Address); - // Find possible nodes, ban it and clear the selected node - if (FindNode(strNode.toStdString())) { - std::string nStr = strNode.toStdString(); - std::string addr; - int port = 0; - SplitHostPort(nStr, port, addr); - - CNode::Ban(CNetAddr(addr), bantime); - - clearSelectedNode(); - clientModel->getBanTableModel()->refresh(); - } -} - -void RPCConsole::unbanSelectedNode() -{ - if (!clientModel) - return; - - // Get currently selected ban address - CNode::Unban(CNetAddr(GUIUtil::getEntryData(ui->banlistWidget, 0, BanTableModel::Address).toStdString())); - clientModel->getBanTableModel()->refresh(); - -} diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 93213c6cf..9d42fcc78 100755 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -6,12 +6,9 @@ #define RPCCONSOLE_H #include -#include -#include "../net.h" class ClientModel; -class CNodeCombinedStats; -class QItemSelection; + namespace Ui { class RPCConsole; } @@ -47,16 +44,6 @@ private slots: void on_sldGraphRange_valueChanged(int value); /** update traffic statistics */ void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut); - void showEvent(QShowEvent *event); - void hideEvent(QHideEvent *event); - /** Show custom context menu on Peers tab */ - void showPeersTableContextMenu(const QPoint& point); - /** Show custom context menu on Bans tab */ - void showBanTableContextMenu(const QPoint& point); - /** Hides ban table if no bans are present */ - void showOrHideBanTableIfRequired(); - /** clear the selected node */ - void clearSelectedNode(); public slots: void clear(); @@ -79,20 +66,10 @@ public slots: /** Switch to network tab and show */ void showNetwork(); /** Open external (default) editor with interzone.conf */ - void showConfEditor(); + void showConfEditor(); /** Show folder with wallet backups in default browser */ void showBackups(); - /** Handle selection of peer in peers list */ - void peerSelected(const QItemSelection &selected, const QItemSelection &deselected); - /** Handle updated peer information */ - void peerLayoutChanged(); - /** Disconnect a selected node on the Peers tab */ - void disconnectSelectedNode(); - /** Ban a selected node on the Peers tab */ - void banSelectedNode(int bantime); - /** Unban a selected node on the Bans tab */ - void unbanSelectedNode(); signals: // For RPC command executor void stopExecutor(); @@ -101,16 +78,11 @@ public slots: private: static QString FormatBytes(quint64 bytes); void setTrafficGraphRange(int mins); - /** show detailed information on ui about selected node */ - void updateNodeDetail(const CNodeCombinedStats *stats); - QMenu *peersTableContextMenu; - QMenu *banTableContextMenu; Ui::RPCConsole *ui; ClientModel *clientModel; QStringList history; int historyPtr; - NodeId cachedNodeid; void startExecutor(); }; diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 60957610a..6b38d3abd 100755 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -34,7 +34,7 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest QString versionText = QString(tr("Version %1")).arg(QString::fromStdString(FormatFullVersion())); QString copyrightTextBtc = QChar(0xA9)+QString(" 2009-2015 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); QString copyrightTextDrk = QChar(0xA9)+QString(" 2014-2015 ").arg(COPYRIGHT_YEAR) + QString(tr("The Dash Core developers")); - QString copyrightTextChc = QChar(0xA9)+QString(" 2014-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Interzone Core developers")); + QString copyrightTextITZ = QChar(0xA9)+QString(" 2014-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Interzone Core developers")); QString testnetAddText = QString(tr("[testnet]")); // define text to place as single text object QString font = "Arial"; @@ -72,7 +72,7 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest pixPaint.setFont(QFont(font, 10*fontFactor)); pixPaint.drawText(paddingLeft,paddingTop+titleCopyrightVSpace,copyrightTextBtc); pixPaint.drawText(paddingLeft,paddingTop+titleCopyrightVSpace+12,copyrightTextDrk); - pixPaint.drawText(paddingLeft,paddingTop+titleCopyrightVSpace+24,copyrightTextChc); + pixPaint.drawText(paddingLeft,paddingTop+titleCopyrightVSpace+24,copyrightTextITZ); // draw testnet string if testnet is on if(isTestNet) { diff --git a/src/qt/test/Makefile.am b/src/qt/test/Makefile.am index eaaa961d8..ce169b7a5 100755 --- a/src/qt/test/Makefile.am +++ b/src/qt/test/Makefile.am @@ -40,7 +40,7 @@ test_interzone_qt_LDADD += $(LIBBITCOIN_WALLET) endif test_interzone_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ - $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) test_interzone_qt_LDFLAGS = $(QT_LDFLAGS) CLEANFILES = $(BUILT_SOURCES) *.gcda *.gcno diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 5e8ca0abb..b6013178f 100755 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -509,5 +509,5 @@ void TransactionView::focusTransaction(const QModelIndex &idx) void TransactionView::resizeEvent(QResizeEvent* event) { QWidget::resizeEvent(event); - columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress); + columnResizingFixer->stretITZolumnWidth(TransactionTableModel::ToAddress); } diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 638119e23..e38e25de7 100755 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -104,12 +104,7 @@ void WalletFrame::showOutOfSyncWarning(bool fShow) for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) i.value()->showOutOfSyncWarning(fShow); } -void WalletFrame::gotomasternodeList() -{ - QMap::const_iterator i; - for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) - i.value()->gotomasternodeList(); -} + void WalletFrame::gotoOverviewPage() { QMap::const_iterator i; diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index 14c99f972..b2c077943 100755 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -48,8 +48,6 @@ class WalletFrame : public QFrame WalletView *currentWalletView(); public slots: - /** Switch to master node list Page */ - void gotomasternodeList(); /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 01733ad69..b8ed64242 100755 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -17,7 +17,6 @@ #include "transactiontablemodel.h" #include "transactionview.h" #include "walletmodel.h" -#include "masternodelist.h" #include "ui_interface.h" @@ -67,12 +66,10 @@ WalletView::WalletView(QWidget *parent): receiveCoinsPage = new ReceiveCoinsDialog(); sendCoinsPage = new SendCoinsDialog(); - masternodeList= new MasternodeList(); addWidget(overviewPage); addWidget(transactionsPage); addWidget(receiveCoinsPage); addWidget(sendCoinsPage); - addWidget(masternodeList); // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); @@ -119,7 +116,6 @@ void WalletView::setClientModel(ClientModel *clientModel) this->clientModel = clientModel; overviewPage->setClientModel(clientModel); - masternodeList->setClientModel(clientModel); } void WalletView::setWalletModel(WalletModel *walletModel) @@ -131,7 +127,6 @@ void WalletView::setWalletModel(WalletModel *walletModel) overviewPage->setWalletModel(walletModel); receiveCoinsPage->setModel(walletModel); sendCoinsPage->setModel(walletModel); - masternodeList->setWalletModel(walletModel); if (walletModel) { @@ -172,9 +167,6 @@ void WalletView::processNewTransaction(const QModelIndex& parent, int start, int emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address); } -void WalletView::gotomasternodeList(){ - setCurrentWidget(masternodeList); -} void WalletView::gotoOverviewPage() { setCurrentWidget(overviewPage); diff --git a/src/qt/walletview.h b/src/qt/walletview.h index 585d00bd2..434c15dfc 100755 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -15,7 +15,6 @@ class SendCoinsDialog; class SendCoinsRecipient; class TransactionView; class WalletModel; -class MasternodeList; QT_BEGIN_NAMESPACE class QLabel; @@ -57,7 +56,6 @@ class WalletView : public QStackedWidget WalletModel *walletModel; OverviewPage *overviewPage; - MasternodeList * masternodeList; QWidget *transactionsPage; ReceiveCoinsDialog *receiveCoinsPage; SendCoinsDialog *sendCoinsPage; @@ -68,8 +66,6 @@ class WalletView : public QStackedWidget QLabel *transactionSum; public slots: - /** Switch to master node list Page */ - void gotomasternodeList(); /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ diff --git a/src/random.cpp b/src/random.cpp deleted file mode 100644 index f38017208..000000000 --- a/src/random.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "random.h" - -#include "support/cleanse.h" -#ifdef WIN32 -#include "compat.h" // for Windows API -#endif -#include "serialize.h" // for begin_ptr(vec) -#include "util.h" // for LogPrint() -#include "utilstrencodings.h" // for GetTime() - -#include - -#ifndef WIN32 -#include -#endif - -#include -#include - -void GetRandBytes(unsigned char* buf, int num) -{ - if (RAND_bytes(buf, num) != 1) { - LogPrintf("%s: OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); - assert(false); - } -} - -uint32_t insecure_rand_Rz = 11; -uint32_t insecure_rand_Rw = 11; -void seed_insecure_rand(bool fDeterministic) -{ - // The seed values have some unlikely fixed points which we avoid. - if (fDeterministic) { - insecure_rand_Rz = insecure_rand_Rw = 11; - } else { - uint32_t tmp; - do { - GetRandBytes((unsigned char*)&tmp, 4); - } while (tmp == 0 || tmp == 0x9068ffffU); - insecure_rand_Rz = tmp; - do { - GetRandBytes((unsigned char*)&tmp, 4); - } while (tmp == 0 || tmp == 0x464fffffU); - insecure_rand_Rw = tmp; - } -} - -InsecureRand::InsecureRand(bool _fDeterministic) - : nRz(11), - nRw(11), - fDeterministic(_fDeterministic) -{ - // The seed values have some unlikely fixed points which we avoid. - if(fDeterministic) return; - uint32_t nTmp; - do { - GetRandBytes((unsigned char*)&nTmp, 4); - } while (nTmp == 0 || nTmp == 0x9068ffffU); - nRz = nTmp; - do { - GetRandBytes((unsigned char*)&nTmp, 4); - } while (nTmp == 0 || nTmp == 0x464fffffU); - nRw = nTmp; -} diff --git a/src/random.h b/src/random.h deleted file mode 100644 index 3cdef28c8..000000000 --- a/src/random.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_RANDOM_H -#define BITCOIN_RANDOM_H - -#include "uint256.h" - -#include - -/** - * Functions to gather random data via the OpenSSL PRNG - */ -void GetRandBytes(unsigned char* buf, int num); - -/** - * Seed insecure_rand using the random pool. - * @param Deterministic Use a deterministic seed - */ -void seed_insecure_rand(bool fDeterministic = false); - -/** - * MWC RNG of George Marsaglia - * This is intended to be fast. It has a period of 2^59.3, though the - * least significant 16 bits only have a period of about 2^30.1. - * - * @return random value - */ -extern uint32_t insecure_rand_Rz; -extern uint32_t insecure_rand_Rw; -static inline uint32_t insecure_rand(void) -{ - insecure_rand_Rz = 36969 * (insecure_rand_Rz & 65535) + (insecure_rand_Rz >> 16); - insecure_rand_Rw = 18000 * (insecure_rand_Rw & 65535) + (insecure_rand_Rw >> 16); - return (insecure_rand_Rw << 16) + insecure_rand_Rz; -} - -/** - * PRNG initialized from secure entropy based RNG - */ -class InsecureRand -{ -private: - uint32_t nRz; - uint32_t nRw; - bool fDeterministic; - -public: - InsecureRand(bool _fDeterministic = false); - - /** - * MWC RNG of George Marsaglia - * This is intended to be fast. It has a period of 2^59.3, though the - * least significant 16 bits only have a period of about 2^30.1. - * - * @return random value < nMax - */ - int64_t operator()(int64_t nMax) - { - nRz = 36969 * (nRz & 65535) + (nRz >> 16); - nRw = 18000 * (nRw & 65535) + (nRw >> 16); - return ((nRw << 16) + nRz) % nMax; - } -}; - -#endif // BITCOIN_RANDOM_H diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp old mode 100644 new mode 100755 diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp old mode 100644 new mode 100755 diff --git a/src/rpcclient.h b/src/rpcclient.h old mode 100644 new mode 100755 diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp old mode 100644 new mode 100755 index 915aad74b..9fb5b170f --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -274,7 +274,7 @@ Value masternode(const Array& params, bool fHelp) } if (params.size() == 2) { - if(params[1] == "enabled") return static_cast(mnodeman.CountEnabled()); + if(params[1] == "enabled") return mnodeman.CountEnabled(); if(params[1] == "both") return boost::lexical_cast(mnodeman.CountEnabled()) + " / " + boost::lexical_cast(mnodeman.size()); } return mnodeman.size(); diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp old mode 100644 new mode 100755 diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp old mode 100644 new mode 100755 diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp old mode 100644 new mode 100755 index 888788c74..06e579159 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -45,7 +45,6 @@ Value getinfo(const Array& params, bool fHelp) " \"timeoffset\": xxxxx, (numeric) the time offset\n" " \"connections\": xxxxx, (numeric) the number of connections\n" " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" - " \"ip\": xxxxx, (string) local ip address\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"testnet\": true|false, (boolean) if the server is using testnet or not\n" " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n" @@ -78,7 +77,6 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); - obj.push_back(Pair("ip", GetLocalAddress(NULL).ToStringIP())); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", TestNet())); #ifdef ENABLE_WALLET @@ -384,7 +382,7 @@ Value makekeypair(const Array& params, bool fHelp) "makekeypair [prefix]\n" "Make a public/private key pair.\n" "[prefix] is optional preferred prefix for the public key.\n"); - + string strPrefix = ""; if (params.size() > 0) strPrefix = params[0].get_str(); diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp old mode 100644 new mode 100755 diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp old mode 100644 new mode 100755 diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h old mode 100644 new mode 100755 diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp old mode 100644 new mode 100755 diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp old mode 100644 new mode 100755 diff --git a/src/rpcserver.h b/src/rpcserver.h old mode 100644 new mode 100755 diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp old mode 100644 new mode 100755 diff --git a/src/script.cpp b/src/script.cpp old mode 100644 new mode 100755 diff --git a/src/script.h b/src/script.h old mode 100644 new mode 100755 diff --git a/src/script/script.cpp b/src/script/script.cpp deleted file mode 100644 index 271a7254d..000000000 --- a/src/script/script.cpp +++ /dev/null @@ -1,2173 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2014-2015 The Dash developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "script.h" - -#include "core.h" -#include "hash.h" -#include "key.h" -#include "keystore.h" -#include "sync.h" -#include "uint256.h" -#include "util.h" - -#include -#include -#include - -using namespace std; -using namespace boost; - -typedef vector valtype; -static const valtype vchFalse(0); -static const valtype vchZero(0); -static const valtype vchTrue(1, 1); -static const CScriptNum bnZero(0); -static const CScriptNum bnOne(1); -static const CScriptNum bnFalse(0); -static const CScriptNum bnTrue(1); - -bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); - -bool CastToBool(const valtype& vch) -{ - for (unsigned int i = 0; i < vch.size(); i++) - { - if (vch[i] != 0) - { - // Can be negative zero - if (i == vch.size()-1 && vch[i] == 0x80) - return false; - return true; - } - } - return false; -} - - - -// -// Script is a stack machine (like Forth) that evaluates a predicate -// returning a bool indicating valid or not. There are no loops. -// -#define stacktop(i) (stack.at(stack.size()+(i))) -#define altstacktop(i) (altstack.at(altstack.size()+(i))) -static inline void popstack(vector& stack) -{ - if (stack.empty()) - throw runtime_error("popstack() : stack empty"); - stack.pop_back(); -} - - -const char* GetTxnOutputType(txnouttype t) -{ - switch (t) - { - case TX_NONSTANDARD: return "nonstandard"; - case TX_PUBKEY: return "pubkey"; - case TX_PUBKEYHASH: return "pubkeyhash"; - case TX_SCRIPTHASH: return "scripthash"; - case TX_MULTISIG: return "multisig"; - case TX_NULL_DATA: return "nulldata"; - } - return NULL; -} - - -const char* GetOpName(opcodetype opcode) -{ - switch (opcode) - { - // push value - case OP_0 : return "0"; - case OP_PUSHDATA1 : return "OP_PUSHDATA1"; - case OP_PUSHDATA2 : return "OP_PUSHDATA2"; - case OP_PUSHDATA4 : return "OP_PUSHDATA4"; - case OP_1NEGATE : return "-1"; - case OP_RESERVED : return "OP_RESERVED"; - case OP_1 : return "1"; - case OP_2 : return "2"; - case OP_3 : return "3"; - case OP_4 : return "4"; - case OP_5 : return "5"; - case OP_6 : return "6"; - case OP_7 : return "7"; - case OP_8 : return "8"; - case OP_9 : return "9"; - case OP_10 : return "10"; - case OP_11 : return "11"; - case OP_12 : return "12"; - case OP_13 : return "13"; - case OP_14 : return "14"; - case OP_15 : return "15"; - case OP_16 : return "16"; - - // control - case OP_NOP : return "OP_NOP"; - case OP_VER : return "OP_VER"; - case OP_IF : return "OP_IF"; - case OP_NOTIF : return "OP_NOTIF"; - case OP_VERIF : return "OP_VERIF"; - case OP_VERNOTIF : return "OP_VERNOTIF"; - case OP_ELSE : return "OP_ELSE"; - case OP_ENDIF : return "OP_ENDIF"; - case OP_VERIFY : return "OP_VERIFY"; - case OP_RETURN : return "OP_RETURN"; - - // stack ops - case OP_TOALTSTACK : return "OP_TOALTSTACK"; - case OP_FROMALTSTACK : return "OP_FROMALTSTACK"; - case OP_2DROP : return "OP_2DROP"; - case OP_2DUP : return "OP_2DUP"; - case OP_3DUP : return "OP_3DUP"; - case OP_2OVER : return "OP_2OVER"; - case OP_2ROT : return "OP_2ROT"; - case OP_2SWAP : return "OP_2SWAP"; - case OP_IFDUP : return "OP_IFDUP"; - case OP_DEPTH : return "OP_DEPTH"; - case OP_DROP : return "OP_DROP"; - case OP_DUP : return "OP_DUP"; - case OP_NIP : return "OP_NIP"; - case OP_OVER : return "OP_OVER"; - case OP_PICK : return "OP_PICK"; - case OP_ROLL : return "OP_ROLL"; - case OP_ROT : return "OP_ROT"; - case OP_SWAP : return "OP_SWAP"; - case OP_TUCK : return "OP_TUCK"; - - // splice ops - case OP_CAT : return "OP_CAT"; - case OP_SUBSTR : return "OP_SUBSTR"; - case OP_LEFT : return "OP_LEFT"; - case OP_RIGHT : return "OP_RIGHT"; - case OP_SIZE : return "OP_SIZE"; - - // bit logic - case OP_INVERT : return "OP_INVERT"; - case OP_AND : return "OP_AND"; - case OP_OR : return "OP_OR"; - case OP_XOR : return "OP_XOR"; - case OP_EQUAL : return "OP_EQUAL"; - case OP_EQUALVERIFY : return "OP_EQUALVERIFY"; - case OP_RESERVED1 : return "OP_RESERVED1"; - case OP_RESERVED2 : return "OP_RESERVED2"; - - // numeric - case OP_1ADD : return "OP_1ADD"; - case OP_1SUB : return "OP_1SUB"; - case OP_2MUL : return "OP_2MUL"; - case OP_2DIV : return "OP_2DIV"; - case OP_NEGATE : return "OP_NEGATE"; - case OP_ABS : return "OP_ABS"; - case OP_NOT : return "OP_NOT"; - case OP_0NOTEQUAL : return "OP_0NOTEQUAL"; - case OP_ADD : return "OP_ADD"; - case OP_SUB : return "OP_SUB"; - case OP_MUL : return "OP_MUL"; - case OP_DIV : return "OP_DIV"; - case OP_MOD : return "OP_MOD"; - case OP_LSHIFT : return "OP_LSHIFT"; - case OP_RSHIFT : return "OP_RSHIFT"; - case OP_BOOLAND : return "OP_BOOLAND"; - case OP_BOOLOR : return "OP_BOOLOR"; - case OP_NUMEQUAL : return "OP_NUMEQUAL"; - case OP_NUMEQUALVERIFY : return "OP_NUMEQUALVERIFY"; - case OP_NUMNOTEQUAL : return "OP_NUMNOTEQUAL"; - case OP_LESSTHAN : return "OP_LESSTHAN"; - case OP_GREATERTHAN : return "OP_GREATERTHAN"; - case OP_LESSTHANOREQUAL : return "OP_LESSTHANOREQUAL"; - case OP_GREATERTHANOREQUAL : return "OP_GREATERTHANOREQUAL"; - case OP_MIN : return "OP_MIN"; - case OP_MAX : return "OP_MAX"; - case OP_WITHIN : return "OP_WITHIN"; - - // crypto - case OP_RIPEMD160 : return "OP_RIPEMD160"; - case OP_SHA1 : return "OP_SHA1"; - case OP_SHA256 : return "OP_SHA256"; - case OP_HASH160 : return "OP_HASH160"; - case OP_HASH256 : return "OP_HASH256"; - case OP_CODESEPARATOR : return "OP_CODESEPARATOR"; - case OP_CHECKSIG : return "OP_CHECKSIG"; - case OP_CHECKSIGVERIFY : return "OP_CHECKSIGVERIFY"; - case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG"; - case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY"; - - // expanson - case OP_NOP1 : return "OP_NOP1"; - case OP_NOP2 : return "OP_NOP2"; - case OP_NOP3 : return "OP_NOP3"; - case OP_NOP4 : return "OP_NOP4"; - case OP_NOP5 : return "OP_NOP5"; - case OP_NOP6 : return "OP_NOP6"; - case OP_NOP7 : return "OP_NOP7"; - case OP_NOP8 : return "OP_NOP8"; - case OP_NOP9 : return "OP_NOP9"; - case OP_NOP10 : return "OP_NOP10"; - - - - // template matching params - case OP_PUBKEYHASH : return "OP_PUBKEYHASH"; - case OP_PUBKEY : return "OP_PUBKEY"; - case OP_SMALLDATA : return "OP_SMALLDATA"; - - case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE"; - default: - return "OP_UNKNOWN"; - } -} - -bool IsCanonicalPubKey(const valtype &vchPubKey, unsigned int flags) { - if (!(flags & SCRIPT_VERIFY_STRICTENC)) - return true; - - if (vchPubKey.size() < 33) - return error("Non-canonical public key: too short"); - if (vchPubKey[0] == 0x04) { - if (vchPubKey.size() != 65) - return error("Non-canonical public key: invalid length for uncompressed key"); - } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) { - if (vchPubKey.size() != 33) - return error("Non-canonical public key: invalid length for compressed key"); - } else { - return error("Non-canonical public key: compressed nor uncompressed"); - } - return true; -} - -bool IsCanonicalSignature(const valtype &vchSig, unsigned int flags) { - if (!(flags & SCRIPT_VERIFY_STRICTENC)) - return true; - - // See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 - // A canonical signature exists of: <30> <02> <02> - // Where R and S are not negative (their first byte has its highest bit not set), and not - // excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, - // in which case a single 0 byte is necessary and even required). - if (vchSig.size() < 9) - return error("Non-canonical signature: too short"); - if (vchSig.size() > 73) - return error("Non-canonical signature: too long"); - unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY)); - if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE) - return error("Non-canonical signature: unknown hashtype byte"); - if (vchSig[0] != 0x30) - return error("Non-canonical signature: wrong type"); - if (vchSig[1] != vchSig.size()-3) - return error("Non-canonical signature: wrong length marker"); - unsigned int nLenR = vchSig[3]; - if (5 + nLenR >= vchSig.size()) - return error("Non-canonical signature: S length misplaced"); - unsigned int nLenS = vchSig[5+nLenR]; - if ((unsigned long)(nLenR+nLenS+7) != vchSig.size()) - return error("Non-canonical signature: R+S length mismatch"); - - const unsigned char *R = &vchSig[4]; - if (R[-2] != 0x02) - return error("Non-canonical signature: R value type mismatch"); - if (nLenR == 0) - return error("Non-canonical signature: R length is zero"); - if (R[0] & 0x80) - return error("Non-canonical signature: R value negative"); - if (nLenR > 1 && (R[0] == 0x00) && !(R[1] & 0x80)) - return error("Non-canonical signature: R value excessively padded"); - - const unsigned char *S = &vchSig[6+nLenR]; - if (S[-2] != 0x02) - return error("Non-canonical signature: S value type mismatch"); - if (nLenS == 0) - return error("Non-canonical signature: S length is zero"); - if (S[0] & 0x80) - return error("Non-canonical signature: S value negative"); - if (nLenS > 1 && (S[0] == 0x00) && !(S[1] & 0x80)) - return error("Non-canonical signature: S value excessively padded"); - - if (flags & SCRIPT_VERIFY_EVEN_S) { - if (S[nLenS-1] & 1) - return error("Non-canonical signature: S value odd"); - } - - return true; -} - -// BIP 66 defined signature encoding check. This largely overlaps with -// IsCanonicalSignature above, but lacks hashtype constraints, and uses the -// exact implementation code from BIP 66. -bool static IsValidSignatureEncoding(const std::vector &sig) { - // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash] - // * total-length: 1-byte length descriptor of everything that follows, - // excluding the sighash byte. - // * R-length: 1-byte length descriptor of the R value that follows. - // * R: arbitrary-length big-endian encoded R value. It must use the shortest - // possible encoding for a positive integers (which means no null bytes at - // the start, except a single one when the next byte has its highest bit set). - // * S-length: 1-byte length descriptor of the S value that follows. - // * S: arbitrary-length big-endian encoded S value. The same rules apply. - // * sighash: 1-byte value indicating what data is hashed (not part of the DER - // signature) - - // Minimum and maximum size constraints. - if (sig.size() < 9) return false; - if (sig.size() > 73) return false; - - // A signature is of type 0x30 (compound). - if (sig[0] != 0x30) return false; - - // Make sure the length covers the entire signature. - if (sig[1] != sig.size() - 3) return false; - - // Extract the length of the R element. - unsigned int lenR = sig[3]; - - // Make sure the length of the S element is still inside the signature. - if (5 + lenR >= sig.size()) return false; - - // Extract the length of the S element. - unsigned int lenS = sig[5 + lenR]; - - // Verify that the length of the signature matches the sum of the length - // of the elements. - if ((size_t)(lenR + lenS + 7) != sig.size()) return false; - - // Check whether the R element is an integer. - if (sig[2] != 0x02) return false; - - // Zero-length integers are not allowed for R. - if (lenR == 0) return false; - - // Negative numbers are not allowed for R. - if (sig[4] & 0x80) return false; - - // Null bytes at the start of R are not allowed, unless R would - // otherwise be interpreted as a negative number. - if (lenR > 1 && (sig[4] == 0x00) && !(sig[5] & 0x80)) return false; - - // Check whether the S element is an integer. - if (sig[lenR + 4] != 0x02) return false; - - // Zero-length integers are not allowed for S. - if (lenS == 0) return false; - - // Negative numbers are not allowed for S. - if (sig[lenR + 6] & 0x80) return false; - - // Null bytes at the start of S are not allowed, unless S would otherwise be - // interpreted as a negative number. - if (lenS > 1 && (sig[lenR + 6] == 0x00) && !(sig[lenR + 7] & 0x80)) return false; - - return true; -} - -bool static CheckSignatureEncoding(const valtype &vchSig, unsigned int flags) { - // Empty signature. Not strictly DER encoded, but allowed to provide a - // compact way to provide an invalid signature for use with CHECK(MULTI)SIG - if (vchSig.size() == 0) { - return true; - } - if ((flags & SCRIPT_VERIFY_DERSIG) != 0 && !IsValidSignatureEncoding(vchSig)) { - return false; - } - return true; -} - -bool EvalScript(vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) -{ - CScript::const_iterator pc = script.begin(); - CScript::const_iterator pend = script.end(); - CScript::const_iterator pbegincodehash = script.begin(); - opcodetype opcode; - valtype vchPushValue; - vector vfExec; - vector altstack; - if (script.size() > 10000) - return false; - int nOpCount = 0; - - try - { - while (pc < pend) - { - bool fExec = !count(vfExec.begin(), vfExec.end(), false); - - // - // Read instruction - // - if (!script.GetOp(pc, opcode, vchPushValue)) - return false; - if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE) - return false; - - // Note how OP_RESERVED does not count towards the opcode limit. - if (opcode > OP_16 && ++nOpCount > 201) - return false; - - if (opcode == OP_CAT || - opcode == OP_SUBSTR || - opcode == OP_LEFT || - opcode == OP_RIGHT || - opcode == OP_INVERT || - opcode == OP_AND || - opcode == OP_OR || - opcode == OP_XOR || - opcode == OP_2MUL || - opcode == OP_2DIV || - opcode == OP_MUL || - opcode == OP_DIV || - opcode == OP_MOD || - opcode == OP_LSHIFT || - opcode == OP_RSHIFT) - return false; // Disabled opcodes. - - if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) - stack.push_back(vchPushValue); - else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF)) - switch (opcode) - { - // - // Push value - // - case OP_1NEGATE: - case OP_1: - case OP_2: - case OP_3: - case OP_4: - case OP_5: - case OP_6: - case OP_7: - case OP_8: - case OP_9: - case OP_10: - case OP_11: - case OP_12: - case OP_13: - case OP_14: - case OP_15: - case OP_16: - { - // ( -- value) - CScriptNum bn((int)opcode - (int)(OP_1 - 1)); - stack.push_back(bn.getvch()); - } - break; - - - // - // Control - // - case OP_NOP: - case OP_NOP1: case OP_NOP2: case OP_NOP3: case OP_NOP4: case OP_NOP5: - case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10: - break; - - case OP_IF: - case OP_NOTIF: - { - // if [statements] [else [statements]] endif - bool fValue = false; - if (fExec) - { - if (stack.size() < 1) - return false; - valtype& vch = stacktop(-1); - fValue = CastToBool(vch); - if (opcode == OP_NOTIF) - fValue = !fValue; - popstack(stack); - } - vfExec.push_back(fValue); - } - break; - - case OP_ELSE: - { - if (vfExec.empty()) - return false; - vfExec.back() = !vfExec.back(); - } - break; - - case OP_ENDIF: - { - if (vfExec.empty()) - return false; - vfExec.pop_back(); - } - break; - - case OP_VERIFY: - { - // (true -- ) or - // (false -- false) and return - if (stack.size() < 1) - return false; - bool fValue = CastToBool(stacktop(-1)); - if (fValue) - popstack(stack); - else - return false; - } - break; - - case OP_RETURN: - { - return false; - } - break; - - - // - // Stack ops - // - case OP_TOALTSTACK: - { - if (stack.size() < 1) - return false; - altstack.push_back(stacktop(-1)); - popstack(stack); - } - break; - - case OP_FROMALTSTACK: - { - if (altstack.size() < 1) - return false; - stack.push_back(altstacktop(-1)); - popstack(altstack); - } - break; - - case OP_2DROP: - { - // (x1 x2 -- ) - if (stack.size() < 2) - return false; - popstack(stack); - popstack(stack); - } - break; - - case OP_2DUP: - { - // (x1 x2 -- x1 x2 x1 x2) - if (stack.size() < 2) - return false; - valtype vch1 = stacktop(-2); - valtype vch2 = stacktop(-1); - stack.push_back(vch1); - stack.push_back(vch2); - } - break; - - case OP_3DUP: - { - // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) - if (stack.size() < 3) - return false; - valtype vch1 = stacktop(-3); - valtype vch2 = stacktop(-2); - valtype vch3 = stacktop(-1); - stack.push_back(vch1); - stack.push_back(vch2); - stack.push_back(vch3); - } - break; - - case OP_2OVER: - { - // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) - if (stack.size() < 4) - return false; - valtype vch1 = stacktop(-4); - valtype vch2 = stacktop(-3); - stack.push_back(vch1); - stack.push_back(vch2); - } - break; - - case OP_2ROT: - { - // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) - if (stack.size() < 6) - return false; - valtype vch1 = stacktop(-6); - valtype vch2 = stacktop(-5); - stack.erase(stack.end()-6, stack.end()-4); - stack.push_back(vch1); - stack.push_back(vch2); - } - break; - - case OP_2SWAP: - { - // (x1 x2 x3 x4 -- x3 x4 x1 x2) - if (stack.size() < 4) - return false; - swap(stacktop(-4), stacktop(-2)); - swap(stacktop(-3), stacktop(-1)); - } - break; - - case OP_IFDUP: - { - // (x - 0 | x x) - if (stack.size() < 1) - return false; - valtype vch = stacktop(-1); - if (CastToBool(vch)) - stack.push_back(vch); - } - break; - - case OP_DEPTH: - { - // -- stacksize - CScriptNum bn(stack.size()); - stack.push_back(bn.getvch()); - } - break; - - case OP_DROP: - { - // (x -- ) - if (stack.size() < 1) - return false; - popstack(stack); - } - break; - - case OP_DUP: - { - // (x -- x x) - if (stack.size() < 1) - return false; - valtype vch = stacktop(-1); - stack.push_back(vch); - } - break; - - case OP_NIP: - { - // (x1 x2 -- x2) - if (stack.size() < 2) - return false; - stack.erase(stack.end() - 2); - } - break; - - case OP_OVER: - { - // (x1 x2 -- x1 x2 x1) - if (stack.size() < 2) - return false; - valtype vch = stacktop(-2); - stack.push_back(vch); - } - break; - - case OP_PICK: - case OP_ROLL: - { - // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) - // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) - if (stack.size() < 2) - return false; - int n = CScriptNum(stacktop(-1)).getint(); - popstack(stack); - if (n < 0 || n >= (int)stack.size()) - return false; - valtype vch = stacktop(-n-1); - if (opcode == OP_ROLL) - stack.erase(stack.end()-n-1); - stack.push_back(vch); - } - break; - - case OP_ROT: - { - // (x1 x2 x3 -- x2 x3 x1) - // x2 x1 x3 after first swap - // x2 x3 x1 after second swap - if (stack.size() < 3) - return false; - swap(stacktop(-3), stacktop(-2)); - swap(stacktop(-2), stacktop(-1)); - } - break; - - case OP_SWAP: - { - // (x1 x2 -- x2 x1) - if (stack.size() < 2) - return false; - swap(stacktop(-2), stacktop(-1)); - } - break; - - case OP_TUCK: - { - // (x1 x2 -- x2 x1 x2) - if (stack.size() < 2) - return false; - valtype vch = stacktop(-1); - stack.insert(stack.end()-2, vch); - } - break; - - - case OP_SIZE: - { - // (in -- in size) - if (stack.size() < 1) - return false; - CScriptNum bn(stacktop(-1).size()); - stack.push_back(bn.getvch()); - } - break; - - - // - // Bitwise logic - // - case OP_EQUAL: - case OP_EQUALVERIFY: - //case OP_NOTEQUAL: // use OP_NUMNOTEQUAL - { - // (x1 x2 - bool) - if (stack.size() < 2) - return false; - valtype& vch1 = stacktop(-2); - valtype& vch2 = stacktop(-1); - bool fEqual = (vch1 == vch2); - // OP_NOTEQUAL is disabled because it would be too easy to say - // something like n != 1 and have some wiseguy pass in 1 with extra - // zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001) - //if (opcode == OP_NOTEQUAL) - // fEqual = !fEqual; - popstack(stack); - popstack(stack); - stack.push_back(fEqual ? vchTrue : vchFalse); - if (opcode == OP_EQUALVERIFY) - { - if (fEqual) - popstack(stack); - else - return false; - } - } - break; - - - // - // Numeric - // - case OP_1ADD: - case OP_1SUB: - case OP_NEGATE: - case OP_ABS: - case OP_NOT: - case OP_0NOTEQUAL: - { - // (in -- out) - if (stack.size() < 1) - return false; - CScriptNum bn(stacktop(-1)); - switch (opcode) - { - case OP_1ADD: bn += bnOne; break; - case OP_1SUB: bn -= bnOne; break; - case OP_NEGATE: bn = -bn; break; - case OP_ABS: if (bn < bnZero) bn = -bn; break; - case OP_NOT: bn = (bn == bnZero); break; - case OP_0NOTEQUAL: bn = (bn != bnZero); break; - default: assert(!"invalid opcode"); break; - } - popstack(stack); - stack.push_back(bn.getvch()); - } - break; - - case OP_ADD: - case OP_SUB: - case OP_BOOLAND: - case OP_BOOLOR: - case OP_NUMEQUAL: - case OP_NUMEQUALVERIFY: - case OP_NUMNOTEQUAL: - case OP_LESSTHAN: - case OP_GREATERTHAN: - case OP_LESSTHANOREQUAL: - case OP_GREATERTHANOREQUAL: - case OP_MIN: - case OP_MAX: - { - // (x1 x2 -- out) - if (stack.size() < 2) - return false; - CScriptNum bn1(stacktop(-2)); - CScriptNum bn2(stacktop(-1)); - CScriptNum bn(0); - switch (opcode) - { - case OP_ADD: - bn = bn1 + bn2; - break; - - case OP_SUB: - bn = bn1 - bn2; - break; - - case OP_BOOLAND: bn = (bn1 != bnZero && bn2 != bnZero); break; - case OP_BOOLOR: bn = (bn1 != bnZero || bn2 != bnZero); break; - case OP_NUMEQUAL: bn = (bn1 == bn2); break; - case OP_NUMEQUALVERIFY: bn = (bn1 == bn2); break; - case OP_NUMNOTEQUAL: bn = (bn1 != bn2); break; - case OP_LESSTHAN: bn = (bn1 < bn2); break; - case OP_GREATERTHAN: bn = (bn1 > bn2); break; - case OP_LESSTHANOREQUAL: bn = (bn1 <= bn2); break; - case OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break; - case OP_MIN: bn = (bn1 < bn2 ? bn1 : bn2); break; - case OP_MAX: bn = (bn1 > bn2 ? bn1 : bn2); break; - default: assert(!"invalid opcode"); break; - } - popstack(stack); - popstack(stack); - stack.push_back(bn.getvch()); - - if (opcode == OP_NUMEQUALVERIFY) - { - if (CastToBool(stacktop(-1))) - popstack(stack); - else - return false; - } - } - break; - - case OP_WITHIN: - { - // (x min max -- out) - if (stack.size() < 3) - return false; - CScriptNum bn1(stacktop(-3)); - CScriptNum bn2(stacktop(-2)); - CScriptNum bn3(stacktop(-1)); - bool fValue = (bn2 <= bn1 && bn1 < bn3); - popstack(stack); - popstack(stack); - popstack(stack); - stack.push_back(fValue ? vchTrue : vchFalse); - } - break; - - - // - // Crypto - // - case OP_RIPEMD160: - case OP_SHA1: - case OP_SHA256: - case OP_HASH160: - case OP_HASH256: - { - // (in -- hash) - if (stack.size() < 1) - return false; - valtype& vch = stacktop(-1); - valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); - if (opcode == OP_RIPEMD160) - RIPEMD160(&vch[0], vch.size(), &vchHash[0]); - else if (opcode == OP_SHA1) - SHA1(&vch[0], vch.size(), &vchHash[0]); - else if (opcode == OP_SHA256) - SHA256(&vch[0], vch.size(), &vchHash[0]); - else if (opcode == OP_HASH160) - { - uint160 hash160 = Hash160(vch); - memcpy(&vchHash[0], &hash160, sizeof(hash160)); - } - else if (opcode == OP_HASH256) - { - uint256 hash = Hash(vch.begin(), vch.end()); - memcpy(&vchHash[0], &hash, sizeof(hash)); - } - popstack(stack); - stack.push_back(vchHash); - } - break; - - case OP_CODESEPARATOR: - { - // Hash starts after the code separator - pbegincodehash = pc; - } - break; - - case OP_CHECKSIG: - case OP_CHECKSIGVERIFY: - { - // (sig pubkey -- bool) - if (stack.size() < 2) - return false; - - valtype& vchSig = stacktop(-2); - valtype& vchPubKey = stacktop(-1); - - ////// debug print - //PrintHex(vchSig.begin(), vchSig.end(), "sig: %s\n"); - //PrintHex(vchPubKey.begin(), vchPubKey.end(), "pubkey: %s\n"); - - // Subset of script starting at the most recent codeseparator - CScript scriptCode(pbegincodehash, pend); - - // Drop the signature, since there's no way for a signature to sign itself - scriptCode.FindAndDelete(CScript(vchSig)); - - if (!CheckSignatureEncoding(vchSig, flags)) { - return false; - } - - bool fSuccess = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); - - popstack(stack); - popstack(stack); - stack.push_back(fSuccess ? vchTrue : vchFalse); - if (opcode == OP_CHECKSIGVERIFY) - { - if (fSuccess) - popstack(stack); - else - return false; - } - } - break; - - case OP_CHECKMULTISIG: - case OP_CHECKMULTISIGVERIFY: - { - // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool) - - int i = 1; - if ((int)stack.size() < i) - return false; - - int nKeysCount = CScriptNum(stacktop(-i)).getint(); - if (nKeysCount < 0 || nKeysCount > 20) - return false; - nOpCount += nKeysCount; - if (nOpCount > 201) - return false; - int ikey = ++i; - i += nKeysCount; - if ((int)stack.size() < i) - return false; - - int nSigsCount = CScriptNum(stacktop(-i)).getint(); - if (nSigsCount < 0 || nSigsCount > nKeysCount) - return false; - int isig = ++i; - i += nSigsCount; - if ((int)stack.size() < i) - return false; - - // Subset of script starting at the most recent codeseparator - CScript scriptCode(pbegincodehash, pend); - - // Drop the signatures, since there's no way for a signature to sign itself - for (int k = 0; k < nSigsCount; k++) - { - valtype& vchSig = stacktop(-isig-k); - scriptCode.FindAndDelete(CScript(vchSig)); - } - - bool fSuccess = true; - while (fSuccess && nSigsCount > 0) - { - valtype& vchSig = stacktop(-isig); - valtype& vchPubKey = stacktop(-ikey); - - if (!CheckSignatureEncoding(vchSig, flags)) { - return false; - } - - // Check signature - bool fOk = IsCanonicalSignature(vchSig, flags) && IsCanonicalPubKey(vchPubKey, flags) && - CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType, flags); - - if (fOk) { - isig++; - nSigsCount--; - } - ikey++; - nKeysCount--; - - // If there are more signatures left than keys left, - // then too many signatures have failed - if (nSigsCount > nKeysCount) - fSuccess = false; - } - - while (i-- > 0) - popstack(stack); - stack.push_back(fSuccess ? vchTrue : vchFalse); - - if (opcode == OP_CHECKMULTISIGVERIFY) - { - if (fSuccess) - popstack(stack); - else - return false; - } - } - break; - - default: - return false; - } - - // Size limits - if (stack.size() + altstack.size() > 1000) - return false; - } - } - catch (...) - { - return false; - } - - - if (!vfExec.empty()) - return false; - - return true; -} - - - - - - - -namespace { -/** Wrapper that serializes like CTransaction, but with the modifications - * required for the signature hash done in-place - */ -class CTransactionSignatureSerializer { -private: - const CTransaction &txTo; // reference to the spending transaction (the one being serialized) - const CScript &scriptCode; // output script being consumed - const unsigned int nIn; // input index of txTo being signed - const bool fAnyoneCanPay; // whether the hashtype has the SIGHASH_ANYONECANPAY flag set - const bool fHashSingle; // whether the hashtype is SIGHASH_SINGLE - const bool fHashNone; // whether the hashtype is SIGHASH_NONE - -public: - CTransactionSignatureSerializer(const CTransaction &txToIn, const CScript &scriptCodeIn, unsigned int nInIn, int nHashTypeIn) : - txTo(txToIn), scriptCode(scriptCodeIn), nIn(nInIn), - fAnyoneCanPay(!!(nHashTypeIn & SIGHASH_ANYONECANPAY)), - fHashSingle((nHashTypeIn & 0x1f) == SIGHASH_SINGLE), - fHashNone((nHashTypeIn & 0x1f) == SIGHASH_NONE) {} - - /** Serialize the passed scriptCode, skipping OP_CODESEPARATORs */ - template - void SerializeScriptCode(S &s, int nType, int nVersion) const { - CScript::const_iterator it = scriptCode.begin(); - CScript::const_iterator itBegin = it; - opcodetype opcode; - unsigned int nCodeSeparators = 0; - while (scriptCode.GetOp(it, opcode)) { - if (opcode == OP_CODESEPARATOR) - nCodeSeparators++; - } - ::WriteCompactSize(s, scriptCode.size() - nCodeSeparators); - it = itBegin; - while (scriptCode.GetOp(it, opcode)) { - if (opcode == OP_CODESEPARATOR) { - s.write((char*)&itBegin[0], it-itBegin-1); - itBegin = it; - } - } - s.write((char*)&itBegin[0], it-itBegin); - } - - /** Serialize an input of txTo */ - template - void SerializeInput(S &s, unsigned int nInput, int nType, int nVersion) const { - // In case of SIGHASH_ANYONECANPAY, only the input being signed is serialized - if (fAnyoneCanPay) - nInput = nIn; - // Serialize the prevout - ::Serialize(s, txTo.vin[nInput].prevout, nType, nVersion); - // Serialize the script - if (nInput != nIn) - // Blank out other inputs' signatures - ::Serialize(s, CScript(), nType, nVersion); - else - SerializeScriptCode(s, nType, nVersion); - // Serialize the nSequence - if (nInput != nIn && (fHashSingle || fHashNone)) - // let the others update at will - ::Serialize(s, (int)0, nType, nVersion); - else - ::Serialize(s, txTo.vin[nInput].nSequence, nType, nVersion); - } - - /** Serialize an output of txTo */ - template - void SerializeOutput(S &s, unsigned int nOutput, int nType, int nVersion) const { - if (fHashSingle && nOutput != nIn) - // Do not lock-in the txout payee at other indices as txin - ::Serialize(s, CTxOut(), nType, nVersion); - else - ::Serialize(s, txTo.vout[nOutput], nType, nVersion); - } - - /** Serialize txTo */ - template - void Serialize(S &s, int nType, int nVersion) const { - // Serialize nVersion - ::Serialize(s, txTo.nVersion, nType, nVersion); - // Serialize vin - unsigned int nInputs = fAnyoneCanPay ? 1 : txTo.vin.size(); - ::WriteCompactSize(s, nInputs); - for (unsigned int nInput = 0; nInput < nInputs; nInput++) - SerializeInput(s, nInput, nType, nVersion); - // Serialize vout - unsigned int nOutputs = fHashNone ? 0 : (fHashSingle ? nIn+1 : txTo.vout.size()); - ::WriteCompactSize(s, nOutputs); - for (unsigned int nOutput = 0; nOutput < nOutputs; nOutput++) - SerializeOutput(s, nOutput, nType, nVersion); - // Serialie nLockTime - ::Serialize(s, txTo.nLockTime, nType, nVersion); - } -}; -} - -uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) -{ - if (nIn >= txTo.vin.size()) { - LogPrintf("ERROR: SignatureHash() : nIn=%d out of range\n", nIn); - return 1; - } - - // Check for invalid use of SIGHASH_SINGLE - if ((nHashType & 0x1f) == SIGHASH_SINGLE) { - if (nIn >= txTo.vout.size()) { - LogPrintf("ERROR: SignatureHash() : nOut=%d out of range\n", nIn); - return 1; - } - } - - // Wrapper to serialize only the necessary parts of the transaction being signed - CTransactionSignatureSerializer txTmp(txTo, scriptCode, nIn, nHashType); - - // Serialize and hash - CHashWriter ss(SER_GETHASH, 0); - ss << txTmp << nHashType; - return ss.GetHash(); -} - - -// Valid signature cache, to avoid doing expensive ECDSA signature checking -// twice for every transaction (once when accepted into memory pool, and -// again when accepted into the block chain) - -class CSignatureCache -{ -private: - // sigdata_type is (signature hash, signature, public key): - typedef boost::tuple, CPubKey> sigdata_type; - std::set< sigdata_type> setValid; - boost::shared_mutex cs_sigcache; - -public: - bool - Get(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) - { - boost::shared_lock lock(cs_sigcache); - - sigdata_type k(hash, vchSig, pubKey); - std::set::iterator mi = setValid.find(k); - if (mi != setValid.end()) - return true; - return false; - } - - void Set(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) - { - // DoS prevention: limit cache size to less than 10MB - // (~200 bytes per cache entry times 50,000 entries) - // Since there are a maximum of 20,000 signature operations per block - // 50,000 is a reasonable default. - int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000); - if (nMaxCacheSize <= 0) return; - - boost::unique_lock lock(cs_sigcache); - - while (static_cast(setValid.size()) > nMaxCacheSize) - { - // Evict a random entry. Random because that helps - // foil would-be DoS attackers who might try to pre-generate - // and re-use a set of valid signatures just-slightly-greater - // than our cache size. - uint256 randomHash = GetRandHash(); - std::vector unused; - std::set::iterator it = - setValid.lower_bound(sigdata_type(randomHash, unused, unused)); - if (it == setValid.end()) - it = setValid.begin(); - setValid.erase(*it); - } - - sigdata_type k(hash, vchSig, pubKey); - setValid.insert(k); - } -}; - -bool CheckSig(vector vchSig, const vector &vchPubKey, const CScript &scriptCode, - const CTransaction& txTo, unsigned int nIn, int nHashType, int flags) -{ - static CSignatureCache signatureCache; - - CPubKey pubkey(vchPubKey); - if (!pubkey.IsValid()) - return false; - - // Hash type is one byte tacked on to the end of the signature - if (vchSig.empty()) - return false; - if (nHashType == 0) - nHashType = vchSig.back(); - else if (nHashType != vchSig.back()) - return false; - vchSig.pop_back(); - - uint256 sighash = SignatureHash(scriptCode, txTo, nIn, nHashType); - - if (signatureCache.Get(sighash, vchSig, pubkey)) - return true; - - if (!pubkey.Verify(sighash, vchSig)) - return false; - - if (!(flags & SCRIPT_VERIFY_NOCACHE)) - signatureCache.Set(sighash, vchSig, pubkey); - - return true; -} - - - - - - - - - -// -// Return public keys or hashes from scriptPubKey, for 'standard' transaction types. -// -bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector >& vSolutionsRet) -{ - // Templates - static multimap mTemplates; - if (mTemplates.empty()) - { - // Standard tx, sender provides pubkey, receiver adds signature - mTemplates.insert(make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); - - // Interzone address tx, sender provides hash of pubkey, receiver provides signature and pubkey - mTemplates.insert(make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG)); - - // Sender provides N pubkeys, receivers provides M signatures - mTemplates.insert(make_pair(TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG)); - - // Empty, provably prunable, data-carrying output - mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA)); - mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN)); - } - - // Shortcut for pay-to-script-hash, which are more constrained than the other types: - // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL - if (scriptPubKey.IsPayToScriptHash()) - { - typeRet = TX_SCRIPTHASH; - vector hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22); - vSolutionsRet.push_back(hashBytes); - return true; - } - - // Scan templates - const CScript& script1 = scriptPubKey; - BOOST_FOREACH(const PAIRTYPE(txnouttype, CScript)& tplate, mTemplates) - { - const CScript& script2 = tplate.second; - vSolutionsRet.clear(); - - opcodetype opcode1, opcode2; - vector vch1, vch2; - - // Compare - CScript::const_iterator pc1 = script1.begin(); - CScript::const_iterator pc2 = script2.begin(); - while (true) - { - if (pc1 == script1.end() && pc2 == script2.end()) - { - // Found a match - typeRet = tplate.first; - if (typeRet == TX_MULTISIG) - { - // Additional checks for TX_MULTISIG: - unsigned char m = vSolutionsRet.front()[0]; - unsigned char n = vSolutionsRet.back()[0]; - if (m < 1 || n < 1 || m > n || vSolutionsRet.size()-2 != n) - return false; - } - return true; - } - if (!script1.GetOp(pc1, opcode1, vch1)) - break; - if (!script2.GetOp(pc2, opcode2, vch2)) - break; - - // Template matching opcodes: - if (opcode2 == OP_PUBKEYS) - { - while (vch1.size() >= 33 && vch1.size() <= 65) - { - vSolutionsRet.push_back(vch1); - if (!script1.GetOp(pc1, opcode1, vch1)) - break; - } - if (!script2.GetOp(pc2, opcode2, vch2)) - break; - // Normal situation is to fall through - // to other if/else statements - } - - if (opcode2 == OP_PUBKEY) - { - if (vch1.size() < 33 || vch1.size() > 65) - break; - vSolutionsRet.push_back(vch1); - } - else if (opcode2 == OP_PUBKEYHASH) - { - if (vch1.size() != sizeof(uint160)) - break; - vSolutionsRet.push_back(vch1); - } - else if (opcode2 == OP_SMALLINTEGER) - { // Single-byte small integer pushed onto vSolutions - if (opcode1 == OP_0 || - (opcode1 >= OP_1 && opcode1 <= OP_16)) - { - char n = (char)CScript::DecodeOP_N(opcode1); - vSolutionsRet.push_back(valtype(1, n)); - } - else - break; - } - else if (opcode2 == OP_SMALLDATA) - { - // small pushdata, <= MAX_OP_RETURN_RELAY bytes - if (vch1.size() > MAX_OP_RETURN_RELAY) - break; - } - else if (opcode1 != opcode2 || vch1 != vch2) - { - // Others must match exactly - break; - } - } - } - - vSolutionsRet.clear(); - typeRet = TX_NONSTANDARD; - return false; -} - - -bool Sign1(const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) -{ - CKey key; - if (!keystore.GetKey(address, key)) - return false; - - vector vchSig; - if (!key.Sign(hash, vchSig)) - return false; - vchSig.push_back((unsigned char)nHashType); - scriptSigRet << vchSig; - - return true; -} - -bool SignN(const vector& multisigdata, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) -{ - int nSigned = 0; - int nRequired = multisigdata.front()[0]; - for (unsigned int i = 1; i < multisigdata.size()-1 && nSigned < nRequired; i++) - { - const valtype& pubkey = multisigdata[i]; - CKeyID keyID = CPubKey(pubkey).GetID(); - if (Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) - ++nSigned; - } - return nSigned==nRequired; -} - -// -// Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. -// Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), -// unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. -// Returns false if scriptPubKey could not be completely satisfied. -// -bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, - CScript& scriptSigRet, txnouttype& whichTypeRet) -{ - scriptSigRet.clear(); - - vector vSolutions; - if (!Solver(scriptPubKey, whichTypeRet, vSolutions)) - return false; - - CKeyID keyID; - switch (whichTypeRet) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - return false; - case TX_PUBKEY: - keyID = CPubKey(vSolutions[0]).GetID(); - return Sign1(keyID, keystore, hash, nHashType, scriptSigRet); - case TX_PUBKEYHASH: - keyID = CKeyID(uint160(vSolutions[0])); - if (!Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) - return false; - else - { - CPubKey vch; - keystore.GetPubKey(keyID, vch); - scriptSigRet << vch; - } - return true; - case TX_SCRIPTHASH: - return keystore.GetCScript(uint160(vSolutions[0]), scriptSigRet); - - case TX_MULTISIG: - scriptSigRet << OP_0; // workaround CHECKMULTISIG bug - return (SignN(vSolutions, keystore, hash, nHashType, scriptSigRet)); - } - return false; -} - -int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions) -{ - switch (t) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - return -1; - case TX_PUBKEY: - return 1; - case TX_PUBKEYHASH: - return 2; - case TX_MULTISIG: - if (vSolutions.size() < 1 || vSolutions[0].size() < 1) - return -1; - return vSolutions[0][0] + 1; - case TX_SCRIPTHASH: - return 1; // doesn't include args needed by the script - } - return -1; -} - -bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType) -{ - vector vSolutions; - if (!Solver(scriptPubKey, whichType, vSolutions)) - return false; - - if (whichType == TX_MULTISIG) - { - unsigned char m = vSolutions.front()[0]; - unsigned char n = vSolutions.back()[0]; - // Support up to x-of-3 multisig txns as standard - if (n < 1 || n > 3) - return false; - if (m < 1 || m > n) - return false; - } - - return whichType != TX_NONSTANDARD; -} - - -unsigned int HaveKeys(const vector& pubkeys, const CKeyStore& keystore) -{ - unsigned int nResult = 0; - BOOST_FOREACH(const valtype& pubkey, pubkeys) - { - CKeyID keyID = CPubKey(pubkey).GetID(); - if (keystore.HaveKey(keyID)) - ++nResult; - } - return nResult; -} - - -class CKeyStoreIsMineVisitor : public boost::static_visitor -{ -private: - const CKeyStore *keystore; -public: - CKeyStoreIsMineVisitor(const CKeyStore *keystoreIn) : keystore(keystoreIn) { } - bool operator()(const CNoDestination &dest) const { return false; } - bool operator()(const CKeyID &keyID) const { return keystore->HaveKey(keyID); } - bool operator()(const CScriptID &scriptID) const { return keystore->HaveCScript(scriptID); } -}; - -bool IsMine(const CKeyStore &keystore, const CTxDestination &dest) -{ - return boost::apply_visitor(CKeyStoreIsMineVisitor(&keystore), dest); -} - -bool IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) -{ - vector vSolutions; - txnouttype whichType; - if (!Solver(scriptPubKey, whichType, vSolutions)) - return false; - - CKeyID keyID; - switch (whichType) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - return false; - case TX_PUBKEY: - keyID = CPubKey(vSolutions[0]).GetID(); - return keystore.HaveKey(keyID); - case TX_PUBKEYHASH: - keyID = CKeyID(uint160(vSolutions[0])); - return keystore.HaveKey(keyID); - case TX_SCRIPTHASH: - { - CScript subscript; - if (!keystore.GetCScript(CScriptID(uint160(vSolutions[0])), subscript)) - return false; - return IsMine(keystore, subscript); - } - case TX_MULTISIG: - { - // Only consider transactions "mine" if we own ALL the - // keys involved. multi-signature transactions that are - // partially owned (somebody else has a key that can spend - // them) enable spend-out-from-under-you attacks, especially - // in shared-wallet situations. - vector keys(vSolutions.begin()+1, vSolutions.begin()+vSolutions.size()-1); - return HaveKeys(keys, keystore) == keys.size(); - } - } - return false; -} - -bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) -{ - vector vSolutions; - txnouttype whichType; - if (!Solver(scriptPubKey, whichType, vSolutions)) - return false; - - if (whichType == TX_PUBKEY) - { - addressRet = CPubKey(vSolutions[0]).GetID(); - return true; - } - else if (whichType == TX_PUBKEYHASH) - { - addressRet = CKeyID(uint160(vSolutions[0])); - return true; - } - else if (whichType == TX_SCRIPTHASH) - { - addressRet = CScriptID(uint160(vSolutions[0])); - return true; - } - // Multisig txns have more than one address... - return false; -} - -bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vector& addressRet, int& nRequiredRet) -{ - addressRet.clear(); - typeRet = TX_NONSTANDARD; - vector vSolutions; - if (!Solver(scriptPubKey, typeRet, vSolutions)) - return false; - if (typeRet == TX_NULL_DATA){ - // This is data, not addresses - return false; - } - - if (typeRet == TX_MULTISIG) - { - nRequiredRet = vSolutions.front()[0]; - for (unsigned int i = 1; i < vSolutions.size()-1; i++) - { - CTxDestination address = CPubKey(vSolutions[i]).GetID(); - addressRet.push_back(address); - } - } - else - { - nRequiredRet = 1; - CTxDestination address; - if (!ExtractDestination(scriptPubKey, address)) - return false; - addressRet.push_back(address); - } - - return true; -} - -class CAffectedKeysVisitor : public boost::static_visitor { -private: - const CKeyStore &keystore; - std::vector &vKeys; - -public: - CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {} - - void Process(const CScript &script) { - txnouttype type; - std::vector vDest; - int nRequired; - if (ExtractDestinations(script, type, vDest, nRequired)) { - BOOST_FOREACH(const CTxDestination &dest, vDest) - boost::apply_visitor(*this, dest); - } - } - - void operator()(const CKeyID &keyId) { - if (keystore.HaveKey(keyId)) - vKeys.push_back(keyId); - } - - void operator()(const CScriptID &scriptId) { - CScript script; - if (keystore.GetCScript(scriptId, script)) - Process(script); - } - - void operator()(const CNoDestination &none) {} -}; - -void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys) { - CAffectedKeysVisitor(keystore, vKeys).Process(scriptPubKey); -} - -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, - unsigned int flags, int nHashType) -{ - vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, txTo, nIn, flags, nHashType)) - return false; - if (flags & SCRIPT_VERIFY_P2SH) - stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, nHashType)) - return false; - if (stack.empty()) - return false; - - if (CastToBool(stack.back()) == false) - return false; - - // Additional validation for spend-to-script-hash transactions: - if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash()) - { - if (!scriptSig.IsPushOnly()) // scriptSig must be literals-only - return false; // or validation fails - - // stackCopy cannot be empty here, because if it was the - // P2SH HASH <> EQUAL scriptPubKey would be evaluated with - // an empty stack and the EvalScript above would return false. - assert(!stackCopy.empty()); - - const valtype& pubKeySerialized = stackCopy.back(); - CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); - popstack(stackCopy); - - if (!EvalScript(stackCopy, pubKey2, txTo, nIn, flags, nHashType)) - return false; - if (stackCopy.empty()) - return false; - return CastToBool(stackCopy.back()); - } - - return true; -} - - -bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransaction& txTo, unsigned int nIn, int nHashType) -{ - assert(nIn < txTo.vin.size()); - CTxIn& txin = txTo.vin[nIn]; - - // Leave out the signature from the hash, since a signature can't sign itself. - // The checksig op will also drop the signatures from its hash. - uint256 hash = SignatureHash(fromPubKey, txTo, nIn, nHashType); - - txnouttype whichType; - if (!Solver(keystore, fromPubKey, hash, nHashType, txin.scriptSig, whichType)) - return false; - - if (whichType == TX_SCRIPTHASH) - { - // Solver returns the subscript that need to be evaluated; - // the final scriptSig is the signatures from that - // and then the serialized subscript: - CScript subscript = txin.scriptSig; - - // Recompute txn hash using subscript in place of scriptPubKey: - uint256 hash2 = SignatureHash(subscript, txTo, nIn, nHashType); - - txnouttype subType; - bool fSolved = - Solver(keystore, subscript, hash2, nHashType, txin.scriptSig, subType) && subType != TX_SCRIPTHASH; - // Append serialized subscript whether or not it is completely signed: - txin.scriptSig << static_cast(subscript); - if (!fSolved) return false; - } - - // Test solution - return VerifyScript(txin.scriptSig, fromPubKey, txTo, nIn, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0); -} - -bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType) -{ - assert(nIn < txTo.vin.size()); - CTxIn& txin = txTo.vin[nIn]; - assert(txin.prevout.n < txFrom.vout.size()); - const CTxOut& txout = txFrom.vout[txin.prevout.n]; - - return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, nHashType); -} - -static CScript PushAll(const vector& values) -{ - CScript result; - BOOST_FOREACH(const valtype& v, values) - result << v; - return result; -} - -static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, - const vector& vSolutions, - vector& sigs1, vector& sigs2) -{ - // Combine all the signatures we've got: - set allsigs; - BOOST_FOREACH(const valtype& v, sigs1) - { - if (!v.empty()) - allsigs.insert(v); - } - BOOST_FOREACH(const valtype& v, sigs2) - { - if (!v.empty()) - allsigs.insert(v); - } - - // Build a map of pubkey -> signature by matching sigs to pubkeys: - assert(vSolutions.size() > 1); - unsigned int nSigsRequired = vSolutions.front()[0]; - unsigned int nPubKeys = vSolutions.size()-2; - map sigs; - BOOST_FOREACH(const valtype& sig, allsigs) - { - for (unsigned int i = 0; i < nPubKeys; i++) - { - const valtype& pubkey = vSolutions[i+1]; - if (sigs.count(pubkey)) - continue; // Already got a sig for this pubkey - - if (CheckSig(sig, pubkey, scriptPubKey, txTo, nIn, 0, 0)) - { - sigs[pubkey] = sig; - break; - } - } - } - // Now build a merged CScript: - unsigned int nSigsHave = 0; - CScript result; result << OP_0; // pop-one-too-many workaround - for (unsigned int i = 0; i < nPubKeys && nSigsHave < nSigsRequired; i++) - { - if (sigs.count(vSolutions[i+1])) - { - result << sigs[vSolutions[i+1]]; - ++nSigsHave; - } - } - // Fill any missing with OP_0: - for (unsigned int i = nSigsHave; i < nSigsRequired; i++) - result << OP_0; - - return result; -} - -static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, - const txnouttype txType, const vector& vSolutions, - vector& sigs1, vector& sigs2) -{ - switch (txType) - { - case TX_NONSTANDARD: - case TX_NULL_DATA: - // Don't know anything about this, assume bigger one is correct: - if (sigs1.size() >= sigs2.size()) - return PushAll(sigs1); - return PushAll(sigs2); - case TX_PUBKEY: - case TX_PUBKEYHASH: - // Signatures are bigger than placeholders or empty scripts: - if (sigs1.empty() || sigs1[0].empty()) - return PushAll(sigs2); - return PushAll(sigs1); - case TX_SCRIPTHASH: - if (sigs1.empty() || sigs1.back().empty()) - return PushAll(sigs2); - else if (sigs2.empty() || sigs2.back().empty()) - return PushAll(sigs1); - else - { - // Recur to combine: - valtype spk = sigs1.back(); - CScript pubKey2(spk.begin(), spk.end()); - - txnouttype txType2; - vector > vSolutions2; - Solver(pubKey2, txType2, vSolutions2); - sigs1.pop_back(); - sigs2.pop_back(); - CScript result = CombineSignatures(pubKey2, txTo, nIn, txType2, vSolutions2, sigs1, sigs2); - result << spk; - return result; - } - case TX_MULTISIG: - return CombineMultisig(scriptPubKey, txTo, nIn, vSolutions, sigs1, sigs2); - } - - return CScript(); -} - -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, - const CScript& scriptSig1, const CScript& scriptSig2) -{ - txnouttype txType; - vector > vSolutions; - Solver(scriptPubKey, txType, vSolutions); - - vector stack1; - EvalScript(stack1, scriptSig1, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); - vector stack2; - EvalScript(stack2, scriptSig2, CTransaction(), 0, SCRIPT_VERIFY_STRICTENC, 0); - - return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); -} - -unsigned int CScript::GetSigOpCount(bool fAccurate) const -{ - unsigned int n = 0; - const_iterator pc = begin(); - opcodetype lastOpcode = OP_INVALIDOPCODE; - while (pc < end()) - { - opcodetype opcode; - if (!GetOp(pc, opcode)) - break; - if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY) - n++; - else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY) - { - if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16) - n += DecodeOP_N(lastOpcode); - else - n += 20; - } - lastOpcode = opcode; - } - return n; -} - -unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const -{ - if (!IsPayToScriptHash()) - return GetSigOpCount(true); - - // This is a pay-to-script-hash scriptPubKey; - // get the last item that the scriptSig - // pushes onto the stack: - const_iterator pc = scriptSig.begin(); - vector data; - while (pc < scriptSig.end()) - { - opcodetype opcode; - if (!scriptSig.GetOp(pc, opcode, data)) - return 0; - if (opcode > OP_16) - return 0; - } - - /// ... and return its opcount: - CScript subscript(data.begin(), data.end()); - return subscript.GetSigOpCount(true); -} - -bool CScript::IsPayToScriptHash() const -{ - // Extra-fast test for pay-to-script-hash CScripts: - return (this->size() == 23 && - this->at(0) == OP_HASH160 && - this->at(1) == 0x14 && - this->at(22) == OP_EQUAL); -} - -bool CScript::IsPushOnly() const -{ - const_iterator pc = begin(); - while (pc < end()) - { - opcodetype opcode; - if (!GetOp(pc, opcode)) - return false; - // Note that IsPushOnly() *does* consider OP_RESERVED to be a - // push-type opcode, however execution of OP_RESERVED fails, so - // it's not relevant to P2SH as the scriptSig would fail prior to - // the P2SH special validation code being executed. - if (opcode > OP_16) - return false; - } - return true; -} - -bool CScript::HasCanonicalPushes() const -{ - const_iterator pc = begin(); - while (pc < end()) - { - opcodetype opcode; - std::vector data; - if (!GetOp(pc, opcode, data)) - return false; - if (opcode > OP_16) - continue; - if (opcode < OP_PUSHDATA1 && opcode > OP_0 && (data.size() == 1 && data[0] <= 16)) - // Could have used an OP_n code, rather than a 1-byte push. - return false; - if (opcode == OP_PUSHDATA1 && data.size() < OP_PUSHDATA1) - // Could have used a normal n-byte push, rather than OP_PUSHDATA1. - return false; - if (opcode == OP_PUSHDATA2 && data.size() <= 0xFF) - // Could have used an OP_PUSHDATA1. - return false; - if (opcode == OP_PUSHDATA4 && data.size() <= 0xFFFF) - // Could have used an OP_PUSHDATA2. - return false; - } - return true; -} - -class CScriptVisitor : public boost::static_visitor -{ -private: - CScript *script; -public: - CScriptVisitor(CScript *scriptin) { script = scriptin; } - - bool operator()(const CNoDestination &dest) const { - script->clear(); - return false; - } - - bool operator()(const CKeyID &keyID) const { - script->clear(); - *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; - return true; - } - - bool operator()(const CScriptID &scriptID) const { - script->clear(); - *script << OP_HASH160 << scriptID << OP_EQUAL; - return true; - } -}; - -void CScript::SetDestination(const CTxDestination& dest) -{ - boost::apply_visitor(CScriptVisitor(this), dest); -} - -void CScript::SetMultisig(int nRequired, const std::vector& keys) -{ - this->clear(); - - *this << EncodeOP_N(nRequired); - BOOST_FOREACH(const CPubKey& key, keys) - *this << key; - *this << EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; -} - -bool CScriptCompressor::IsToKeyID(CKeyID &hash) const -{ - if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 - && script[2] == 20 && script[23] == OP_EQUALVERIFY - && script[24] == OP_CHECKSIG) { - memcpy(&hash, &script[3], 20); - return true; - } - return false; -} - -bool CScriptCompressor::IsToScriptID(CScriptID &hash) const -{ - if (script.size() == 23 && script[0] == OP_HASH160 && script[1] == 20 - && script[22] == OP_EQUAL) { - memcpy(&hash, &script[2], 20); - return true; - } - return false; -} - -bool CScriptCompressor::IsToPubKey(CPubKey &pubkey) const -{ - if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG - && (script[1] == 0x02 || script[1] == 0x03)) { - pubkey.Set(&script[1], &script[34]); - return true; - } - if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG - && script[1] == 0x04) { - pubkey.Set(&script[1], &script[66]); - return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible - } - return false; -} - -bool CScriptCompressor::Compress(std::vector &out) const -{ - CKeyID keyID; - if (IsToKeyID(keyID)) { - out.resize(21); - out[0] = 0x00; - memcpy(&out[1], &keyID, 20); - return true; - } - CScriptID scriptID; - if (IsToScriptID(scriptID)) { - out.resize(21); - out[0] = 0x01; - memcpy(&out[1], &scriptID, 20); - return true; - } - CPubKey pubkey; - if (IsToPubKey(pubkey)) { - out.resize(33); - memcpy(&out[1], &pubkey[1], 32); - if (pubkey[0] == 0x02 || pubkey[0] == 0x03) { - out[0] = pubkey[0]; - return true; - } else if (pubkey[0] == 0x04) { - out[0] = 0x04 | (pubkey[64] & 0x01); - return true; - } - } - return false; -} - -unsigned int CScriptCompressor::GetSpecialSize(unsigned int nSize) const -{ - if (nSize == 0 || nSize == 1) - return 20; - if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5) - return 32; - return 0; -} - -bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector &in) -{ - switch(nSize) { - case 0x00: - script.resize(25); - script[0] = OP_DUP; - script[1] = OP_HASH160; - script[2] = 20; - memcpy(&script[3], &in[0], 20); - script[23] = OP_EQUALVERIFY; - script[24] = OP_CHECKSIG; - return true; - case 0x01: - script.resize(23); - script[0] = OP_HASH160; - script[1] = 20; - memcpy(&script[2], &in[0], 20); - script[22] = OP_EQUAL; - return true; - case 0x02: - case 0x03: - script.resize(35); - script[0] = 33; - script[1] = nSize; - memcpy(&script[2], &in[0], 32); - script[34] = OP_CHECKSIG; - return true; - case 0x04: - case 0x05: - unsigned char vch[33] = {}; - vch[0] = nSize - 2; - memcpy(&vch[1], &in[0], 32); - CPubKey pubkey(&vch[0], &vch[33]); - if (!pubkey.Decompress()) - return false; - assert(pubkey.size() == 65); - script.resize(67); - script[0] = 65; - memcpy(&script[1], pubkey.begin(), 65); - script[66] = OP_CHECKSIG; - return true; - } - return false; -} - - -bool CScript::IsNormalPaymentScript() const -{ - if(this->size() != 25) return false; - - std::string str; - opcodetype opcode; - const_iterator pc = begin(); - int i = 0; - while (pc < end()) - { - GetOp(pc, opcode); - - if( i == 0 && opcode != OP_DUP) return false; - else if(i == 1 && opcode != OP_HASH160) return false; - else if(i == 3 && opcode != OP_EQUALVERIFY) return false; - else if(i == 4 && opcode != OP_CHECKSIG) return false; - else if(i == 5) return false; - - i++; - } - - return true; -} diff --git a/src/script/script.h b/src/script/script.h deleted file mode 100644 index 2a03c5949..000000000 --- a/src/script/script.h +++ /dev/null @@ -1,824 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef H_BITCOIN_SCRIPT -#define H_BITCOIN_SCRIPT - -#include "prevector.h" -#include "key.h" -#include "util.h" - -#include -#include -#include -#include - -#include -#include - -class CCoins; -class CKeyStore; -class CTransaction; - -static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes -static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes - -class scriptnum_error : public std::runtime_error -{ -public: - explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {} -}; - -class CScriptNum -{ -// Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers. -// The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1], -// but results may overflow (and are valid as long as they are not used in a subsequent -// numeric operation). CScriptNum enforces those semantics by storing results as -// an int64 and allowing out-of-range values to be returned as a vector of bytes but -// throwing an exception if arithmetic is done or the result is interpreted as an integer. -public: - - explicit CScriptNum(const int64_t& n) - { - m_value = n; - } - - explicit CScriptNum(const std::vector& vch) - { - if (vch.size() > nMaxNumSize) - throw scriptnum_error("CScriptNum(const std::vector&) : overflow"); - m_value = set_vch(vch); - } - - inline bool operator==(const int64_t& rhs) const { return m_value == rhs; } - inline bool operator!=(const int64_t& rhs) const { return m_value != rhs; } - inline bool operator<=(const int64_t& rhs) const { return m_value <= rhs; } - inline bool operator< (const int64_t& rhs) const { return m_value < rhs; } - inline bool operator>=(const int64_t& rhs) const { return m_value >= rhs; } - inline bool operator> (const int64_t& rhs) const { return m_value > rhs; } - - inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); } - inline bool operator!=(const CScriptNum& rhs) const { return operator!=(rhs.m_value); } - inline bool operator<=(const CScriptNum& rhs) const { return operator<=(rhs.m_value); } - inline bool operator< (const CScriptNum& rhs) const { return operator< (rhs.m_value); } - inline bool operator>=(const CScriptNum& rhs) const { return operator>=(rhs.m_value); } - inline bool operator> (const CScriptNum& rhs) const { return operator> (rhs.m_value); } - - inline CScriptNum operator+( const int64_t& rhs) const { return CScriptNum(m_value + rhs);} - inline CScriptNum operator-( const int64_t& rhs) const { return CScriptNum(m_value - rhs);} - inline CScriptNum operator+( const CScriptNum& rhs) const { return operator+(rhs.m_value); } - inline CScriptNum operator-( const CScriptNum& rhs) const { return operator-(rhs.m_value); } - - inline CScriptNum& operator+=( const CScriptNum& rhs) { return operator+=(rhs.m_value); } - inline CScriptNum& operator-=( const CScriptNum& rhs) { return operator-=(rhs.m_value); } - - inline CScriptNum operator-() const - { - assert(m_value != std::numeric_limits::min()); - return CScriptNum(-m_value); - } - - inline CScriptNum& operator=( const int64_t& rhs) - { - m_value = rhs; - return *this; - } - - inline CScriptNum& operator+=( const int64_t& rhs) - { - assert(rhs == 0 || (rhs > 0 && m_value <= std::numeric_limits::max() - rhs) || - (rhs < 0 && m_value >= std::numeric_limits::min() - rhs)); - m_value += rhs; - return *this; - } - - inline CScriptNum& operator-=( const int64_t& rhs) - { - assert(rhs == 0 || (rhs > 0 && m_value >= std::numeric_limits::min() + rhs) || - (rhs < 0 && m_value <= std::numeric_limits::max() + rhs)); - m_value -= rhs; - return *this; - } - - int getint() const - { - if (m_value > std::numeric_limits::max()) - return std::numeric_limits::max(); - else if (m_value < std::numeric_limits::min()) - return std::numeric_limits::min(); - return m_value; - } - - std::vector getvch() const - { - return serialize(m_value); - } - - static std::vector serialize(const int64_t& value) - { - if(value == 0) - return std::vector(); - - std::vector result; - const bool neg = value < 0; - uint64_t absvalue = neg ? -value : value; - - while(absvalue) - { - result.push_back(absvalue & 0xff); - absvalue >>= 8; - } - - -// - If the most significant byte is >= 0x80 and the value is positive, push a -// new zero-byte to make the significant byte < 0x80 again. - -// - If the most significant byte is >= 0x80 and the value is negative, push a -// new 0x80 byte that will be popped off when converting to an integral. - -// - If the most significant byte is < 0x80 and the value is negative, add -// 0x80 to it, since it will be subtracted and interpreted as a negative when -// converting to an integral. - - if (result.back() & 0x80) - result.push_back(neg ? 0x80 : 0); - else if (neg) - result.back() |= 0x80; - - return result; - } - - static const size_t nMaxNumSize = 4; - -private: - static int64_t set_vch(const std::vector& vch) - { - if (vch.empty()) - return 0; - - int64_t result = 0; - for (size_t i = 0; i != vch.size(); ++i) - result |= static_cast(vch[i]) << 8*i; - - // If the input vector's most significant byte is 0x80, remove it from - // the result's msb and return a negative. - if (vch.back() & 0x80) - return -(result & ~(0x80 << (8 * (vch.size() - 1)))); - - return result; - } - - int64_t m_value; -}; - -/** Signature hash types/flags */ -enum -{ - SIGHASH_ALL = 1, - SIGHASH_NONE = 2, - SIGHASH_SINGLE = 3, - SIGHASH_ANYONECANPAY = 0x80, -}; - -/** Script verification flags */ -enum -{ - SCRIPT_VERIFY_NONE = 0, - SCRIPT_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts - SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys - SCRIPT_VERIFY_EVEN_S = (1U << 2), // enforce even S values in signatures (depends on STRICTENC) - SCRIPT_VERIFY_NOCACHE = (1U << 3), // do not store results in signature cache (but do query it) - SCRIPT_VERIFY_DERSIG = (1U << 4), // enforce signature encodings as defined by BIP 66 (which is a softfork, while STRICTENC is not) -}; - -enum txnouttype -{ - TX_NONSTANDARD, - // 'standard' transaction types: - TX_PUBKEY, - TX_PUBKEYHASH, - TX_SCRIPTHASH, - TX_MULTISIG, - TX_NULL_DATA, -}; - -class CNoDestination { -public: - friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } - friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } -}; - -/** A txout script template with a specific destination. It is either: - * * CNoDestination: no destination set - * * CKeyID: TX_PUBKEYHASH destination - * * CScriptID: TX_SCRIPTHASH destination - * A CTxDestination is the internal data type encoded in a CBitcoinAddress - */ -typedef boost::variant CTxDestination; - -const char* GetTxnOutputType(txnouttype t); - -/** Script opcodes */ -enum opcodetype -{ - // push value - OP_0 = 0x00, - OP_FALSE = OP_0, - OP_PUSHDATA1 = 0x4c, - OP_PUSHDATA2 = 0x4d, - OP_PUSHDATA4 = 0x4e, - OP_1NEGATE = 0x4f, - OP_RESERVED = 0x50, - OP_1 = 0x51, - OP_TRUE=OP_1, - OP_2 = 0x52, - OP_3 = 0x53, - OP_4 = 0x54, - OP_5 = 0x55, - OP_6 = 0x56, - OP_7 = 0x57, - OP_8 = 0x58, - OP_9 = 0x59, - OP_10 = 0x5a, - OP_11 = 0x5b, - OP_12 = 0x5c, - OP_13 = 0x5d, - OP_14 = 0x5e, - OP_15 = 0x5f, - OP_16 = 0x60, - - // control - OP_NOP = 0x61, - OP_VER = 0x62, - OP_IF = 0x63, - OP_NOTIF = 0x64, - OP_VERIF = 0x65, - OP_VERNOTIF = 0x66, - OP_ELSE = 0x67, - OP_ENDIF = 0x68, - OP_VERIFY = 0x69, - OP_RETURN = 0x6a, - - // stack ops - OP_TOALTSTACK = 0x6b, - OP_FROMALTSTACK = 0x6c, - OP_2DROP = 0x6d, - OP_2DUP = 0x6e, - OP_3DUP = 0x6f, - OP_2OVER = 0x70, - OP_2ROT = 0x71, - OP_2SWAP = 0x72, - OP_IFDUP = 0x73, - OP_DEPTH = 0x74, - OP_DROP = 0x75, - OP_DUP = 0x76, - OP_NIP = 0x77, - OP_OVER = 0x78, - OP_PICK = 0x79, - OP_ROLL = 0x7a, - OP_ROT = 0x7b, - OP_SWAP = 0x7c, - OP_TUCK = 0x7d, - - // splice ops - OP_CAT = 0x7e, - OP_SUBSTR = 0x7f, - OP_LEFT = 0x80, - OP_RIGHT = 0x81, - OP_SIZE = 0x82, - - // bit logic - OP_INVERT = 0x83, - OP_AND = 0x84, - OP_OR = 0x85, - OP_XOR = 0x86, - OP_EQUAL = 0x87, - OP_EQUALVERIFY = 0x88, - OP_RESERVED1 = 0x89, - OP_RESERVED2 = 0x8a, - - // numeric - OP_1ADD = 0x8b, - OP_1SUB = 0x8c, - OP_2MUL = 0x8d, - OP_2DIV = 0x8e, - OP_NEGATE = 0x8f, - OP_ABS = 0x90, - OP_NOT = 0x91, - OP_0NOTEQUAL = 0x92, - - OP_ADD = 0x93, - OP_SUB = 0x94, - OP_MUL = 0x95, - OP_DIV = 0x96, - OP_MOD = 0x97, - OP_LSHIFT = 0x98, - OP_RSHIFT = 0x99, - - OP_BOOLAND = 0x9a, - OP_BOOLOR = 0x9b, - OP_NUMEQUAL = 0x9c, - OP_NUMEQUALVERIFY = 0x9d, - OP_NUMNOTEQUAL = 0x9e, - OP_LESSTHAN = 0x9f, - OP_GREATERTHAN = 0xa0, - OP_LESSTHANOREQUAL = 0xa1, - OP_GREATERTHANOREQUAL = 0xa2, - OP_MIN = 0xa3, - OP_MAX = 0xa4, - - OP_WITHIN = 0xa5, - - // crypto - OP_RIPEMD160 = 0xa6, - OP_SHA1 = 0xa7, - OP_SHA256 = 0xa8, - OP_HASH160 = 0xa9, - OP_HASH256 = 0xaa, - OP_CODESEPARATOR = 0xab, - OP_CHECKSIG = 0xac, - OP_CHECKSIGVERIFY = 0xad, - OP_CHECKMULTISIG = 0xae, - OP_CHECKMULTISIGVERIFY = 0xaf, - - // expansion - OP_NOP1 = 0xb0, - OP_NOP2 = 0xb1, - OP_NOP3 = 0xb2, - OP_NOP4 = 0xb3, - OP_NOP5 = 0xb4, - OP_NOP6 = 0xb5, - OP_NOP7 = 0xb6, - OP_NOP8 = 0xb7, - OP_NOP9 = 0xb8, - OP_NOP10 = 0xb9, - - - - // template matching params - OP_SMALLDATA = 0xf9, - OP_SMALLINTEGER = 0xfa, - OP_PUBKEYS = 0xfb, - OP_PUBKEYHASH = 0xfd, - OP_PUBKEY = 0xfe, - - OP_INVALIDOPCODE = 0xff, -}; - -const char* GetOpName(opcodetype opcode); - - - -inline std::string ValueString(const std::vector& vch) -{ - if (vch.size() <= 4) - return strprintf("%d", CScriptNum(vch).getint()); - else - return HexStr(vch); -} - -inline std::string StackString(const std::vector >& vStack) -{ - std::string str; - BOOST_FOREACH(const std::vector& vch, vStack) - { - if (!str.empty()) - str += " "; - str += ValueString(vch); - } - return str; -} - - - - - - -typedef prevector<28, unsigned char> CScriptBase; - -/** Serialized script, used inside transaction inputs and outputs */ -class CScript : public CScriptBase -{ -protected: - CScript& push_int64(int64_t n) - { - if (n == -1 || (n >= 1 && n <= 16)) - { - push_back(n + (OP_1 - 1)); - } - else - { - *this << CScriptNum::serialize(n); - } - return *this; - } -public: - CScript() { } - CScript(const CScript& b) : CScriptBase(b.begin(), b.end()) { } - CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { } - CScript(std::vector::const_iterator pbegin, std::vector::const_iterator pend) : CScriptBase(pbegin, pend) { } - CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { } - - CScript& operator+=(const CScript& b) - { - insert(end(), b.begin(), b.end()); - return *this; - } - - friend CScript operator+(const CScript& a, const CScript& b) - { - CScript ret = a; - ret += b; - return ret; - } - - - CScript(int64_t b) { operator<<(b); } - - explicit CScript(opcodetype b) { operator<<(b); } - explicit CScript(const uint256& b) { operator<<(b); } - explicit CScript(const CScriptNum& b) { operator<<(b); } - explicit CScript(const std::vector& b) { operator<<(b); } - - - CScript& operator<<(int64_t b) { return push_int64(b); } - - CScript& operator<<(opcodetype opcode) - { - if (opcode < 0 || opcode > 0xff) - throw std::runtime_error("CScript::operator<<() : invalid opcode"); - insert(end(), (unsigned char)opcode); - return *this; - } - - CScript& operator<<(const uint160& b) - { - insert(end(), sizeof(b)); - insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); - return *this; - } - - CScript& operator<<(const uint256& b) - { - insert(end(), sizeof(b)); - insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b)); - return *this; - } - - CScript& operator<<(const CPubKey& key) - { - assert(key.size() < OP_PUSHDATA1); - insert(end(), (unsigned char)key.size()); - insert(end(), key.begin(), key.end()); - return *this; - } - - CScript& operator<<(const CScriptNum& b) - { - *this << b.getvch(); - return *this; - } - - CScript& operator<<(const std::vector& b) - { - if (b.size() < OP_PUSHDATA1) - { - insert(end(), (unsigned char)b.size()); - } - else if (b.size() <= 0xff) - { - insert(end(), OP_PUSHDATA1); - insert(end(), (unsigned char)b.size()); - } - else if (b.size() <= 0xffff) - { - insert(end(), OP_PUSHDATA2); - unsigned short nSize = b.size(); - insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize)); - } - else - { - insert(end(), OP_PUSHDATA4); - unsigned int nSize = b.size(); - insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize)); - } - insert(end(), b.begin(), b.end()); - return *this; - } - - CScript& operator<<(const CScript& b) - { - // I'm not sure if this should push the script or concatenate scripts. - // If there's ever a use for pushing a script onto a script, delete this member fn - assert(!"Warning: Pushing a CScript onto a CScript with << is probably not intended, use + to concatenate!"); - return *this; - } - - - bool GetOp(iterator& pc, opcodetype& opcodeRet, std::vector& vchRet) - { - // Wrapper so it can be called with either iterator or const_iterator - const_iterator pc2 = pc; - bool fRet = GetOp2(pc2, opcodeRet, &vchRet); - pc = begin() + (pc2 - begin()); - return fRet; - } - - bool GetOp(iterator& pc, opcodetype& opcodeRet) - { - const_iterator pc2 = pc; - bool fRet = GetOp2(pc2, opcodeRet, NULL); - pc = begin() + (pc2 - begin()); - return fRet; - } - - bool GetOp(const_iterator& pc, opcodetype& opcodeRet, std::vector& vchRet) const - { - return GetOp2(pc, opcodeRet, &vchRet); - } - - bool GetOp(const_iterator& pc, opcodetype& opcodeRet) const - { - return GetOp2(pc, opcodeRet, NULL); - } - - bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, std::vector* pvchRet) const - { - opcodeRet = OP_INVALIDOPCODE; - if (pvchRet) - pvchRet->clear(); - if (pc >= end()) - return false; - - // Read instruction - if (end() - pc < 1) - return false; - unsigned int opcode = *pc++; - - // Immediate operand - if (opcode <= OP_PUSHDATA4) - { - unsigned int nSize = 0; - if (opcode < OP_PUSHDATA1) - { - nSize = opcode; - } - else if (opcode == OP_PUSHDATA1) - { - if (end() - pc < 1) - return false; - nSize = *pc++; - } - else if (opcode == OP_PUSHDATA2) - { - if (end() - pc < 2) - return false; - nSize = 0; - memcpy(&nSize, &pc[0], 2); - pc += 2; - } - else if (opcode == OP_PUSHDATA4) - { - if (end() - pc < 4) - return false; - memcpy(&nSize, &pc[0], 4); - pc += 4; - } - if (end() - pc < 0 || (unsigned int)(end() - pc) < nSize) - return false; - if (pvchRet) - pvchRet->assign(pc, pc + nSize); - pc += nSize; - } - - opcodeRet = (opcodetype)opcode; - return true; - } - - // Encode/decode small integers: - static int DecodeOP_N(opcodetype opcode) - { - if (opcode == OP_0) - return 0; - assert(opcode >= OP_1 && opcode <= OP_16); - return (int)opcode - (int)(OP_1 - 1); - } - static opcodetype EncodeOP_N(int n) - { - assert(n >= 0 && n <= 16); - if (n == 0) - return OP_0; - return (opcodetype)(OP_1+n-1); - } - - int FindAndDelete(const CScript& b) - { - int nFound = 0; - if (b.empty()) - return nFound; - CScript result; - iterator pc = begin(), pc2 = begin(); - opcodetype opcode; - do - { - result.insert(result.end(), pc2, pc); - while (static_cast(end() - pc) >= b.size() && std::equal(b.begin(), b.end(), pc)) - { - pc = pc + b.size(); - ++nFound; - } - pc2 = pc; - } - while (GetOp(pc, opcode)); - - if (nFound > 0) { - result.insert(result.end(), pc2, end()); - *this = result; - } - - return nFound; - } - int Find(opcodetype op) const - { - int nFound = 0; - opcodetype opcode; - for (const_iterator pc = begin(); pc != end() && GetOp(pc, opcode);) - if (opcode == op) - ++nFound; - return nFound; - } - - // Pre-version-0.6, Interzone always counted CHECKMULTISIGs - // as 20 sigops. With pay-to-script-hash, that changed: - // CHECKMULTISIGs serialized in scriptSigs are - // counted more accurately, assuming they are of the form - // ... OP_N CHECKMULTISIG ... - unsigned int GetSigOpCount(bool fAccurate) const; - - // Accurately count sigOps, including sigOps in - // pay-to-script-hash transactions: - unsigned int GetSigOpCount(const CScript& scriptSig) const; - - bool IsNormalPaymentScript() const; - bool IsPayToScriptHash() const; - - // Called by IsStandardTx and P2SH VerifyScript (which makes it consensus-critical). - bool IsPushOnly() const; - - // Called by IsStandardTx. - bool HasCanonicalPushes() const; - - // Returns whether the script is guaranteed to fail at execution, - // regardless of the initial stack. This allows outputs to be pruned - // instantly when entering the UTXO set. - bool IsUnspendable() const - { - return (size() > 0 && *begin() == OP_RETURN); - } - - void clear() - { - // The default std::vector::clear() does not release memory. - CScriptBase().swap(*this); - } - - void SetDestination(const CTxDestination& address); - void SetMultisig(int nRequired, const std::vector& keys); - - - void PrintHex() const - { - LogPrintf("CScript(%s)\n", HexStr(begin(), end(), true).c_str()); - } - - std::string ToString() const - { - std::string str; - opcodetype opcode; - std::vector vch; - const_iterator pc = begin(); - while (pc < end()) - { - if (!str.empty()) - str += " "; - if (!GetOp(pc, opcode, vch)) - { - str += "[error]"; - return str; - } - if (0 <= opcode && opcode <= OP_PUSHDATA4) - str += ValueString(vch); - else - str += GetOpName(opcode); - } - return str; - } - - void print() const - { - LogPrintf("%s\n", ToString().c_str()); - } - - CScriptID GetID() const - { - return CScriptID(Hash160(*this)); - } -}; - -/** Compact serializer for scripts. - * - * It detects common cases and encodes them much more efficiently. - * 3 special cases are defined: - * * Pay to pubkey hash (encoded as 21 bytes) - * * Pay to script hash (encoded as 21 bytes) - * * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes) - * - * Other scripts up to 121 bytes require 1 byte + script length. Above - * that, scripts up to 16505 bytes require 2 bytes + script length. - */ -class CScriptCompressor -{ -private: - // make this static for now (there are only 6 special scripts defined) - // this can potentially be extended together with a new nVersion for - // transactions, in which case this value becomes dependent on nVersion - // and nHeight of the enclosing transaction. - static const unsigned int nSpecialScripts = 6; - - CScript &script; -protected: - // These check for scripts for which a special case with a shorter encoding is defined. - // They are implemented separately from the CScript test, as these test for exact byte - // sequence correspondences, and are more strict. For example, IsToPubKey also verifies - // whether the public key is valid (as invalid ones cannot be represented in compressed - // form). - bool IsToKeyID(CKeyID &hash) const; - bool IsToScriptID(CScriptID &hash) const; - bool IsToPubKey(CPubKey &pubkey) const; - - bool Compress(std::vector &out) const; - unsigned int GetSpecialSize(unsigned int nSize) const; - bool Decompress(unsigned int nSize, const std::vector &out); -public: - CScriptCompressor(CScript &scriptIn) : script(scriptIn) { } - - unsigned int GetSerializeSize(int nType, int nVersion) const { - std::vector compr; - if (Compress(compr)) - return compr.size(); - unsigned int nSize = script.size() + nSpecialScripts; - return script.size() + VARINT(nSize).GetSerializeSize(nType, nVersion); - } - - template - void Serialize(Stream &s, int nType, int nVersion) const { - std::vector compr; - if (Compress(compr)) { - s << CFlatData(&compr[0], &compr[compr.size()]); - return; - } - unsigned int nSize = script.size() + nSpecialScripts; - s << VARINT(nSize); - s << CFlatData(&script[0], &script[script.size()]); - } - - template - void Unserialize(Stream &s, int nType, int nVersion) { - unsigned int nSize = 0; - s >> VARINT(nSize); - if (nSize < nSpecialScripts) { - std::vector vch(GetSpecialSize(nSize), 0x00); - s >> REF(CFlatData(&vch[0], &vch[vch.size()])); - Decompress(nSize, vch); - return; - } - nSize -= nSpecialScripts; - script.resize(nSize); - s >> REF(CFlatData(&script[0], &script[script.size()])); - } -}; - -bool IsCanonicalPubKey(const std::vector &vchPubKey, unsigned int flags); -bool IsCanonicalSignature(const std::vector &vchSig, unsigned int flags); - -bool EvalScript(std::vector >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); -bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); -int ScriptSigArgsExpected(txnouttype t, const std::vector >& vSolutions); -bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); -bool IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); -bool IsMine(const CKeyStore& keystore, const CTxDestination &dest); -void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector &vKeys); -bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); -bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet); -bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); -bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); - -// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, -// combine them intelligently and return the result. -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); - -#endif diff --git a/src/serialize.h b/src/serialize.h old mode 100644 new mode 100755 index 096b40669..a157048d5 --- a/src/serialize.h +++ b/src/serialize.h @@ -37,35 +37,6 @@ inline T& REF(const T& val) return const_cast(val); } -/** - * Get begin pointer of vector (non-const version). - * @note These functions avoid the undefined case of indexing into an empty - * vector, as well as that of indexing after the end of the vector. - */ -template -inline typename V::value_type* begin_ptr(V& v) -{ - return v.empty() ? NULL : &v[0]; -} -/** Get begin pointer of vector (const version) */ -template -inline const typename V::value_type* begin_ptr(const V& v) -{ - return v.empty() ? NULL : &v[0]; -} -/** Get end pointer of vector (non-const version) */ -template -inline typename V::value_type* end_ptr(V& v) -{ - return v.empty() ? NULL : (&v[0] + v.size()); -} -/** Get end pointer of vector (const version) */ -template -inline const typename V::value_type* end_ptr(const V& v) -{ - return v.empty() ? NULL : (&v[0] + v.size()); -} - ///////////////////////////////////////////////////////////////// // // Templates for serializing to anything that looks like a stream, diff --git a/src/sha256.cpp b/src/sha256.cpp deleted file mode 100644 index 5a6bfc7ea..000000000 --- a/src/sha256.cpp +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "sha256.h" -#include "common.h" - -#include -#include -#include - -#if defined(__x86_64__) || defined(__amd64__) -#if defined(EXPERIMENTAL_ASM) -#include -namespace sha256_sse4 -{ -void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks); -} -#endif -#endif - -// Internal implementation code. -namespace -{ -/// Internal SHA-256 implementation. -namespace sha256 -{ -uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); } -uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); } -uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); } -uint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); } -uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); } -uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); } - -/** One round of SHA-256. */ -void inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k, uint32_t w) -{ - uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w; - uint32_t t2 = Sigma0(a) + Maj(a, b, c); - d += t1; - h = t1 + t2; -} - -/** Initialize SHA-256 state. */ -void inline Initialize(uint32_t* s) -{ - s[0] = 0x6a09e667ul; - s[1] = 0xbb67ae85ul; - s[2] = 0x3c6ef372ul; - s[3] = 0xa54ff53aul; - s[4] = 0x510e527ful; - s[5] = 0x9b05688cul; - s[6] = 0x1f83d9abul; - s[7] = 0x5be0cd19ul; -} - -/** Perform a number of SHA-256 transformations, processing 64-byte chunks. */ -void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks) -{ - while (blocks--) { - uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7]; - uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15; - - Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0)); - Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4)); - Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8)); - Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12)); - Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16)); - Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20)); - Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24)); - Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28)); - Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32)); - Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36)); - Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40)); - Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44)); - Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48)); - Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = ReadBE32(chunk + 52)); - Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56)); - Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60)); - - Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0)); - - Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0)); - - Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1)); - Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2)); - Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3)); - Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4)); - Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5)); - Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6)); - Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7)); - Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8)); - Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9)); - Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10)); - Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11)); - Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12)); - Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13)); - Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14)); - Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15)); - Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0)); - - s[0] += a; - s[1] += b; - s[2] += c; - s[3] += d; - s[4] += e; - s[5] += f; - s[6] += g; - s[7] += h; - chunk += 64; - } -} - -} // namespace sha256 - -typedef void (*TransformType)(uint32_t*, const unsigned char*, size_t); - -bool SelfTest(TransformType tr) { - static const unsigned char in1[65] = {0, 0x80}; - static const unsigned char in2[129] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0 - }; - static const uint32_t init[8] = {0x6a09e667ul, 0xbb67ae85ul, 0x3c6ef372ul, 0xa54ff53aul, 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul}; - static const uint32_t out1[8] = {0xe3b0c442ul, 0x98fc1c14ul, 0x9afbf4c8ul, 0x996fb924ul, 0x27ae41e4ul, 0x649b934cul, 0xa495991bul, 0x7852b855ul}; - static const uint32_t out2[8] = {0xce4153b0ul, 0x147c2a86ul, 0x3ed4298eul, 0xe0676bc8ul, 0x79fc77a1ul, 0x2abe1f49ul, 0xb2b055dful, 0x1069523eul}; - uint32_t buf[8]; - memcpy(buf, init, sizeof(buf)); - // Process nothing, and check we remain in the initial state. - tr(buf, nullptr, 0); - if (memcmp(buf, init, sizeof(buf))) return false; - // Process the padded empty string (unaligned) - tr(buf, in1 + 1, 1); - if (memcmp(buf, out1, sizeof(buf))) return false; - // Process 64 spaces (unaligned) - memcpy(buf, init, sizeof(buf)); - tr(buf, in2 + 1, 2); - if (memcmp(buf, out2, sizeof(buf))) return false; - return true; -} - -TransformType Transform = sha256::Transform; - -} // namespace - -std::string SHA256AutoDetect() -{ -#if defined(EXPERIMENTAL_ASM) && (defined(__x86_64__) || defined(__amd64__)) - uint32_t eax, ebx, ecx, edx; - if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx >> 19) & 1) { - Transform = sha256_sse4::Transform; - assert(SelfTest(Transform)); - return "sse4"; - } -#endif - - assert(SelfTest(Transform)); - return "standard"; -} - -////// SHA-256 - -CSHA256::CSHA256() : bytes(0) -{ - sha256::Initialize(s); -} - -CSHA256& CSHA256::Write(const unsigned char* data, size_t len) -{ - const unsigned char* end = data + len; - size_t bufsize = bytes % 64; - if (bufsize && bufsize + len >= 64) { - // Fill the buffer, and process it. - memcpy(buf + bufsize, data, 64 - bufsize); - bytes += 64 - bufsize; - data += 64 - bufsize; - Transform(s, buf, 1); - bufsize = 0; - } - if (end - data >= 64) { - size_t blocks = (end - data) / 64; - Transform(s, data, blocks); - data += 64 * blocks; - bytes += 64 * blocks; - } - if (end > data) { - // Fill the buffer with what remains. - memcpy(buf + bufsize, data, end - data); - bytes += end - data; - } - return *this; -} - -void CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) -{ - static const unsigned char pad[64] = {0x80}; - unsigned char sizedesc[8]; - WriteBE64(sizedesc, bytes << 3); - Write(pad, 1 + ((119 - (bytes % 64)) % 64)); - Write(sizedesc, 8); - WriteBE32(hash, s[0]); - WriteBE32(hash + 4, s[1]); - WriteBE32(hash + 8, s[2]); - WriteBE32(hash + 12, s[3]); - WriteBE32(hash + 16, s[4]); - WriteBE32(hash + 20, s[5]); - WriteBE32(hash + 24, s[6]); - WriteBE32(hash + 28, s[7]); -} - -CSHA256& CSHA256::Reset() -{ - bytes = 0; - sha256::Initialize(s); - return *this; -} diff --git a/src/sha256.h b/src/sha256.h deleted file mode 100644 index aa4f3972c..000000000 --- a/src/sha256.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2014-2016 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_CRYPTO_SHA256_H -#define BITCOIN_CRYPTO_SHA256_H - -#include -#include -#include - -/** A hasher class for SHA-256. */ -class CSHA256 -{ -private: - uint32_t s[8]; - unsigned char buf[64]; - uint64_t bytes; - -public: - static const size_t OUTPUT_SIZE = 32; - - CSHA256(); - CSHA256& Write(const unsigned char* data, size_t len); - void Finalize(unsigned char hash[OUTPUT_SIZE]); - CSHA256& Reset(); -}; - -/** Autodetect the best available SHA256 implementation. - * Returns the name of the implementation. - */ -std::string SHA256AutoDetect(); - -#endif // BITCOIN_CRYPTO_SHA256_H diff --git a/src/share/certs/BitcoinFoundation_Apple_Cert.pem b/src/share/certs/BitcoinFoundation_Apple_Cert.pem old mode 100644 new mode 100755 diff --git a/src/share/certs/BitcoinFoundation_Comodo_Cert.pem b/src/share/certs/BitcoinFoundation_Comodo_Cert.pem old mode 100644 new mode 100755 diff --git a/src/share/certs/PrivateKeyNotes.md b/src/share/certs/PrivateKeyNotes.md old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/addressbook16.bmp b/src/share/pixmaps/addressbook16.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/addressbook16mask.bmp b/src/share/pixmaps/addressbook16mask.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/addressbook20.bmp b/src/share/pixmaps/addressbook20.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/addressbook20mask.bmp b/src/share/pixmaps/addressbook20mask.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/check.ico b/src/share/pixmaps/check.ico old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/send16.bmp b/src/share/pixmaps/send16.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/send16mask.bmp b/src/share/pixmaps/send16mask.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/send16masknoshadow.bmp b/src/share/pixmaps/send16masknoshadow.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/send20.bmp b/src/share/pixmaps/send20.bmp old mode 100644 new mode 100755 diff --git a/src/share/pixmaps/send20mask.bmp b/src/share/pixmaps/send20mask.bmp old mode 100644 new mode 100755 diff --git a/src/share/qt/Info.plist b/src/share/qt/Info.plist old mode 100644 new mode 100755 diff --git a/src/share/qt/Info.plist.in b/src/share/qt/Info.plist.in old mode 100644 new mode 100755 diff --git a/src/share/qt/img/reload.png b/src/share/qt/img/reload.png old mode 100644 new mode 100755 diff --git a/src/share/qt/img/reload.xcf b/src/share/qt/img/reload.xcf old mode 100644 new mode 100755 diff --git a/src/share/qt/protobuf.pri b/src/share/qt/protobuf.pri old mode 100644 new mode 100755 diff --git a/src/share/setup.nsi.in b/src/share/setup.nsi.in old mode 100644 new mode 100755 diff --git a/src/share/ui.rc b/src/share/ui.rc old mode 100644 new mode 100755 diff --git a/src/shavite.c b/src/shavite.c old mode 100644 new mode 100755 diff --git a/src/simd.c b/src/simd.c old mode 100644 new mode 100755 diff --git a/src/skein.c b/src/skein.c old mode 100644 new mode 100755 diff --git a/src/sph_blake.h b/src/sph_blake.h old mode 100644 new mode 100755 diff --git a/src/sph_bmw.h b/src/sph_bmw.h old mode 100644 new mode 100755 diff --git a/src/sph_cubehash.h b/src/sph_cubehash.h old mode 100644 new mode 100755 diff --git a/src/sph_echo.h b/src/sph_echo.h old mode 100644 new mode 100755 diff --git a/src/sph_groestl.h b/src/sph_groestl.h old mode 100644 new mode 100755 diff --git a/src/sph_jh.h b/src/sph_jh.h old mode 100644 new mode 100755 diff --git a/src/sph_keccak.h b/src/sph_keccak.h old mode 100644 new mode 100755 diff --git a/src/sph_luffa.h b/src/sph_luffa.h old mode 100644 new mode 100755 diff --git a/src/sph_shavite.h b/src/sph_shavite.h old mode 100644 new mode 100755 diff --git a/src/sph_simd.h b/src/sph_simd.h old mode 100644 new mode 100755 diff --git a/src/sph_skein.h b/src/sph_skein.h old mode 100644 new mode 100755 diff --git a/src/sph_types.h b/src/sph_types.h old mode 100644 new mode 100755 diff --git a/src/spork.cpp b/src/spork.cpp old mode 100644 new mode 100755 diff --git a/src/spork.h b/src/spork.h old mode 100644 new mode 100755 diff --git a/src/stamp-h1 b/src/stamp-h1 deleted file mode 100644 index d0955b2e2..000000000 --- a/src/stamp-h1 +++ /dev/null @@ -1 +0,0 @@ -timestamp for src/interzone-config.h diff --git a/src/support/cleanse.cpp b/src/support/cleanse.cpp deleted file mode 100644 index a2141b244..000000000 --- a/src/support/cleanse.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "cleanse.h" - -#include - -void memory_cleanse(void *ptr, size_t len) -{ - OPENSSL_cleanse(ptr, len); -} diff --git a/src/support/cleanse.h b/src/support/cleanse.h deleted file mode 100644 index 3e02aa8fd..000000000 --- a/src/support/cleanse.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_SUPPORT_CLEANSE_H -#define BITCOIN_SUPPORT_CLEANSE_H - -#include - -void memory_cleanse(void *ptr, size_t len); - -#endif // BITCOIN_SUPPORT_CLEANSE_H diff --git a/src/sync.cpp b/src/sync.cpp old mode 100644 new mode 100755 index d3c74ba67..e624a9ee8 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -59,57 +59,21 @@ static boost::thread_specific_ptr lockstack; static void potential_deadlock_detected(const std::pair& mismatch, const LockStack& s1, const LockStack& s2) { - // We attempt to not assert on probably-not deadlocks by assuming that - // a try lock will immediately have otherwise bailed if it had - // failed to get the lock - // We do this by, for the locks which triggered the potential deadlock, - // in either lockorder, checking that the second of the two which is locked - // is only a TRY_LOCK, ignoring locks if they are reentrant. - bool firstLocked = false; - bool secondLocked = false; - bool onlyMaybeDeadlock = false; - std::string strOutput = ""; - - strOutput += "POTENTIAL DEADLOCK DETECTED\n"; - strOutput += "Previous lock order was:\n"; - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, s2) { - if (i.first == mismatch.first) { - strOutput += " (1)"; - if (!firstLocked && secondLocked && i.second.fTry) - onlyMaybeDeadlock = true; - firstLocked = true; - } - if (i.first == mismatch.second) { - strOutput += " (2)"; - if (!secondLocked && firstLocked && i.second.fTry) - onlyMaybeDeadlock = true; - secondLocked = true; - } - strOutput += strprintf(" %s\n", i.second.ToString().c_str()); - } - firstLocked = false; - secondLocked = false; - strOutput += "Current lock order is:\n"; - BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, s1) { - if (i.first == mismatch.first) { - strOutput += " (1)"; - if (!firstLocked && secondLocked && i.second.fTry) - onlyMaybeDeadlock = true; - firstLocked = true; - } - if (i.first == mismatch.second) { - strOutput += " (2)"; - if (!secondLocked && firstLocked && i.second.fTry) - onlyMaybeDeadlock = true; - secondLocked = true; - } - strOutput += strprintf(" %s\n", i.second.ToString().c_str()); + LogPrintf("POTENTIAL DEADLOCK DETECTED\n"); + LogPrintf("Previous lock order was:\n"); + BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s2) + { + if (i.first == mismatch.first) LogPrintf(" (1)"); + if (i.first == mismatch.second) LogPrintf(" (2)"); + LogPrintf(" %s\n", i.second.ToString()); } - if(!onlyMaybeDeadlock) { - printf("%s\n", strOutput.c_str()); - LogPrintf("%s\n", strOutput.c_str()); + LogPrintf("Current lock order is:\n"); + BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s1) + { + if (i.first == mismatch.first) LogPrintf(" (1)"); + if (i.first == mismatch.second) LogPrintf(" (2)"); + LogPrintf(" %s\n", i.second.ToString()); } - assert(onlyMaybeDeadlock); } static void push_lock(void* c, const CLockLocation& locklocation, bool fTry) diff --git a/src/sync.h b/src/sync.h old mode 100644 new mode 100755 diff --git a/src/test/Checkpoints_tests.cpp b/src/test/Checkpoints_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/Makefile b/src/test/Makefile deleted file mode 100644 index d683cc6dc..000000000 --- a/src/test/Makefile +++ /dev/null @@ -1,1769 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# src/test/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/interzone -pkgincludedir = $(includedir)/interzone -pkglibdir = $(libdir)/interzone -pkglibexecdir = $(libexecdir)/interzone -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-apple-darwin16.1.0 -host_triplet = x86_64-apple-darwin16.1.0 -am__append_1 = \ - -I$(top_srcdir)/src/leveldb/include \ - -I$(top_srcdir)/src/leveldb/helpers/memenv -am__append_2 = $(top_builddir)/src/leveldb/libleveldb.a -am__append_3 = $(top_builddir)/src/leveldb/libmemenv.a -bin_PROGRAMS = test_interzone$(EXEEXT) -TESTS = test_interzone$(EXEEXT) -am__append_4 = $(LIBBITCOIN_WALLET) -am__append_5 = \ - accounting_tests.cpp \ - wallet_tests.cpp \ - rpc_wallet_tests.cpp - -subdir = src/test -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/src/m4/ax_boost_base.m4 \ - $(top_srcdir)/src/m4/ax_boost_chrono.m4 \ - $(top_srcdir)/src/m4/ax_boost_filesystem.m4 \ - $(top_srcdir)/src/m4/ax_boost_program_options.m4 \ - $(top_srcdir)/src/m4/ax_boost_system.m4 \ - $(top_srcdir)/src/m4/ax_boost_thread.m4 \ - $(top_srcdir)/src/m4/ax_boost_unit_test_framework.m4 \ - $(top_srcdir)/src/m4/ax_check_compile_flag.m4 \ - $(top_srcdir)/src/m4/ax_check_link_flag.m4 \ - $(top_srcdir)/src/m4/ax_check_preproc_flag.m4 \ - $(top_srcdir)/src/m4/ax_pthread.m4 \ - $(top_srcdir)/src/m4/bitcoin_find_bdb48.m4 \ - $(top_srcdir)/src/m4/bitcoin_qt.m4 \ - $(top_srcdir)/src/m4/bitcoin_subdir_to_include.m4 \ - $(top_srcdir)/pkg.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/src/interzone-config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am__test_interzone_SOURCES_DIST = alert_tests.cpp allocator_tests.cpp \ - base32_tests.cpp base58_tests.cpp base64_tests.cpp \ - bignum_tests.cpp bloom_tests.cpp canonical_tests.cpp \ - checkblock_tests.cpp Checkpoints_tests.cpp compress_tests.cpp \ - DoS_tests.cpp getarg_tests.cpp key_tests.cpp main_tests.cpp \ - miner_tests.cpp mruset_tests.cpp multisig_tests.cpp \ - netbase_tests.cpp pmt_tests.cpp rpc_tests.cpp \ - script_P2SH_tests.cpp script_tests.cpp serialize_tests.cpp \ - sigopcount_tests.cpp test_interzone.cpp transaction_tests.cpp \ - uint256_tests.cpp util_tests.cpp scriptnum_tests.cpp \ - sighash_tests.cpp data/script_valid.json \ - data/base58_keys_valid.json data/sig_canonical.json \ - data/sig_noncanonical.json data/base58_encode_decode.json \ - data/base58_keys_invalid.json data/script_invalid.json \ - data/tx_invalid.json data/tx_valid.json data/sighash.json \ - data/alertTests.raw accounting_tests.cpp wallet_tests.cpp \ - rpc_wallet_tests.cpp -am__objects_1 = -am__objects_2 = \ - test_interzone-accounting_tests.$(OBJEXT) \ - test_interzone-wallet_tests.$(OBJEXT) \ - test_interzone-rpc_wallet_tests.$(OBJEXT) -am_test_interzone_OBJECTS = test_interzone-alert_tests.$(OBJEXT) \ - test_interzone-allocator_tests.$(OBJEXT) \ - test_interzone-base32_tests.$(OBJEXT) \ - test_interzone-base58_tests.$(OBJEXT) \ - test_interzone-base64_tests.$(OBJEXT) \ - test_interzone-bignum_tests.$(OBJEXT) \ - test_interzone-bloom_tests.$(OBJEXT) \ - test_interzone-canonical_tests.$(OBJEXT) \ - test_interzone-checkblock_tests.$(OBJEXT) \ - test_interzone-Checkpoints_tests.$(OBJEXT) \ - test_interzone-compress_tests.$(OBJEXT) \ - test_interzone-DoS_tests.$(OBJEXT) \ - test_interzone-getarg_tests.$(OBJEXT) \ - test_interzone-key_tests.$(OBJEXT) \ - test_interzone-main_tests.$(OBJEXT) \ - test_interzone-miner_tests.$(OBJEXT) \ - test_interzone-mruset_tests.$(OBJEXT) \ - test_interzone-multisig_tests.$(OBJEXT) \ - test_interzone-netbase_tests.$(OBJEXT) \ - test_interzone-pmt_tests.$(OBJEXT) \ - test_interzone-rpc_tests.$(OBJEXT) \ - test_interzone-script_P2SH_tests.$(OBJEXT) \ - test_interzone-script_tests.$(OBJEXT) \ - test_interzone-serialize_tests.$(OBJEXT) \ - test_interzone-sigopcount_tests.$(OBJEXT) \ - test_interzone-test_interzone.$(OBJEXT) \ - test_interzone-transaction_tests.$(OBJEXT) \ - test_interzone-uint256_tests.$(OBJEXT) \ - test_interzone-util_tests.$(OBJEXT) \ - test_interzone-scriptnum_tests.$(OBJEXT) \ - test_interzone-sighash_tests.$(OBJEXT) $(am__objects_1) \ - $(am__objects_1) $(am__objects_2) -am__objects_3 = $(am__objects_1) $(am__objects_1) -nodist_test_interzone_OBJECTS = $(am__objects_3) -test_interzone_OBJECTS = $(am_test_interzone_OBJECTS) \ - $(nodist_test_interzone_OBJECTS) -am__DEPENDENCIES_1 = $(am__append_2) -am__DEPENDENCIES_2 = $(am__append_3) -am__DEPENDENCIES_3 = -test_interzone_DEPENDENCIES = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) \ - $(LIBBITCOIN_COMMON) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_3) $(am__append_4) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_3) -AM_V_P = $(am__v_P_$(V)) -am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I. -I$(top_builddir)/src -depcomp = $(SHELL) $(top_srcdir)/src/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -am__v_lt_1 = -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_$(V)) -am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) -am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -AM_V_CXXLD = $(am__v_CXXLD_$(V)) -am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(test_interzone_SOURCES) $(nodist_test_interzone_SOURCES) -DIST_SOURCES = $(am__test_interzone_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__recheck_rx = ^[ ]*:recheck:[ ]* -am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* -am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* -# A command that, given a newline-separated list of test names on the -# standard input, print the name of the tests that are to be re-run -# upon "make recheck". -am__list_recheck_tests = $(AWK) '{ \ - recheck = 1; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - { \ - if ((getline line2 < ($$0 ".log")) < 0) \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ - { \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ - { \ - break; \ - } \ - }; \ - if (recheck) \ - print $$0; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# A command that, given a newline-separated list of test names on the -# standard input, create the global log from their .trs and .log files. -am__create_global_log = $(AWK) ' \ -function fatal(msg) \ -{ \ - print "fatal: making $@: " msg | "cat >&2"; \ - exit 1; \ -} \ -function rst_section(header) \ -{ \ - print header; \ - len = length(header); \ - for (i = 1; i <= len; i = i + 1) \ - printf "="; \ - printf "\n\n"; \ -} \ -{ \ - copy_in_global_log = 1; \ - global_test_result = "RUN"; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".trs"); \ - if (line ~ /$(am__global_test_result_rx)/) \ - { \ - sub("$(am__global_test_result_rx)", "", line); \ - sub("[ ]*$$", "", line); \ - global_test_result = line; \ - } \ - else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ - copy_in_global_log = 0; \ - }; \ - if (copy_in_global_log) \ - { \ - rst_section(global_test_result ": " $$0); \ - while ((rc = (getline line < ($$0 ".log"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".log"); \ - print line; \ - }; \ - printf "\n"; \ - }; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# Restructured Text title. -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -# Solaris 10 'make', and several other traditional 'make' implementations, -# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it -# by disabling -e (using the XSI extension "set +e") if it's set. -am__sh_e_setup = case $$- in *e*) set +e;; esac -# Default flags passed to test drivers. -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -# To be inserted before the command running the test. Creates the -# directory for the log if needed. Stores in $dir the directory -# containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and -# passes TESTS_ENVIRONMENT. Set up options for the wrapper that -# will run the test scripts (or their associated LOG_COMPILER, if -# thy have one). -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - am__expect_failure=yes;; \ - *) \ - am__expect_failure=no;; \ -esac; \ -$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) -# A shell command to get the names of the tests scripts with any registered -# extension removed (i.e., equivalently, the names of the test logs, with -# the '.log' extension removed). The result is saved in the shell variable -# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, -# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", -# since that might cause problem with VPATH rewrites for suffix-less tests. -# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -RECHECK_LOGS = $(TEST_LOGS) -AM_RECURSIVE_TARGETS = check recheck -TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = .test -LOG_DRIVER = $(SHELL) $(top_srcdir)/src/build-aux/test-driver -LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) -am__set_b = \ - case '$@' in \ - */*) \ - case '$*' in \ - */*) b='$*';; \ - *) b=`echo '$@' | sed 's/\.log$$//'`; \ - esac;; \ - *) \ - b='$*';; \ - esac -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/src/build-aux/test-driver -TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ - $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(top_srcdir)/src/Makefile.include \ - $(top_srcdir)/src/build-aux/depcomp \ - $(top_srcdir)/src/build-aux/test-driver -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /Users/adam/makitz/src/build-aux/missing aclocal-1.15 -AMTAR = $${TAR-tar} -AM_DEFAULT_VERBOSITY = 0 -AR = /usr/bin/ar -AUTOCONF = ${SHELL} /Users/adam/makitz/src/build-aux/missing autoconf -AUTOHEADER = ${SHELL} /Users/adam/makitz/src/build-aux/missing autoheader -AUTOMAKE = ${SHELL} /Users/adam/makitz/src/build-aux/missing automake-1.15 -AWK = awk -BDB_CPPFLAGS = -BDB_LIBS = -ldb_cxx-4.8 -BOOST_CHRONO_LIB = -lboost_chrono-mt -BOOST_CPPFLAGS = -pthread -I/usr/local/include -BOOST_FILESYSTEM_LIB = -lboost_filesystem -BOOST_LDFLAGS = -L/usr/local/lib -BOOST_LIBS = -L/usr/local/lib -lboost_system -lboost_filesystem -lboost_program_options-mt -lboost_thread-mt -lboost_chrono-mt -BOOST_PROGRAM_OPTIONS_LIB = -lboost_program_options-mt -BOOST_SYSTEM_LIB = -lboost_system -BOOST_THREAD_LIB = -lboost_thread-mt -BOOST_UNIT_TEST_FRAMEWORK_LIB = -BREW = brew -BUILD_QT = -BUILD_TEST = -BUILD_TEST_QT = -CC = gcc -CCACHE = -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CLIENT_VERSION_BUILD = 0 -CLIENT_VERSION_IS_RELEASE = true -CLIENT_VERSION_MAJOR = 0 -CLIENT_VERSION_MINOR = 9 -CLIENT_VERSION_REVISION = 3 -COMPARISON_TOOL_REORG_TESTS = 0 -COPYRIGHT_YEAR = 2017 -CPP = gcc -E -CPPFLAGS = -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -I/usr/local/opt/berkeley-db@4/include -DMAC_OSX -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -CRYPTO_CFLAGS = -I/usr/local/Cellar/openssl/1.0.2l/include -CRYPTO_LIBS = -L/usr/local/Cellar/openssl/1.0.2l/lib -lcrypto -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -std=c++11 -DBOOST_NO_CXX11_SCOPED_ENUMS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -fstack-protector-all -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO_C = \c -ECHO_N = -ECHO_T = -EGREP = /usr/bin/grep -E -EVENT_CFLAGS = -I/usr/local/Cellar/libevent/2.1.8/include -EVENT_LIBS = -L/usr/local/Cellar/libevent/2.1.8/lib -levent -EVENT_PTHREADS_CFLAGS = -D_THREAD_SAFE -I/usr/local/Cellar/libevent/2.1.8/include -EVENT_PTHREADS_LIBS = -L/usr/local/Cellar/libevent/2.1.8/lib -levent_pthreads -levent -EXEEXT = -GCOV = /usr/bin/gcov -GENHTML = -GENISOIMAGE = -GIT = /usr/bin/git -GREP = /usr/bin/grep -HEXDUMP = /usr/bin/hexdump -INCLUDES = -D_THREAD_SAFE -pthread -I/usr/local/Cellar/openssl/1.0.2l/include -I/usr/local/Cellar/openssl/1.0.2l/include -INSTALL = /usr/bin/install -c -INSTALLNAMETOOL = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -JAVA = /usr/bin/java -JAVA_COMPARISON_TOOL = -LCOV = -LDFLAGS = -Wl,-dead_strip -LEVELDB_CPPFLAGS = $(am__append_1) -LEVELDB_TARGET_FLAGS = TARGET_OS=Darwin -LIBLEVELDB = $(am__append_2) -LIBMEMENV = $(am__append_3) -LIBOBJS = -LIBS = -L/usr/local/opt/berkeley-db@4/lib -L/usr/local/Cellar/openssl/1.0.2l/lib -lssl -L/usr/local/Cellar/openssl/1.0.2l/lib -lcrypto -LN_S = ln -s -LRELEASE = -LTLIBOBJS = -LUPDATE = -MAINT = -MAKEINFO = ${SHELL} /Users/adam/makitz/src/build-aux/missing makeinfo -MAKENSIS = -MKDIR_P = ../../src/build-aux/install-sh -c -d -MOC = -MOC_DEFS = -DHAVE_CONFIG_H -I$(top_srcdir)/src -OBJC = gcc -OBJCDEPMODE = depmode=gcc3 -OBJCFLAGS = -g -O2 -OBJCXX = g++ -OBJCXXDEPMODE = depmode=gcc3 -OBJCXXFLAGS = -g -O2 -std=c++11 -DBOOST_NO_CXX11_SCOPED_ENUMS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -fstack-protector-all -OBJEXT = o -OTOOL = -PACKAGE = interzone -PACKAGE_BUGREPORT = info@interzone.space -PACKAGE_NAME = Interzone Core -PACKAGE_STRING = Interzone Core 0.9.3 -PACKAGE_TARNAME = interzone -PACKAGE_URL = -PACKAGE_VERSION = 0.9.3 -PATH_SEPARATOR = : -PKG_CONFIG = /usr/local/bin/pkg-config -PKG_CONFIG_LIBDIR = -PKG_CONFIG_PATH = /usr/local/Cellar/qt/5.9.1/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig: -PORT = -PROTOBUF_CFLAGS = -PROTOBUF_LIBS = -PROTOC = -PTHREAD_CC = gcc -PTHREAD_CFLAGS = -D_THREAD_SAFE -pthread -PTHREAD_LIBS = -QR_CFLAGS = -QR_LIBS = -QT_CFLAGS = -QT_DBUS_CFLAGS = -QT_DBUS_INCLUDES = -QT_DBUS_LIBS = -QT_INCLUDES = -QT_LDFLAGS = -QT_LIBS = -QT_SELECT = qt -QT_TEST_CFLAGS = -QT_TEST_INCLUDES = -QT_TEST_LIBS = -RANLIB = /usr/bin/ranlib -RCC = -SED = /usr/bin/sed -SET_MAKE = -SHELL = /bin/sh -SSL_CFLAGS = -I/usr/local/Cellar/openssl/1.0.2l/include -SSL_LIBS = -L/usr/local/Cellar/openssl/1.0.2l/lib -lssl -STRIP = /usr/bin/strip -TESTDEFS = -UIC = -USE_QRCODE = -USE_UPNP = -VERSION = 0.9.3 -WINDOWS_BITS = -WINDRES = -XGETTEXT = -abs_builddir = /Users/adam/makitz/src/test -abs_srcdir = /Users/adam/makitz/src/test -abs_top_builddir = /Users/adam/makitz -abs_top_srcdir = /Users/adam/makitz -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_OBJC = gcc -ac_ct_OBJCXX = g++ -am__include = include -am__leading_dot = . -am__quote = -am__tar = $${TAR-tar} chof - "$$tardir" -am__untar = $${TAR-tar} xf - -ax_pthread_config = -bindir = ${exec_prefix}/bin -build = x86_64-apple-darwin16.1.0 -build_alias = -build_cpu = x86_64 -build_os = darwin16.1.0 -build_vendor = apple -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-apple-darwin16.1.0 -host_alias = -host_cpu = x86_64 -host_os = darwin16.1.0 -host_vendor = apple -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /Users/adam/makitz/src/build-aux/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = $(MKDIR_P) -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr/local -program_transform_name = s,x,x, -psdir = ${docdir} -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = . -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = ../../ -top_builddir = ../.. -top_srcdir = ../.. -AM_CPPFLAGS = $(INCLUDES) -I$(top_builddir)/src/obj $(BDB_CPPFLAGS) \ - $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) $(LEVELDB_CPPFLAGS) \ - -I$(top_srcdir)/src -AM_LDFLAGS = $(PTHREAD_CFLAGS) -LIBBITCOIN_SERVER = $(top_builddir)/src/libinterzone_server.a -LIBBITCOIN_WALLET = $(top_builddir)/src/libinterzone_wallet.a -LIBBITCOIN_COMMON = $(top_builddir)/src/libinterzone_common.a -LIBBITCOIN_CLI = $(top_builddir)/src/libinterzone_cli.a -LIBBITCOINQT = $(top_builddir)/src/qt/libinterzoneqt.a -JSON_TEST_FILES = \ - data/script_valid.json \ - data/base58_keys_valid.json \ - data/sig_canonical.json \ - data/sig_noncanonical.json \ - data/base58_encode_decode.json \ - data/base58_keys_invalid.json \ - data/script_invalid.json \ - data/tx_invalid.json \ - data/tx_valid.json \ - data/sighash.json - -RAW_TEST_FILES = data/alertTests.raw -BUILT_SOURCES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) - -# test_interzone binary # -test_interzone_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) -test_interzone_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) \ - $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) $(BOOST_LIBS) \ - $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(am__append_4) $(BDB_LIBS) \ - $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) -test_interzone_SOURCES = alert_tests.cpp allocator_tests.cpp \ - base32_tests.cpp base58_tests.cpp base64_tests.cpp \ - bignum_tests.cpp bloom_tests.cpp canonical_tests.cpp \ - checkblock_tests.cpp Checkpoints_tests.cpp compress_tests.cpp \ - DoS_tests.cpp getarg_tests.cpp key_tests.cpp main_tests.cpp \ - miner_tests.cpp mruset_tests.cpp multisig_tests.cpp \ - netbase_tests.cpp pmt_tests.cpp rpc_tests.cpp \ - script_P2SH_tests.cpp script_tests.cpp serialize_tests.cpp \ - sigopcount_tests.cpp test_interzone.cpp transaction_tests.cpp \ - uint256_tests.cpp util_tests.cpp scriptnum_tests.cpp \ - sighash_tests.cpp $(JSON_TEST_FILES) $(RAW_TEST_FILES) \ - $(am__append_5) -nodist_test_interzone_SOURCES = $(BUILT_SOURCES) -CLEANFILES = *.gcda *.gcno $(BUILT_SOURCES) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .cpp .log .mm .o .obj .rc .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/src/Makefile.include $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/test/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/test/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(top_srcdir)/src/Makefile.include $(am__empty): - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -test_interzone$(EXEEXT): $(test_interzone_OBJECTS) $(test_interzone_DEPENDENCIES) $(EXTRA_test_interzone_DEPENDENCIES) - @rm -f test_interzone$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(test_interzone_OBJECTS) $(test_interzone_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/test_interzone-Checkpoints_tests.Po -include ./$(DEPDIR)/test_interzone-DoS_tests.Po -include ./$(DEPDIR)/test_interzone-accounting_tests.Po -include ./$(DEPDIR)/test_interzone-alert_tests.Po -include ./$(DEPDIR)/test_interzone-allocator_tests.Po -include ./$(DEPDIR)/test_interzone-base32_tests.Po -include ./$(DEPDIR)/test_interzone-base58_tests.Po -include ./$(DEPDIR)/test_interzone-base64_tests.Po -include ./$(DEPDIR)/test_interzone-bignum_tests.Po -include ./$(DEPDIR)/test_interzone-bloom_tests.Po -include ./$(DEPDIR)/test_interzone-canonical_tests.Po -include ./$(DEPDIR)/test_interzone-checkblock_tests.Po -include ./$(DEPDIR)/test_interzone-compress_tests.Po -include ./$(DEPDIR)/test_interzone-getarg_tests.Po -include ./$(DEPDIR)/test_interzone-key_tests.Po -include ./$(DEPDIR)/test_interzone-main_tests.Po -include ./$(DEPDIR)/test_interzone-miner_tests.Po -include ./$(DEPDIR)/test_interzone-mruset_tests.Po -include ./$(DEPDIR)/test_interzone-multisig_tests.Po -include ./$(DEPDIR)/test_interzone-netbase_tests.Po -include ./$(DEPDIR)/test_interzone-pmt_tests.Po -include ./$(DEPDIR)/test_interzone-rpc_tests.Po -include ./$(DEPDIR)/test_interzone-rpc_wallet_tests.Po -include ./$(DEPDIR)/test_interzone-script_P2SH_tests.Po -include ./$(DEPDIR)/test_interzone-script_tests.Po -include ./$(DEPDIR)/test_interzone-scriptnum_tests.Po -include ./$(DEPDIR)/test_interzone-serialize_tests.Po -include ./$(DEPDIR)/test_interzone-sighash_tests.Po -include ./$(DEPDIR)/test_interzone-sigopcount_tests.Po -include ./$(DEPDIR)/test_interzone-test_interzone.Po -include ./$(DEPDIR)/test_interzone-transaction_tests.Po -include ./$(DEPDIR)/test_interzone-uint256_tests.Po -include ./$(DEPDIR)/test_interzone-util_tests.Po -include ./$(DEPDIR)/test_interzone-wallet_tests.Po - -.cpp.o: - $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ - $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ - $(am__mv) $$depbase.Tpo $$depbase.Po -# $(AM_V_CXX)source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: - $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ - $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ - $(am__mv) $$depbase.Tpo $$depbase.Po -# $(AM_V_CXX)source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -test_interzone-alert_tests.o: alert_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-alert_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-alert_tests.Tpo -c -o test_interzone-alert_tests.o `test -f 'alert_tests.cpp' || echo '$(srcdir)/'`alert_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-alert_tests.Tpo $(DEPDIR)/test_interzone-alert_tests.Po -# $(AM_V_CXX)source='alert_tests.cpp' object='test_interzone-alert_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-alert_tests.o `test -f 'alert_tests.cpp' || echo '$(srcdir)/'`alert_tests.cpp - -test_interzone-alert_tests.obj: alert_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-alert_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-alert_tests.Tpo -c -o test_interzone-alert_tests.obj `if test -f 'alert_tests.cpp'; then $(CYGPATH_W) 'alert_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/alert_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-alert_tests.Tpo $(DEPDIR)/test_interzone-alert_tests.Po -# $(AM_V_CXX)source='alert_tests.cpp' object='test_interzone-alert_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-alert_tests.obj `if test -f 'alert_tests.cpp'; then $(CYGPATH_W) 'alert_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/alert_tests.cpp'; fi` - -test_interzone-allocator_tests.o: allocator_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-allocator_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-allocator_tests.Tpo -c -o test_interzone-allocator_tests.o `test -f 'allocator_tests.cpp' || echo '$(srcdir)/'`allocator_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-allocator_tests.Tpo $(DEPDIR)/test_interzone-allocator_tests.Po -# $(AM_V_CXX)source='allocator_tests.cpp' object='test_interzone-allocator_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-allocator_tests.o `test -f 'allocator_tests.cpp' || echo '$(srcdir)/'`allocator_tests.cpp - -test_interzone-allocator_tests.obj: allocator_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-allocator_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-allocator_tests.Tpo -c -o test_interzone-allocator_tests.obj `if test -f 'allocator_tests.cpp'; then $(CYGPATH_W) 'allocator_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/allocator_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-allocator_tests.Tpo $(DEPDIR)/test_interzone-allocator_tests.Po -# $(AM_V_CXX)source='allocator_tests.cpp' object='test_interzone-allocator_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-allocator_tests.obj `if test -f 'allocator_tests.cpp'; then $(CYGPATH_W) 'allocator_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/allocator_tests.cpp'; fi` - -test_interzone-base32_tests.o: base32_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-base32_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-base32_tests.Tpo -c -o test_interzone-base32_tests.o `test -f 'base32_tests.cpp' || echo '$(srcdir)/'`base32_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-base32_tests.Tpo $(DEPDIR)/test_interzone-base32_tests.Po -# $(AM_V_CXX)source='base32_tests.cpp' object='test_interzone-base32_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-base32_tests.o `test -f 'base32_tests.cpp' || echo '$(srcdir)/'`base32_tests.cpp - -test_interzone-base32_tests.obj: base32_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-base32_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-base32_tests.Tpo -c -o test_interzone-base32_tests.obj `if test -f 'base32_tests.cpp'; then $(CYGPATH_W) 'base32_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/base32_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-base32_tests.Tpo $(DEPDIR)/test_interzone-base32_tests.Po -# $(AM_V_CXX)source='base32_tests.cpp' object='test_interzone-base32_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-base32_tests.obj `if test -f 'base32_tests.cpp'; then $(CYGPATH_W) 'base32_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/base32_tests.cpp'; fi` - -test_interzone-base58_tests.o: base58_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-base58_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-base58_tests.Tpo -c -o test_interzone-base58_tests.o `test -f 'base58_tests.cpp' || echo '$(srcdir)/'`base58_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-base58_tests.Tpo $(DEPDIR)/test_interzone-base58_tests.Po -# $(AM_V_CXX)source='base58_tests.cpp' object='test_interzone-base58_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-base58_tests.o `test -f 'base58_tests.cpp' || echo '$(srcdir)/'`base58_tests.cpp - -test_interzone-base58_tests.obj: base58_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-base58_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-base58_tests.Tpo -c -o test_interzone-base58_tests.obj `if test -f 'base58_tests.cpp'; then $(CYGPATH_W) 'base58_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/base58_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-base58_tests.Tpo $(DEPDIR)/test_interzone-base58_tests.Po -# $(AM_V_CXX)source='base58_tests.cpp' object='test_interzone-base58_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-base58_tests.obj `if test -f 'base58_tests.cpp'; then $(CYGPATH_W) 'base58_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/base58_tests.cpp'; fi` - -test_interzone-base64_tests.o: base64_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-base64_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-base64_tests.Tpo -c -o test_interzone-base64_tests.o `test -f 'base64_tests.cpp' || echo '$(srcdir)/'`base64_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-base64_tests.Tpo $(DEPDIR)/test_interzone-base64_tests.Po -# $(AM_V_CXX)source='base64_tests.cpp' object='test_interzone-base64_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-base64_tests.o `test -f 'base64_tests.cpp' || echo '$(srcdir)/'`base64_tests.cpp - -test_interzone-base64_tests.obj: base64_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-base64_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-base64_tests.Tpo -c -o test_interzone-base64_tests.obj `if test -f 'base64_tests.cpp'; then $(CYGPATH_W) 'base64_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/base64_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-base64_tests.Tpo $(DEPDIR)/test_interzone-base64_tests.Po -# $(AM_V_CXX)source='base64_tests.cpp' object='test_interzone-base64_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-base64_tests.obj `if test -f 'base64_tests.cpp'; then $(CYGPATH_W) 'base64_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/base64_tests.cpp'; fi` - -test_interzone-bignum_tests.o: bignum_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-bignum_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-bignum_tests.Tpo -c -o test_interzone-bignum_tests.o `test -f 'bignum_tests.cpp' || echo '$(srcdir)/'`bignum_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-bignum_tests.Tpo $(DEPDIR)/test_interzone-bignum_tests.Po -# $(AM_V_CXX)source='bignum_tests.cpp' object='test_interzone-bignum_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-bignum_tests.o `test -f 'bignum_tests.cpp' || echo '$(srcdir)/'`bignum_tests.cpp - -test_interzone-bignum_tests.obj: bignum_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-bignum_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-bignum_tests.Tpo -c -o test_interzone-bignum_tests.obj `if test -f 'bignum_tests.cpp'; then $(CYGPATH_W) 'bignum_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/bignum_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-bignum_tests.Tpo $(DEPDIR)/test_interzone-bignum_tests.Po -# $(AM_V_CXX)source='bignum_tests.cpp' object='test_interzone-bignum_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-bignum_tests.obj `if test -f 'bignum_tests.cpp'; then $(CYGPATH_W) 'bignum_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/bignum_tests.cpp'; fi` - -test_interzone-bloom_tests.o: bloom_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-bloom_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-bloom_tests.Tpo -c -o test_interzone-bloom_tests.o `test -f 'bloom_tests.cpp' || echo '$(srcdir)/'`bloom_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-bloom_tests.Tpo $(DEPDIR)/test_interzone-bloom_tests.Po -# $(AM_V_CXX)source='bloom_tests.cpp' object='test_interzone-bloom_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-bloom_tests.o `test -f 'bloom_tests.cpp' || echo '$(srcdir)/'`bloom_tests.cpp - -test_interzone-bloom_tests.obj: bloom_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-bloom_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-bloom_tests.Tpo -c -o test_interzone-bloom_tests.obj `if test -f 'bloom_tests.cpp'; then $(CYGPATH_W) 'bloom_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/bloom_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-bloom_tests.Tpo $(DEPDIR)/test_interzone-bloom_tests.Po -# $(AM_V_CXX)source='bloom_tests.cpp' object='test_interzone-bloom_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-bloom_tests.obj `if test -f 'bloom_tests.cpp'; then $(CYGPATH_W) 'bloom_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/bloom_tests.cpp'; fi` - -test_interzone-canonical_tests.o: canonical_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-canonical_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-canonical_tests.Tpo -c -o test_interzone-canonical_tests.o `test -f 'canonical_tests.cpp' || echo '$(srcdir)/'`canonical_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-canonical_tests.Tpo $(DEPDIR)/test_interzone-canonical_tests.Po -# $(AM_V_CXX)source='canonical_tests.cpp' object='test_interzone-canonical_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-canonical_tests.o `test -f 'canonical_tests.cpp' || echo '$(srcdir)/'`canonical_tests.cpp - -test_interzone-canonical_tests.obj: canonical_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-canonical_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-canonical_tests.Tpo -c -o test_interzone-canonical_tests.obj `if test -f 'canonical_tests.cpp'; then $(CYGPATH_W) 'canonical_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/canonical_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-canonical_tests.Tpo $(DEPDIR)/test_interzone-canonical_tests.Po -# $(AM_V_CXX)source='canonical_tests.cpp' object='test_interzone-canonical_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-canonical_tests.obj `if test -f 'canonical_tests.cpp'; then $(CYGPATH_W) 'canonical_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/canonical_tests.cpp'; fi` - -test_interzone-checkblock_tests.o: checkblock_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-checkblock_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-checkblock_tests.Tpo -c -o test_interzone-checkblock_tests.o `test -f 'checkblock_tests.cpp' || echo '$(srcdir)/'`checkblock_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-checkblock_tests.Tpo $(DEPDIR)/test_interzone-checkblock_tests.Po -# $(AM_V_CXX)source='checkblock_tests.cpp' object='test_interzone-checkblock_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-checkblock_tests.o `test -f 'checkblock_tests.cpp' || echo '$(srcdir)/'`checkblock_tests.cpp - -test_interzone-checkblock_tests.obj: checkblock_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-checkblock_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-checkblock_tests.Tpo -c -o test_interzone-checkblock_tests.obj `if test -f 'checkblock_tests.cpp'; then $(CYGPATH_W) 'checkblock_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/checkblock_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-checkblock_tests.Tpo $(DEPDIR)/test_interzone-checkblock_tests.Po -# $(AM_V_CXX)source='checkblock_tests.cpp' object='test_interzone-checkblock_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-checkblock_tests.obj `if test -f 'checkblock_tests.cpp'; then $(CYGPATH_W) 'checkblock_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/checkblock_tests.cpp'; fi` - -test_interzone-Checkpoints_tests.o: Checkpoints_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-Checkpoints_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-Checkpoints_tests.Tpo -c -o test_interzone-Checkpoints_tests.o `test -f 'Checkpoints_tests.cpp' || echo '$(srcdir)/'`Checkpoints_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-Checkpoints_tests.Tpo $(DEPDIR)/test_interzone-Checkpoints_tests.Po -# $(AM_V_CXX)source='Checkpoints_tests.cpp' object='test_interzone-Checkpoints_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-Checkpoints_tests.o `test -f 'Checkpoints_tests.cpp' || echo '$(srcdir)/'`Checkpoints_tests.cpp - -test_interzone-Checkpoints_tests.obj: Checkpoints_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-Checkpoints_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-Checkpoints_tests.Tpo -c -o test_interzone-Checkpoints_tests.obj `if test -f 'Checkpoints_tests.cpp'; then $(CYGPATH_W) 'Checkpoints_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/Checkpoints_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-Checkpoints_tests.Tpo $(DEPDIR)/test_interzone-Checkpoints_tests.Po -# $(AM_V_CXX)source='Checkpoints_tests.cpp' object='test_interzone-Checkpoints_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-Checkpoints_tests.obj `if test -f 'Checkpoints_tests.cpp'; then $(CYGPATH_W) 'Checkpoints_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/Checkpoints_tests.cpp'; fi` - -test_interzone-compress_tests.o: compress_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-compress_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-compress_tests.Tpo -c -o test_interzone-compress_tests.o `test -f 'compress_tests.cpp' || echo '$(srcdir)/'`compress_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-compress_tests.Tpo $(DEPDIR)/test_interzone-compress_tests.Po -# $(AM_V_CXX)source='compress_tests.cpp' object='test_interzone-compress_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-compress_tests.o `test -f 'compress_tests.cpp' || echo '$(srcdir)/'`compress_tests.cpp - -test_interzone-compress_tests.obj: compress_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-compress_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-compress_tests.Tpo -c -o test_interzone-compress_tests.obj `if test -f 'compress_tests.cpp'; then $(CYGPATH_W) 'compress_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/compress_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-compress_tests.Tpo $(DEPDIR)/test_interzone-compress_tests.Po -# $(AM_V_CXX)source='compress_tests.cpp' object='test_interzone-compress_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-compress_tests.obj `if test -f 'compress_tests.cpp'; then $(CYGPATH_W) 'compress_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/compress_tests.cpp'; fi` - -test_interzone-DoS_tests.o: DoS_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-DoS_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-DoS_tests.Tpo -c -o test_interzone-DoS_tests.o `test -f 'DoS_tests.cpp' || echo '$(srcdir)/'`DoS_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-DoS_tests.Tpo $(DEPDIR)/test_interzone-DoS_tests.Po -# $(AM_V_CXX)source='DoS_tests.cpp' object='test_interzone-DoS_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-DoS_tests.o `test -f 'DoS_tests.cpp' || echo '$(srcdir)/'`DoS_tests.cpp - -test_interzone-DoS_tests.obj: DoS_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-DoS_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-DoS_tests.Tpo -c -o test_interzone-DoS_tests.obj `if test -f 'DoS_tests.cpp'; then $(CYGPATH_W) 'DoS_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/DoS_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-DoS_tests.Tpo $(DEPDIR)/test_interzone-DoS_tests.Po -# $(AM_V_CXX)source='DoS_tests.cpp' object='test_interzone-DoS_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-DoS_tests.obj `if test -f 'DoS_tests.cpp'; then $(CYGPATH_W) 'DoS_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/DoS_tests.cpp'; fi` - -test_interzone-getarg_tests.o: getarg_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-getarg_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-getarg_tests.Tpo -c -o test_interzone-getarg_tests.o `test -f 'getarg_tests.cpp' || echo '$(srcdir)/'`getarg_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-getarg_tests.Tpo $(DEPDIR)/test_interzone-getarg_tests.Po -# $(AM_V_CXX)source='getarg_tests.cpp' object='test_interzone-getarg_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-getarg_tests.o `test -f 'getarg_tests.cpp' || echo '$(srcdir)/'`getarg_tests.cpp - -test_interzone-getarg_tests.obj: getarg_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-getarg_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-getarg_tests.Tpo -c -o test_interzone-getarg_tests.obj `if test -f 'getarg_tests.cpp'; then $(CYGPATH_W) 'getarg_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/getarg_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-getarg_tests.Tpo $(DEPDIR)/test_interzone-getarg_tests.Po -# $(AM_V_CXX)source='getarg_tests.cpp' object='test_interzone-getarg_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-getarg_tests.obj `if test -f 'getarg_tests.cpp'; then $(CYGPATH_W) 'getarg_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/getarg_tests.cpp'; fi` - -test_interzone-key_tests.o: key_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-key_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-key_tests.Tpo -c -o test_interzone-key_tests.o `test -f 'key_tests.cpp' || echo '$(srcdir)/'`key_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-key_tests.Tpo $(DEPDIR)/test_interzone-key_tests.Po -# $(AM_V_CXX)source='key_tests.cpp' object='test_interzone-key_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-key_tests.o `test -f 'key_tests.cpp' || echo '$(srcdir)/'`key_tests.cpp - -test_interzone-key_tests.obj: key_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-key_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-key_tests.Tpo -c -o test_interzone-key_tests.obj `if test -f 'key_tests.cpp'; then $(CYGPATH_W) 'key_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/key_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-key_tests.Tpo $(DEPDIR)/test_interzone-key_tests.Po -# $(AM_V_CXX)source='key_tests.cpp' object='test_interzone-key_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-key_tests.obj `if test -f 'key_tests.cpp'; then $(CYGPATH_W) 'key_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/key_tests.cpp'; fi` - -test_interzone-main_tests.o: main_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-main_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-main_tests.Tpo -c -o test_interzone-main_tests.o `test -f 'main_tests.cpp' || echo '$(srcdir)/'`main_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-main_tests.Tpo $(DEPDIR)/test_interzone-main_tests.Po -# $(AM_V_CXX)source='main_tests.cpp' object='test_interzone-main_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-main_tests.o `test -f 'main_tests.cpp' || echo '$(srcdir)/'`main_tests.cpp - -test_interzone-main_tests.obj: main_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-main_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-main_tests.Tpo -c -o test_interzone-main_tests.obj `if test -f 'main_tests.cpp'; then $(CYGPATH_W) 'main_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/main_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-main_tests.Tpo $(DEPDIR)/test_interzone-main_tests.Po -# $(AM_V_CXX)source='main_tests.cpp' object='test_interzone-main_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-main_tests.obj `if test -f 'main_tests.cpp'; then $(CYGPATH_W) 'main_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/main_tests.cpp'; fi` - -test_interzone-miner_tests.o: miner_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-miner_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-miner_tests.Tpo -c -o test_interzone-miner_tests.o `test -f 'miner_tests.cpp' || echo '$(srcdir)/'`miner_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-miner_tests.Tpo $(DEPDIR)/test_interzone-miner_tests.Po -# $(AM_V_CXX)source='miner_tests.cpp' object='test_interzone-miner_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-miner_tests.o `test -f 'miner_tests.cpp' || echo '$(srcdir)/'`miner_tests.cpp - -test_interzone-miner_tests.obj: miner_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-miner_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-miner_tests.Tpo -c -o test_interzone-miner_tests.obj `if test -f 'miner_tests.cpp'; then $(CYGPATH_W) 'miner_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/miner_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-miner_tests.Tpo $(DEPDIR)/test_interzone-miner_tests.Po -# $(AM_V_CXX)source='miner_tests.cpp' object='test_interzone-miner_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-miner_tests.obj `if test -f 'miner_tests.cpp'; then $(CYGPATH_W) 'miner_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/miner_tests.cpp'; fi` - -test_interzone-mruset_tests.o: mruset_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-mruset_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-mruset_tests.Tpo -c -o test_interzone-mruset_tests.o `test -f 'mruset_tests.cpp' || echo '$(srcdir)/'`mruset_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-mruset_tests.Tpo $(DEPDIR)/test_interzone-mruset_tests.Po -# $(AM_V_CXX)source='mruset_tests.cpp' object='test_interzone-mruset_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-mruset_tests.o `test -f 'mruset_tests.cpp' || echo '$(srcdir)/'`mruset_tests.cpp - -test_interzone-mruset_tests.obj: mruset_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-mruset_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-mruset_tests.Tpo -c -o test_interzone-mruset_tests.obj `if test -f 'mruset_tests.cpp'; then $(CYGPATH_W) 'mruset_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/mruset_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-mruset_tests.Tpo $(DEPDIR)/test_interzone-mruset_tests.Po -# $(AM_V_CXX)source='mruset_tests.cpp' object='test_interzone-mruset_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-mruset_tests.obj `if test -f 'mruset_tests.cpp'; then $(CYGPATH_W) 'mruset_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/mruset_tests.cpp'; fi` - -test_interzone-multisig_tests.o: multisig_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-multisig_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-multisig_tests.Tpo -c -o test_interzone-multisig_tests.o `test -f 'multisig_tests.cpp' || echo '$(srcdir)/'`multisig_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-multisig_tests.Tpo $(DEPDIR)/test_interzone-multisig_tests.Po -# $(AM_V_CXX)source='multisig_tests.cpp' object='test_interzone-multisig_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-multisig_tests.o `test -f 'multisig_tests.cpp' || echo '$(srcdir)/'`multisig_tests.cpp - -test_interzone-multisig_tests.obj: multisig_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-multisig_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-multisig_tests.Tpo -c -o test_interzone-multisig_tests.obj `if test -f 'multisig_tests.cpp'; then $(CYGPATH_W) 'multisig_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/multisig_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-multisig_tests.Tpo $(DEPDIR)/test_interzone-multisig_tests.Po -# $(AM_V_CXX)source='multisig_tests.cpp' object='test_interzone-multisig_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-multisig_tests.obj `if test -f 'multisig_tests.cpp'; then $(CYGPATH_W) 'multisig_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/multisig_tests.cpp'; fi` - -test_interzone-netbase_tests.o: netbase_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-netbase_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-netbase_tests.Tpo -c -o test_interzone-netbase_tests.o `test -f 'netbase_tests.cpp' || echo '$(srcdir)/'`netbase_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-netbase_tests.Tpo $(DEPDIR)/test_interzone-netbase_tests.Po -# $(AM_V_CXX)source='netbase_tests.cpp' object='test_interzone-netbase_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-netbase_tests.o `test -f 'netbase_tests.cpp' || echo '$(srcdir)/'`netbase_tests.cpp - -test_interzone-netbase_tests.obj: netbase_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-netbase_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-netbase_tests.Tpo -c -o test_interzone-netbase_tests.obj `if test -f 'netbase_tests.cpp'; then $(CYGPATH_W) 'netbase_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/netbase_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-netbase_tests.Tpo $(DEPDIR)/test_interzone-netbase_tests.Po -# $(AM_V_CXX)source='netbase_tests.cpp' object='test_interzone-netbase_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-netbase_tests.obj `if test -f 'netbase_tests.cpp'; then $(CYGPATH_W) 'netbase_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/netbase_tests.cpp'; fi` - -test_interzone-pmt_tests.o: pmt_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-pmt_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-pmt_tests.Tpo -c -o test_interzone-pmt_tests.o `test -f 'pmt_tests.cpp' || echo '$(srcdir)/'`pmt_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-pmt_tests.Tpo $(DEPDIR)/test_interzone-pmt_tests.Po -# $(AM_V_CXX)source='pmt_tests.cpp' object='test_interzone-pmt_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-pmt_tests.o `test -f 'pmt_tests.cpp' || echo '$(srcdir)/'`pmt_tests.cpp - -test_interzone-pmt_tests.obj: pmt_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-pmt_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-pmt_tests.Tpo -c -o test_interzone-pmt_tests.obj `if test -f 'pmt_tests.cpp'; then $(CYGPATH_W) 'pmt_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/pmt_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-pmt_tests.Tpo $(DEPDIR)/test_interzone-pmt_tests.Po -# $(AM_V_CXX)source='pmt_tests.cpp' object='test_interzone-pmt_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-pmt_tests.obj `if test -f 'pmt_tests.cpp'; then $(CYGPATH_W) 'pmt_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/pmt_tests.cpp'; fi` - -test_interzone-rpc_tests.o: rpc_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-rpc_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-rpc_tests.Tpo -c -o test_interzone-rpc_tests.o `test -f 'rpc_tests.cpp' || echo '$(srcdir)/'`rpc_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-rpc_tests.Tpo $(DEPDIR)/test_interzone-rpc_tests.Po -# $(AM_V_CXX)source='rpc_tests.cpp' object='test_interzone-rpc_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-rpc_tests.o `test -f 'rpc_tests.cpp' || echo '$(srcdir)/'`rpc_tests.cpp - -test_interzone-rpc_tests.obj: rpc_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-rpc_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-rpc_tests.Tpo -c -o test_interzone-rpc_tests.obj `if test -f 'rpc_tests.cpp'; then $(CYGPATH_W) 'rpc_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/rpc_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-rpc_tests.Tpo $(DEPDIR)/test_interzone-rpc_tests.Po -# $(AM_V_CXX)source='rpc_tests.cpp' object='test_interzone-rpc_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-rpc_tests.obj `if test -f 'rpc_tests.cpp'; then $(CYGPATH_W) 'rpc_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/rpc_tests.cpp'; fi` - -test_interzone-script_P2SH_tests.o: script_P2SH_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-script_P2SH_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-script_P2SH_tests.Tpo -c -o test_interzone-script_P2SH_tests.o `test -f 'script_P2SH_tests.cpp' || echo '$(srcdir)/'`script_P2SH_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-script_P2SH_tests.Tpo $(DEPDIR)/test_interzone-script_P2SH_tests.Po -# $(AM_V_CXX)source='script_P2SH_tests.cpp' object='test_interzone-script_P2SH_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-script_P2SH_tests.o `test -f 'script_P2SH_tests.cpp' || echo '$(srcdir)/'`script_P2SH_tests.cpp - -test_interzone-script_P2SH_tests.obj: script_P2SH_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-script_P2SH_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-script_P2SH_tests.Tpo -c -o test_interzone-script_P2SH_tests.obj `if test -f 'script_P2SH_tests.cpp'; then $(CYGPATH_W) 'script_P2SH_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/script_P2SH_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-script_P2SH_tests.Tpo $(DEPDIR)/test_interzone-script_P2SH_tests.Po -# $(AM_V_CXX)source='script_P2SH_tests.cpp' object='test_interzone-script_P2SH_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-script_P2SH_tests.obj `if test -f 'script_P2SH_tests.cpp'; then $(CYGPATH_W) 'script_P2SH_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/script_P2SH_tests.cpp'; fi` - -test_interzone-script_tests.o: script_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-script_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-script_tests.Tpo -c -o test_interzone-script_tests.o `test -f 'script_tests.cpp' || echo '$(srcdir)/'`script_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-script_tests.Tpo $(DEPDIR)/test_interzone-script_tests.Po -# $(AM_V_CXX)source='script_tests.cpp' object='test_interzone-script_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-script_tests.o `test -f 'script_tests.cpp' || echo '$(srcdir)/'`script_tests.cpp - -test_interzone-script_tests.obj: script_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-script_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-script_tests.Tpo -c -o test_interzone-script_tests.obj `if test -f 'script_tests.cpp'; then $(CYGPATH_W) 'script_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/script_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-script_tests.Tpo $(DEPDIR)/test_interzone-script_tests.Po -# $(AM_V_CXX)source='script_tests.cpp' object='test_interzone-script_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-script_tests.obj `if test -f 'script_tests.cpp'; then $(CYGPATH_W) 'script_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/script_tests.cpp'; fi` - -test_interzone-serialize_tests.o: serialize_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-serialize_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-serialize_tests.Tpo -c -o test_interzone-serialize_tests.o `test -f 'serialize_tests.cpp' || echo '$(srcdir)/'`serialize_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-serialize_tests.Tpo $(DEPDIR)/test_interzone-serialize_tests.Po -# $(AM_V_CXX)source='serialize_tests.cpp' object='test_interzone-serialize_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-serialize_tests.o `test -f 'serialize_tests.cpp' || echo '$(srcdir)/'`serialize_tests.cpp - -test_interzone-serialize_tests.obj: serialize_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-serialize_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-serialize_tests.Tpo -c -o test_interzone-serialize_tests.obj `if test -f 'serialize_tests.cpp'; then $(CYGPATH_W) 'serialize_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/serialize_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-serialize_tests.Tpo $(DEPDIR)/test_interzone-serialize_tests.Po -# $(AM_V_CXX)source='serialize_tests.cpp' object='test_interzone-serialize_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-serialize_tests.obj `if test -f 'serialize_tests.cpp'; then $(CYGPATH_W) 'serialize_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/serialize_tests.cpp'; fi` - -test_interzone-sigopcount_tests.o: sigopcount_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-sigopcount_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-sigopcount_tests.Tpo -c -o test_interzone-sigopcount_tests.o `test -f 'sigopcount_tests.cpp' || echo '$(srcdir)/'`sigopcount_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-sigopcount_tests.Tpo $(DEPDIR)/test_interzone-sigopcount_tests.Po -# $(AM_V_CXX)source='sigopcount_tests.cpp' object='test_interzone-sigopcount_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-sigopcount_tests.o `test -f 'sigopcount_tests.cpp' || echo '$(srcdir)/'`sigopcount_tests.cpp - -test_interzone-sigopcount_tests.obj: sigopcount_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-sigopcount_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-sigopcount_tests.Tpo -c -o test_interzone-sigopcount_tests.obj `if test -f 'sigopcount_tests.cpp'; then $(CYGPATH_W) 'sigopcount_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/sigopcount_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-sigopcount_tests.Tpo $(DEPDIR)/test_interzone-sigopcount_tests.Po -# $(AM_V_CXX)source='sigopcount_tests.cpp' object='test_interzone-sigopcount_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-sigopcount_tests.obj `if test -f 'sigopcount_tests.cpp'; then $(CYGPATH_W) 'sigopcount_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/sigopcount_tests.cpp'; fi` - -test_interzone-test_interzone.o: test_interzone.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-test_interzone.o -MD -MP -MF $(DEPDIR)/test_interzone-test_interzone.Tpo -c -o test_interzone-test_interzone.o `test -f 'test_interzone.cpp' || echo '$(srcdir)/'`test_interzone.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-test_interzone.Tpo $(DEPDIR)/test_interzone-test_interzone.Po -# $(AM_V_CXX)source='test_interzone.cpp' object='test_interzone-test_interzone.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-test_interzone.o `test -f 'test_interzone.cpp' || echo '$(srcdir)/'`test_interzone.cpp - -test_interzone-test_interzone.obj: test_interzone.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-test_interzone.obj -MD -MP -MF $(DEPDIR)/test_interzone-test_interzone.Tpo -c -o test_interzone-test_interzone.obj `if test -f 'test_interzone.cpp'; then $(CYGPATH_W) 'test_interzone.cpp'; else $(CYGPATH_W) '$(srcdir)/test_interzone.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-test_interzone.Tpo $(DEPDIR)/test_interzone-test_interzone.Po -# $(AM_V_CXX)source='test_interzone.cpp' object='test_interzone-test_interzone.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-test_interzone.obj `if test -f 'test_interzone.cpp'; then $(CYGPATH_W) 'test_interzone.cpp'; else $(CYGPATH_W) '$(srcdir)/test_interzone.cpp'; fi` - -test_interzone-transaction_tests.o: transaction_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-transaction_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-transaction_tests.Tpo -c -o test_interzone-transaction_tests.o `test -f 'transaction_tests.cpp' || echo '$(srcdir)/'`transaction_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-transaction_tests.Tpo $(DEPDIR)/test_interzone-transaction_tests.Po -# $(AM_V_CXX)source='transaction_tests.cpp' object='test_interzone-transaction_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-transaction_tests.o `test -f 'transaction_tests.cpp' || echo '$(srcdir)/'`transaction_tests.cpp - -test_interzone-transaction_tests.obj: transaction_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-transaction_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-transaction_tests.Tpo -c -o test_interzone-transaction_tests.obj `if test -f 'transaction_tests.cpp'; then $(CYGPATH_W) 'transaction_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/transaction_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-transaction_tests.Tpo $(DEPDIR)/test_interzone-transaction_tests.Po -# $(AM_V_CXX)source='transaction_tests.cpp' object='test_interzone-transaction_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-transaction_tests.obj `if test -f 'transaction_tests.cpp'; then $(CYGPATH_W) 'transaction_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/transaction_tests.cpp'; fi` - -test_interzone-uint256_tests.o: uint256_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-uint256_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-uint256_tests.Tpo -c -o test_interzone-uint256_tests.o `test -f 'uint256_tests.cpp' || echo '$(srcdir)/'`uint256_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-uint256_tests.Tpo $(DEPDIR)/test_interzone-uint256_tests.Po -# $(AM_V_CXX)source='uint256_tests.cpp' object='test_interzone-uint256_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-uint256_tests.o `test -f 'uint256_tests.cpp' || echo '$(srcdir)/'`uint256_tests.cpp - -test_interzone-uint256_tests.obj: uint256_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-uint256_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-uint256_tests.Tpo -c -o test_interzone-uint256_tests.obj `if test -f 'uint256_tests.cpp'; then $(CYGPATH_W) 'uint256_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/uint256_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-uint256_tests.Tpo $(DEPDIR)/test_interzone-uint256_tests.Po -# $(AM_V_CXX)source='uint256_tests.cpp' object='test_interzone-uint256_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-uint256_tests.obj `if test -f 'uint256_tests.cpp'; then $(CYGPATH_W) 'uint256_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/uint256_tests.cpp'; fi` - -test_interzone-util_tests.o: util_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-util_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-util_tests.Tpo -c -o test_interzone-util_tests.o `test -f 'util_tests.cpp' || echo '$(srcdir)/'`util_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-util_tests.Tpo $(DEPDIR)/test_interzone-util_tests.Po -# $(AM_V_CXX)source='util_tests.cpp' object='test_interzone-util_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-util_tests.o `test -f 'util_tests.cpp' || echo '$(srcdir)/'`util_tests.cpp - -test_interzone-util_tests.obj: util_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-util_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-util_tests.Tpo -c -o test_interzone-util_tests.obj `if test -f 'util_tests.cpp'; then $(CYGPATH_W) 'util_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/util_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-util_tests.Tpo $(DEPDIR)/test_interzone-util_tests.Po -# $(AM_V_CXX)source='util_tests.cpp' object='test_interzone-util_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-util_tests.obj `if test -f 'util_tests.cpp'; then $(CYGPATH_W) 'util_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/util_tests.cpp'; fi` - -test_interzone-scriptnum_tests.o: scriptnum_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-scriptnum_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-scriptnum_tests.Tpo -c -o test_interzone-scriptnum_tests.o `test -f 'scriptnum_tests.cpp' || echo '$(srcdir)/'`scriptnum_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-scriptnum_tests.Tpo $(DEPDIR)/test_interzone-scriptnum_tests.Po -# $(AM_V_CXX)source='scriptnum_tests.cpp' object='test_interzone-scriptnum_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-scriptnum_tests.o `test -f 'scriptnum_tests.cpp' || echo '$(srcdir)/'`scriptnum_tests.cpp - -test_interzone-scriptnum_tests.obj: scriptnum_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-scriptnum_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-scriptnum_tests.Tpo -c -o test_interzone-scriptnum_tests.obj `if test -f 'scriptnum_tests.cpp'; then $(CYGPATH_W) 'scriptnum_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/scriptnum_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-scriptnum_tests.Tpo $(DEPDIR)/test_interzone-scriptnum_tests.Po -# $(AM_V_CXX)source='scriptnum_tests.cpp' object='test_interzone-scriptnum_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-scriptnum_tests.obj `if test -f 'scriptnum_tests.cpp'; then $(CYGPATH_W) 'scriptnum_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/scriptnum_tests.cpp'; fi` - -test_interzone-sighash_tests.o: sighash_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-sighash_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-sighash_tests.Tpo -c -o test_interzone-sighash_tests.o `test -f 'sighash_tests.cpp' || echo '$(srcdir)/'`sighash_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-sighash_tests.Tpo $(DEPDIR)/test_interzone-sighash_tests.Po -# $(AM_V_CXX)source='sighash_tests.cpp' object='test_interzone-sighash_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-sighash_tests.o `test -f 'sighash_tests.cpp' || echo '$(srcdir)/'`sighash_tests.cpp - -test_interzone-sighash_tests.obj: sighash_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-sighash_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-sighash_tests.Tpo -c -o test_interzone-sighash_tests.obj `if test -f 'sighash_tests.cpp'; then $(CYGPATH_W) 'sighash_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/sighash_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-sighash_tests.Tpo $(DEPDIR)/test_interzone-sighash_tests.Po -# $(AM_V_CXX)source='sighash_tests.cpp' object='test_interzone-sighash_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-sighash_tests.obj `if test -f 'sighash_tests.cpp'; then $(CYGPATH_W) 'sighash_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/sighash_tests.cpp'; fi` - -test_interzone-accounting_tests.o: accounting_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-accounting_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-accounting_tests.Tpo -c -o test_interzone-accounting_tests.o `test -f 'accounting_tests.cpp' || echo '$(srcdir)/'`accounting_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-accounting_tests.Tpo $(DEPDIR)/test_interzone-accounting_tests.Po -# $(AM_V_CXX)source='accounting_tests.cpp' object='test_interzone-accounting_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-accounting_tests.o `test -f 'accounting_tests.cpp' || echo '$(srcdir)/'`accounting_tests.cpp - -test_interzone-accounting_tests.obj: accounting_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-accounting_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-accounting_tests.Tpo -c -o test_interzone-accounting_tests.obj `if test -f 'accounting_tests.cpp'; then $(CYGPATH_W) 'accounting_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/accounting_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-accounting_tests.Tpo $(DEPDIR)/test_interzone-accounting_tests.Po -# $(AM_V_CXX)source='accounting_tests.cpp' object='test_interzone-accounting_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-accounting_tests.obj `if test -f 'accounting_tests.cpp'; then $(CYGPATH_W) 'accounting_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/accounting_tests.cpp'; fi` - -test_interzone-wallet_tests.o: wallet_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-wallet_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-wallet_tests.Tpo -c -o test_interzone-wallet_tests.o `test -f 'wallet_tests.cpp' || echo '$(srcdir)/'`wallet_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-wallet_tests.Tpo $(DEPDIR)/test_interzone-wallet_tests.Po -# $(AM_V_CXX)source='wallet_tests.cpp' object='test_interzone-wallet_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-wallet_tests.o `test -f 'wallet_tests.cpp' || echo '$(srcdir)/'`wallet_tests.cpp - -test_interzone-wallet_tests.obj: wallet_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-wallet_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-wallet_tests.Tpo -c -o test_interzone-wallet_tests.obj `if test -f 'wallet_tests.cpp'; then $(CYGPATH_W) 'wallet_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/wallet_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-wallet_tests.Tpo $(DEPDIR)/test_interzone-wallet_tests.Po -# $(AM_V_CXX)source='wallet_tests.cpp' object='test_interzone-wallet_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-wallet_tests.obj `if test -f 'wallet_tests.cpp'; then $(CYGPATH_W) 'wallet_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/wallet_tests.cpp'; fi` - -test_interzone-rpc_wallet_tests.o: rpc_wallet_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-rpc_wallet_tests.o -MD -MP -MF $(DEPDIR)/test_interzone-rpc_wallet_tests.Tpo -c -o test_interzone-rpc_wallet_tests.o `test -f 'rpc_wallet_tests.cpp' || echo '$(srcdir)/'`rpc_wallet_tests.cpp - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-rpc_wallet_tests.Tpo $(DEPDIR)/test_interzone-rpc_wallet_tests.Po -# $(AM_V_CXX)source='rpc_wallet_tests.cpp' object='test_interzone-rpc_wallet_tests.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-rpc_wallet_tests.o `test -f 'rpc_wallet_tests.cpp' || echo '$(srcdir)/'`rpc_wallet_tests.cpp - -test_interzone-rpc_wallet_tests.obj: rpc_wallet_tests.cpp - $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_interzone-rpc_wallet_tests.obj -MD -MP -MF $(DEPDIR)/test_interzone-rpc_wallet_tests.Tpo -c -o test_interzone-rpc_wallet_tests.obj `if test -f 'rpc_wallet_tests.cpp'; then $(CYGPATH_W) 'rpc_wallet_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/rpc_wallet_tests.cpp'; fi` - $(AM_V_at)$(am__mv) $(DEPDIR)/test_interzone-rpc_wallet_tests.Tpo $(DEPDIR)/test_interzone-rpc_wallet_tests.Po -# $(AM_V_CXX)source='rpc_wallet_tests.cpp' object='test_interzone-rpc_wallet_tests.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(AM_V_CXX_no)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_interzone_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_interzone-rpc_wallet_tests.obj `if test -f 'rpc_wallet_tests.cpp'; then $(CYGPATH_W) 'rpc_wallet_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/rpc_wallet_tests.cpp'; fi` - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< - -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: - -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - elif test -n "$$redo_logs"; then \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 - -check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -test_interzone.log: test_interzone$(EXEEXT) - @p='test_interzone$(EXEEXT)'; \ - b='test_interzone'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -.test.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -#.test$(EXEEXT).log: -# @p='$<'; \ -# $(am__set_b); \ -# $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ -# --log-file $$b.log --trs-file $$b.trs \ -# $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ -# "$$tst" $(AM_TESTS_FD_REDIRECT) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: all check check-am install install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-binPROGRAMS install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS - -.PRECIOUS: Makefile - - -$(LIBBITCOIN): - $(MAKE) -C $(top_builddir)/src $(@F) - -$(LIBLEVELDB) $(LIBMEMENV): - $(MAKE) -C $(top_builddir)/src leveldb/$(@F) - -$(LIBBITCOINQT): - $(MAKE) -C $(top_builddir)/src/qt $(@F) - -.mm.o: - $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< - -.rc.o: - @test -f $(WINDRES) && $(WINDRES) -i $< -o $@ || \ - echo error: could not build $@ - -ui_%.h: %.ui - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ - $(SED) -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - -%.moc: %.cpp - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -moc_%.cpp: %.h - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -%.qm: %.ts - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ - echo error: could not build $(abs_builddir)/$@ - -%.pb.cc %.pb.h: %.proto - test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $@ - @echo "static unsigned const char $(*F)[] = {" >> $@ - @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ - @echo "};};" >> $@ - @echo "Generated $@" - -%.raw.h: %.raw - @$(MKDIR_P) $(@D) - @echo "namespace alert_tests{" > $@ - @echo "static unsigned const char $(*F)[] = {" >> $@ - @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ - @echo "};};" >> $@ - @echo "Generated $@" - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/test/Makefile.am b/src/test/Makefile.am old mode 100644 new mode 100755 index 8c7feb3ed..9db80767f --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -29,7 +29,7 @@ test_interzone_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMO if ENABLE_WALLET test_interzone_LDADD += $(LIBBITCOIN_WALLET) endif -test_interzone_LDADD += $(BDB_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) +test_interzone_LDADD += $(BDB_LIBS) test_interzone_SOURCES = \ alert_tests.cpp \ diff --git a/src/test/README.md b/src/test/README.md old mode 100644 new mode 100755 diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/base64_tests.cpp b/src/test/base64_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/bip32_tests.cpp b/src/test/bip32_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/canonical_tests.cpp b/src/test/canonical_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/compress_tests.cpp b/src/test/compress_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/data/README.md b/src/test/data/README.md old mode 100644 new mode 100755 diff --git a/src/test/data/alertTests.raw b/src/test/data/alertTests.raw old mode 100644 new mode 100755 diff --git a/src/test/data/base58_encode_decode.json b/src/test/data/base58_encode_decode.json old mode 100644 new mode 100755 diff --git a/src/test/data/base58_keys_invalid.json b/src/test/data/base58_keys_invalid.json old mode 100644 new mode 100755 diff --git a/src/test/data/base58_keys_valid.json b/src/test/data/base58_keys_valid.json old mode 100644 new mode 100755 diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json old mode 100644 new mode 100755 diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json old mode 100644 new mode 100755 diff --git a/src/test/data/sig_canonical.json b/src/test/data/sig_canonical.json old mode 100644 new mode 100755 diff --git a/src/test/data/sig_noncanonical.json b/src/test/data/sig_noncanonical.json old mode 100644 new mode 100755 diff --git a/src/test/data/sighash.json b/src/test/data/sighash.json old mode 100644 new mode 100755 diff --git a/src/test/data/tx_invalid.json b/src/test/data/tx_invalid.json old mode 100644 new mode 100755 diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json old mode 100644 new mode 100755 diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/hmac_tests.cpp b/src/test/hmac_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/mruset_tests.cpp b/src/test/mruset_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/netbase_tests.cpp b/src/test/netbase_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/test_darkcoin.cpp b/src/test/test_darkcoin.cpp old mode 100644 new mode 100755 diff --git a/src/test/test_chaincoin.cpp b/src/test/test_interzone.cpp old mode 100644 new mode 100755 similarity index 100% rename from src/test/test_chaincoin.cpp rename to src/test/test_interzone.cpp diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp old mode 100644 new mode 100755 diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp old mode 100644 new mode 100755 index b60555faa..5155e0c3e --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -3,15 +3,13 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" -#include "random.h" + #include "sync.h" #include #include #include -#include -#include using namespace std; @@ -315,21 +313,21 @@ BOOST_AUTO_TEST_CASE(strprintf_numbers) { int64_t s64t = -9223372036854775807LL; /* signed 64 bit test value */ uint64_t u64t = 18446744073709551615ULL; /* unsigned 64 bit test value */ - BOOST_CHECK(strprintf("%s %d %s", B, s64t, E) == B" -9223372036854775807 " E); - BOOST_CHECK(strprintf("%s %u %s", B, u64t, E) == B" 18446744073709551615 " E); - BOOST_CHECK(strprintf("%s %x %s", B, u64t, E) == B" ffffffffffffffff " E); + BOOST_CHECK(strprintf("%s %d %s", B, s64t, E) == B" -9223372036854775807 "E); + BOOST_CHECK(strprintf("%s %u %s", B, u64t, E) == B" 18446744073709551615 "E); + BOOST_CHECK(strprintf("%s %x %s", B, u64t, E) == B" ffffffffffffffff "E); size_t st = 12345678; /* unsigned size_t test value */ ssize_t sst = -12345678; /* signed size_t test value */ - BOOST_CHECK(strprintf("%s %d %s", B, sst, E) == B" -12345678 " E); - BOOST_CHECK(strprintf("%s %u %s", B, st, E) == B" 12345678 " E); - BOOST_CHECK(strprintf("%s %x %s", B, st, E) == B" bc614e " E); + BOOST_CHECK(strprintf("%s %d %s", B, sst, E) == B" -12345678 "E); + BOOST_CHECK(strprintf("%s %u %s", B, st, E) == B" 12345678 "E); + BOOST_CHECK(strprintf("%s %x %s", B, st, E) == B" bc614e "E); ptrdiff_t pt = 87654321; /* positive ptrdiff_t test value */ ptrdiff_t spt = -87654321; /* negative ptrdiff_t test value */ - BOOST_CHECK(strprintf("%s %d %s", B, spt, E) == B" -87654321 " E); - BOOST_CHECK(strprintf("%s %u %s", B, pt, E) == B" 87654321 " E); - BOOST_CHECK(strprintf("%s %x %s", B, pt, E) == B" 5397fb1 " E); + BOOST_CHECK(strprintf("%s %d %s", B, spt, E) == B" -87654321 "E); + BOOST_CHECK(strprintf("%s %u %s", B, pt, E) == B" 87654321 "E); + BOOST_CHECK(strprintf("%s %x %s", B, pt, E) == B" 5397fb1 "E); } #undef B #undef E @@ -342,23 +340,4 @@ BOOST_AUTO_TEST_CASE(gettime) BOOST_CHECK((GetTime() & ~0xFFFFFFFFLL) == 0); } -BOOST_AUTO_TEST_CASE(test_logrotate) -{ - boost::system::error_code error; - boost::filesystem::path oldLogsDir = GetDataDir() / "logs"; - boost::filesystem::path logFile = GetDataDir() / "debug.log"; - // create a file with size > 10MB - std::ofstream ofs(logFile.string().c_str(), std::ios::binary | std::ios::out); - ofs.seekp((15<<20) - 1); - ofs.write("",1); - // rotate the file (move it to logs dir) - rotateDebugFile(); - - boost::filesystem::directory_iterator end_it; - boost::filesystem::directory_iterator it(oldLogsDir); - // logs dir must not be empty - BOOST_CHECK(!(it == end_it)); - -} - BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp old mode 100644 new mode 100755 diff --git a/src/threadsafety.h b/src/threadsafety.h old mode 100644 new mode 100755 diff --git a/src/tinyformat.h b/src/tinyformat.h old mode 100644 new mode 100755 diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp deleted file mode 100644 index 3ad518949..000000000 --- a/src/torcontrol.cpp +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) 2015 The The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "torcontrol.h" -#include "net.h" -#include "util.h" -#include "hmac_sha256.h" -#include "serialize.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/** Default control port */ -const std::string DEFAULT_TOR_CONTROL = "127.0.0.1:9051"; -/** Tor cookie size (from control-spec.txt) */ -static const int TOR_COOKIE_SIZE = 32; -/** Size of client/server nonce for SAFECOOKIE */ -static const int TOR_NONCE_SIZE = 32; -/** For computing serverHash in SAFECOOKIE */ -static const std::string TOR_SAFE_SERVERKEY = "Tor safe cookie authentication server-to-controller hash"; -/** For computing clientHash in SAFECOOKIE */ -static const std::string TOR_SAFE_CLIENTKEY = "Tor safe cookie authentication controller-to-server hash"; -/** Exponential backoff configuration - initial timeout in seconds */ -static const float RECONNECT_TIMEOUT_START = 1.0; -/** Exponential backoff configuration - growth factor */ -static const float RECONNECT_TIMEOUT_EXP = 1.5; -/** Maximum length for lines received on TorControlConnection. - * tor-control-spec.txt mentions that there is explicitly no limit defined to line length, - * this is belt-and-suspenders sanity limit to prevent memory exhaustion. - */ -static const int MAX_LINE_LENGTH = 100000; - -/****** Low-level TorControlConnection ********/ - -/** Reply from Tor, can be single or multi-line */ -class TorControlReply -{ -public: - TorControlReply() { Clear(); } - - int code; - std::vector lines; - - void Clear() - { - code = 0; - lines.clear(); - } -}; - -/** Low-level handling for Tor control connection. - * Speaks the SMTP-like protocol as defined in torspec/control-spec.txt - */ -class TorControlConnection -{ -public: - typedef boost::function ConnectionCB; - typedef boost::function ReplyHandlerCB; - - /** Create a new TorControlConnection. - */ - TorControlConnection(struct event_base *base); - ~TorControlConnection(); - - /** - * Connect to a Tor control port. - * target is address of the form host:port. - * connected is the handler that is called when connection is successfully established. - * disconnected is a handler that is called when the connection is broken. - * Return true on success. - */ - bool Connect(const std::string &target, const ConnectionCB& connected, const ConnectionCB& disconnected); - - /** - * Disconnect from Tor control port. - */ - bool Disconnect(); - - /** Send a command, register a handler for the reply. - * A trailing CRLF is automatically added. - * Return true on success. - */ - bool Command(const std::string &cmd, const ReplyHandlerCB& reply_handler); - - /** Response handlers for async replies */ - boost::signals2::signal async_handler; -private: - /** Callback when ready for use */ - boost::function connected; - /** Callback when connection lost */ - boost::function disconnected; - /** Libevent event base */ - struct event_base *base; - /** Connection to control socket */ - struct bufferevent *b_conn; - /** Message being received */ - TorControlReply message; - /** Response handlers */ - std::deque reply_handlers; - - /** Libevent handlers: internal */ - static void readcb(struct bufferevent *bev, void *ctx); - static void eventcb(struct bufferevent *bev, short what, void *ctx); -}; - -TorControlConnection::TorControlConnection(struct event_base *base): - base(base), b_conn(0) -{ -} - -TorControlConnection::~TorControlConnection() -{ - if (b_conn) - bufferevent_free(b_conn); -} - -void TorControlConnection::readcb(struct bufferevent *bev, void *ctx) -{ - TorControlConnection *self = (TorControlConnection*)ctx; - struct evbuffer *input = bufferevent_get_input(bev); - size_t n_read_out = 0; - char *line; - assert(input); - // If there is not a whole line to read, evbuffer_readln returns NULL - while((line = evbuffer_readln(input, &n_read_out, EVBUFFER_EOL_CRLF)) != NULL) - { - std::string s(line, n_read_out); - free(line); - if (s.size() < 4) // Short line - continue; - // (-|+| ) - self->message.code = atoi(s.substr(0,3)); - self->message.lines.push_back(s.substr(4)); - char ch = s[3]; // '-','+' or ' ' - if (ch == ' ') { - // Final line, dispatch reply and clean up - if (self->message.code >= 600) { - // Dispatch async notifications to async handler - // Synchronous and asynchronous messages are never interleaved - self->async_handler(*self, self->message); - } else { - if (!self->reply_handlers.empty()) { - // Invoke reply handler with message - self->reply_handlers.front()(*self, self->message); - self->reply_handlers.pop_front(); - } else { - LogPrint("tor", "tor: Received unexpected sync reply %i\n", self->message.code); - } - } - self->message.Clear(); - } - } - // Check for size of buffer - protect against memory exhaustion with very long lines - // Do this after evbuffer_readln to make sure all full lines have been - // removed from the buffer. Everything left is an incomplete line. - if (evbuffer_get_length(input) > MAX_LINE_LENGTH) { - LogPrintf("tor: Disconnecting because MAX_LINE_LENGTH exceeded\n"); - self->Disconnect(); - } -} - -void TorControlConnection::eventcb(struct bufferevent *bev, short what, void *ctx) -{ - TorControlConnection *self = (TorControlConnection*)ctx; - if (what & BEV_EVENT_CONNECTED) { - LogPrint("tor", "tor: Successfully connected!\n"); - self->connected(*self); - } else if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) { - if (what & BEV_EVENT_ERROR) - LogPrint("tor", "tor: Error connecting to Tor control socket\n"); - else - LogPrint("tor", "tor: End of stream\n"); - self->Disconnect(); - self->disconnected(*self); - } -} - -bool TorControlConnection::Connect(const std::string &target, const ConnectionCB& connected, const ConnectionCB& disconnected) -{ - if (b_conn) - Disconnect(); - // Parse target address:port - struct sockaddr_storage connect_to_addr; - int connect_to_addrlen = sizeof(connect_to_addr); - if (evutil_parse_sockaddr_port(target.c_str(), - (struct sockaddr*)&connect_to_addr, &connect_to_addrlen)<0) { - LogPrintf("tor: Error parsing socket address %s\n", target); - return false; - } - - // Create a new socket, set up callbacks and enable notification bits - b_conn = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE); - if (!b_conn) - return false; - bufferevent_setcb(b_conn, TorControlConnection::readcb, NULL, TorControlConnection::eventcb, this); - bufferevent_enable(b_conn, EV_READ|EV_WRITE); - this->connected = connected; - this->disconnected = disconnected; - - // Finally, connect to target - if (bufferevent_socket_connect(b_conn, (struct sockaddr*)&connect_to_addr, connect_to_addrlen) < 0) { - LogPrintf("tor: Error connecting to address %s\n", target); - return false; - } - return true; -} - -bool TorControlConnection::Disconnect() -{ - if (b_conn) - bufferevent_free(b_conn); - b_conn = 0; - return true; -} - -bool TorControlConnection::Command(const std::string &cmd, const ReplyHandlerCB& reply_handler) -{ - if (!b_conn) - return false; - struct evbuffer *buf = bufferevent_get_output(b_conn); - if (!buf) - return false; - evbuffer_add(buf, cmd.data(), cmd.size()); - evbuffer_add(buf, "\r\n", 2); - reply_handlers.push_back(reply_handler); - return true; -} - -/****** General parsing utilities ********/ - -/* Split reply line in the form 'AUTH METHODS=...' into a type - * 'AUTH' and arguments 'METHODS=...'. - */ -static std::pair SplitTorReplyLine(const std::string &s) -{ - size_t ptr=0; - std::string type; - while (ptr < s.size() && s[ptr] != ' ') { - type.push_back(s[ptr]); - ++ptr; - } - if (ptr < s.size()) - ++ptr; // skip ' ' - return make_pair(type, s.substr(ptr)); -} - -/** Parse reply arguments in the form 'METHODS=COOKIE,SAFECOOKIE COOKIEFILE=".../control_auth_cookie"'. - */ -static std::map ParseTorReplyMapping(const std::string &s) -{ - std::map mapping; - size_t ptr=0; - while (ptr < s.size()) { - std::string key, value; - while (ptr < s.size() && s[ptr] != '=') { - key.push_back(s[ptr]); - ++ptr; - } - if (ptr == s.size()) // unexpected end of line - return std::map(); - ++ptr; // skip '=' - if (ptr < s.size() && s[ptr] == '"') { // Quoted string - ++ptr; // skip '=' - bool escape_next = false; - while (ptr < s.size() && (!escape_next && s[ptr] != '"')) { - escape_next = (s[ptr] == '\\'); - value.push_back(s[ptr]); - ++ptr; - } - if (ptr == s.size()) // unexpected end of line - return std::map(); - ++ptr; // skip closing '"' - /* TODO: unescape value - according to the spec this depends on the - * context, some strings use C-LogPrintf style escape codes, some - * don't. So may be better handled at the call site. - */ - } else { // Unquoted value. Note that values can contain '=' at will, just no spaces - while (ptr < s.size() && s[ptr] != ' ') { - value.push_back(s[ptr]); - ++ptr; - } - } - if (ptr < s.size() && s[ptr] == ' ') - ++ptr; // skip ' ' after key=value - mapping[key] = value; - } - return mapping; -} - -/** Read full contents of a file and return them in a std::string. - * Returns a pair . - * If an error occurred, status will be false, otherwise status will be true and the data will be returned in string. - * - * @param maxsize Puts a maximum size limit on the file that is read. If the file is larger than this, truncated data - * (with len > maxsize) will be returned. - */ -static std::pair ReadBinaryFile(const std::string &filename, size_t maxsize=std::numeric_limits::max()) -{ - FILE *f = fopen(filename.c_str(), "rb"); - if (f == NULL) - return std::make_pair(false,""); - std::string retval; - char buffer[128]; - size_t n; - while ((n=fread(buffer, 1, sizeof(buffer), f)) > 0) { - retval.append(buffer, buffer+n); - if (retval.size() > maxsize) - break; - } - fclose(f); - return std::make_pair(true,retval); -} - -/** Write contents of std::string to a file. - * @return true on success. - */ -static bool WriteBinaryFile(const std::string &filename, const std::string &data) -{ - FILE *f = fopen(filename.c_str(), "wb"); - if (f == NULL) - return false; - if (fwrite(data.data(), 1, data.size(), f) != data.size()) { - fclose(f); - return false; - } - fclose(f); - return true; -} - -/****** Bitcoin specific TorController implementation ********/ - -/** Controller that connects to Tor control socket, authenticate, then create - * and maintain a ephemeral hidden service. - */ -class TorController -{ -public: - TorController(struct event_base* base, const std::string& target); - ~TorController(); - - /** Get name fo file to store private key in */ - std::string GetPrivateKeyFile(); - - /** Reconnect, after getting disconnected */ - void Reconnect(); -private: - struct event_base* base; - std::string target; - TorControlConnection conn; - std::string private_key; - std::string service_id; - bool reconnect; - struct event *reconnect_ev; - float reconnect_timeout; - CService service; - /** Cooie for SAFECOOKIE auth */ - std::vector cookie; - /** ClientNonce for SAFECOOKIE auth */ - std::vector clientNonce; - - /** Callback for ADD_ONION result */ - void add_onion_cb(TorControlConnection& conn, const TorControlReply& reply); - /** Callback for AUTHENTICATE result */ - void auth_cb(TorControlConnection& conn, const TorControlReply& reply); - /** Callback for AUTHCHALLENGE result */ - void authchallenge_cb(TorControlConnection& conn, const TorControlReply& reply); - /** Callback for PROTOCOLINFO result */ - void protocolinfo_cb(TorControlConnection& conn, const TorControlReply& reply); - /** Callback after successful connection */ - void connected_cb(TorControlConnection& conn); - /** Callback after connection lost or failed connection attempt */ - void disconnected_cb(TorControlConnection& conn); - - /** Callback for reconnect timer */ - static void reconnect_cb(evutil_socket_t fd, short what, void *arg); -}; - -TorController::TorController(struct event_base* baseIn, const std::string& target): - base(baseIn), - target(target), conn(base), reconnect(true), reconnect_ev(0), - reconnect_timeout(RECONNECT_TIMEOUT_START) -{ - reconnect_ev = event_new(base, -1, 0, reconnect_cb, this); - if (!reconnect_ev) - LogPrintf("tor: Failed to create event for reconnection: out of memory?\n"); - // Start connection attempts immediately - if (!conn.Connect(target, boost::bind(&TorController::connected_cb, this, _1), - boost::bind(&TorController::disconnected_cb, this, _1) )) { - LogPrintf("tor: Initiating connection to Tor control port %s failed\n", target); - } - // Read service private key if cached - std::pair pkf = ReadBinaryFile(GetPrivateKeyFile()); - if (pkf.first) { - LogPrint("tor", "tor: Reading cached private key from %s\n", GetPrivateKeyFile()); - private_key = pkf.second; - } -} - -TorController::~TorController() -{ - if (reconnect_ev) { - event_free(reconnect_ev); - reconnect_ev = 0; - } - if (service.IsValid()) { - RemoveLocal(service); - } -} - -void TorController::add_onion_cb(TorControlConnection& conn, const TorControlReply& reply) -{ - if (reply.code == 250) { - LogPrint("tor", "tor: ADD_ONION successful\n"); - BOOST_FOREACH(const std::string &s, reply.lines) { - std::map m = ParseTorReplyMapping(s); - std::map::iterator i; - if ((i = m.find("ServiceID")) != m.end()) - service_id = i->second; - if ((i = m.find("PrivateKey")) != m.end()) - private_key = i->second; - } - - service = CService(service_id+".onion", GetListenPort()); - LogPrintf("tor: Got service ID %s, advertising service %s\n", service_id, service.ToString()); - if (WriteBinaryFile(GetPrivateKeyFile(), private_key)) { - LogPrint("tor", "tor: Cached service private key to %s\n", GetPrivateKeyFile()); - } else { - LogPrintf("tor: Error writing service private key to %s\n", GetPrivateKeyFile()); - } - AddLocal(service, LOCAL_MANUAL); - // ... onion requested - keep connection open - } else if (reply.code == 510) { // 510 Unrecognized command - LogPrintf("tor: Add onion failed with unrecognized command (You probably need to upgrade Tor)\n"); - } else { - LogPrintf("tor: Add onion failed; error code %d\n", reply.code); - } -} - -void TorController::auth_cb(TorControlConnection& conn, const TorControlReply& reply) -{ - if (reply.code == 250) { - LogPrint("tor", "tor: Authentication successful\n"); - - // Now that we know Tor is running setup the proxy for onion addresses - // if -onion isn't set to something else. - if (GetArg("-onion", "") == "") { - proxyType addrOnion = proxyType(CService("127.0.0.1", 9050), true); - SetProxy(NET_TOR, addrOnion.first); - SetLimited(NET_TOR, false); - } - - // Finally - now create the service - if (private_key.empty()) // No private key, generate one - private_key = "NEW:BEST"; - // Request hidden service, redirect port. - // Note that the 'virtual' port doesn't have to be the same as our internal port, but this is just a convenient - // choice. TODO; refactor the shutdown sequence some day. - conn.Command(strprintf("ADD_ONION %s Port=%i,127.0.0.1:%i", private_key, GetListenPort(), GetListenPort()), - boost::bind(&TorController::add_onion_cb, this, _1, _2)); - } else { - LogPrintf("tor: Authentication failed\n"); - } -} - -/** Compute Tor SAFECOOKIE response. - * - * ServerHash is computed as: - * HMAC-SHA256("Tor safe cookie authentication server-to-controller hash", - * CookieString | ClientNonce | ServerNonce) - * (with the HMAC key as its first argument) - * - * After a controller sends a successful AUTHCHALLENGE command, the - * next command sent on the connection must be an AUTHENTICATE command, - * and the only authentication string which that AUTHENTICATE command - * will accept is: - * - * HMAC-SHA256("Tor safe cookie authentication controller-to-server hash", - * CookieString | ClientNonce | ServerNonce) - * - */ -static std::vector ComputeResponse(const std::string &key, const std::vector &cookie, const std::vector &clientNonce, const std::vector &serverNonce) -{ - CHMAC_SHA256 computeHash((const uint8_t*)key.data(), key.size()); - std::vector computedHash(CHMAC_SHA256::OUTPUT_SIZE, 0); - computeHash.Write(begin_ptr(cookie), cookie.size()); - computeHash.Write(begin_ptr(clientNonce), clientNonce.size()); - computeHash.Write(begin_ptr(serverNonce), serverNonce.size()); - computeHash.Finalize(begin_ptr(computedHash)); - return computedHash; -} - -void TorController::authchallenge_cb(TorControlConnection& conn, const TorControlReply& reply) -{ - if (reply.code == 250) { - LogPrint("tor", "tor: SAFECOOKIE authentication challenge successful\n"); - std::pair l = SplitTorReplyLine(reply.lines[0]); - if (l.first == "AUTHCHALLENGE") { - std::map m = ParseTorReplyMapping(l.second); - std::vector serverHash = ParseHex(m["SERVERHASH"]); - std::vector serverNonce = ParseHex(m["SERVERNONCE"]); - LogPrint("tor", "tor: AUTHCHALLENGE ServerHash %s ServerNonce %s\n", HexStr(serverHash), HexStr(serverNonce)); - if (serverNonce.size() != 32) { - LogPrintf("tor: ServerNonce is not 32 bytes, as required by spec\n"); - return; - } - - std::vector computedServerHash = ComputeResponse(TOR_SAFE_SERVERKEY, cookie, clientNonce, serverNonce); - if (computedServerHash != serverHash) { - LogPrintf("tor: ServerHash %s does not match expected ServerHash %s\n", HexStr(serverHash), HexStr(computedServerHash)); - return; - } - - std::vector computedClientHash = ComputeResponse(TOR_SAFE_CLIENTKEY, cookie, clientNonce, serverNonce); - conn.Command("AUTHENTICATE " + HexStr(computedClientHash), boost::bind(&TorController::auth_cb, this, _1, _2)); - } else { - LogPrintf("tor: Invalid reply to AUTHCHALLENGE\n"); - } - } else { - LogPrintf("tor: SAFECOOKIE authentication challenge failed\n"); - } -} - -void TorController::protocolinfo_cb(TorControlConnection& conn, const TorControlReply& reply) -{ - if (reply.code == 250) { - std::set methods; - std::string cookiefile; - /* - * 250-AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/home/x/.tor/control_auth_cookie" - * 250-AUTH METHODS=NULL - * 250-AUTH METHODS=HASHEDPASSWORD - */ - BOOST_FOREACH(const std::string &s, reply.lines) { - std::pair l = SplitTorReplyLine(s); - if (l.first == "AUTH") { - std::map m = ParseTorReplyMapping(l.second); - std::map::iterator i; - if ((i = m.find("METHODS")) != m.end()) - boost::split(methods, i->second, boost::is_any_of(",")); - if ((i = m.find("COOKIEFILE")) != m.end()) - cookiefile = i->second; - } else if (l.first == "VERSION") { - std::map m = ParseTorReplyMapping(l.second); - std::map::iterator i; - if ((i = m.find("Tor")) != m.end()) { - LogPrint("tor", "tor: Connected to Tor version %s\n", i->second); - } - } - } - BOOST_FOREACH(const std::string &s, methods) { - LogPrint("tor", "tor: Supported authentication method: %s\n", s); - } - // Prefer NULL, otherwise SAFECOOKIE. If a password is provided, use HASHEDPASSWORD - /* Authentication: - * cookie: hex-encoded ~/.tor/control_auth_cookie - * password: "password" - */ - std::string torpassword = GetArg("-torpassword", ""); - if (!torpassword.empty()) { - if (methods.count("HASHEDPASSWORD")) { - LogPrint("tor", "tor: Using HASHEDPASSWORD authentication\n"); - boost::replace_all(torpassword, "\"", "\\\""); - conn.Command("AUTHENTICATE \"" + torpassword + "\"", boost::bind(&TorController::auth_cb, this, _1, _2)); - } else { - LogPrintf("tor: Password provided with -torpassword, but HASHEDPASSWORD authentication is not available\n"); - } - } else if (methods.count("NULL")) { - LogPrint("tor", "tor: Using NULL authentication\n"); - conn.Command("AUTHENTICATE", boost::bind(&TorController::auth_cb, this, _1, _2)); - } else if (methods.count("SAFECOOKIE")) { - // Cookie: hexdump -e '32/1 "%02x""\n"' ~/.tor/control_auth_cookie - LogPrint("tor", "tor: Using SAFECOOKIE authentication, reading cookie authentication from %s\n", cookiefile); - std::pair status_cookie = ReadBinaryFile(cookiefile, TOR_COOKIE_SIZE); - if (status_cookie.first && status_cookie.second.size() == TOR_COOKIE_SIZE) { - // conn.Command("AUTHENTICATE " + HexStr(status_cookie.second), boost::bind(&TorController::auth_cb, this, _1, _2)); - cookie = std::vector(status_cookie.second.begin(), status_cookie.second.end()); - clientNonce = std::vector(TOR_NONCE_SIZE, 0); - GetRandBytes(&clientNonce[0], TOR_NONCE_SIZE); - conn.Command("AUTHCHALLENGE SAFECOOKIE " + HexStr(clientNonce), boost::bind(&TorController::authchallenge_cb, this, _1, _2)); - } else { - if (status_cookie.first) { - LogPrintf("tor: Authentication cookie %s is not exactly %i bytes, as is required by the spec\n", cookiefile, TOR_COOKIE_SIZE); - } else { - LogPrintf("tor: Authentication cookie %s could not be opened (check permissions)\n", cookiefile); - } - } - } else if (methods.count("HASHEDPASSWORD")) { - LogPrintf("tor: The only supported authentication mechanism left is password, but no password provided with -torpassword\n"); - } else { - LogPrintf("tor: No supported authentication method\n"); - } - } else { - LogPrintf("tor: Requesting protocol info failed\n"); - } -} - -void TorController::connected_cb(TorControlConnection& conn) -{ - reconnect_timeout = RECONNECT_TIMEOUT_START; - // First send a PROTOCOLINFO command to figure out what authentication is expected - if (!conn.Command("PROTOCOLINFO 1", boost::bind(&TorController::protocolinfo_cb, this, _1, _2))) - LogPrintf("tor: Error sending initial protocolinfo command\n"); -} - -void TorController::disconnected_cb(TorControlConnection& conn) -{ - // Stop advertising service when disconnected - if (service.IsValid()) - RemoveLocal(service); - service = CService(); - if (!reconnect) - return; - - LogPrint("tor", "tor: Not connected to Tor control port %s, trying to reconnect\n", target); - - // Single-shot timer for reconnect. Use exponential backoff. - struct timeval time = MillisToTimeval(int64_t(reconnect_timeout * 1000.0)); - if (reconnect_ev) - event_add(reconnect_ev, &time); - reconnect_timeout *= RECONNECT_TIMEOUT_EXP; -} - -void TorController::Reconnect() -{ - /* Try to reconnect and reestablish if we get booted - for example, Tor - * may be restarting. - */ - if (!conn.Connect(target, boost::bind(&TorController::connected_cb, this, _1), - boost::bind(&TorController::disconnected_cb, this, _1) )) { - LogPrintf("tor: Re-initiating connection to Tor control port %s failed\n", target); - } -} - -std::string TorController::GetPrivateKeyFile() -{ - return (GetDataDir() / "onion_private_key").string(); -} - -void TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg) -{ - TorController *self = (TorController*)arg; - self->Reconnect(); -} - -/****** Thread ********/ -struct event_base *base; -boost::thread torControlThread; - -static void TorControlThread() -{ - TorController ctrl(base, GetArg("-torcontrol", DEFAULT_TOR_CONTROL)); - - event_base_dispatch(base); -} - -void StartTorControl(boost::thread_group& threadGroup) -{ - assert(!base); -#ifdef WIN32 - evthread_use_windows_threads(); -#else - evthread_use_pthreads(); -#endif - base = event_base_new(); - if (!base) { - LogPrintf("tor: Unable to create event_base\n"); - return; - } - - torControlThread = boost::thread(boost::bind(&TraceThread, "torcontrol", &TorControlThread)); -} - -void InterruptTorControl() -{ - if (base) { - LogPrintf("tor: Thread interrupt\n"); - event_base_loopbreak(base); - } -} - -void StopTorControl() -{ - if (base) { - torControlThread.join(); - event_base_free(base); - base = 0; - } -} - diff --git a/src/torcontrol.h b/src/torcontrol.h deleted file mode 100644 index 95fc55741..000000000 --- a/src/torcontrol.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2015 The The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -/** - * Functionality for communicating with Tor. - */ -#ifndef BITCOIN_TORCONTROL_H -#define BITCOIN_TORCONTROL_H - -#include "net.h" - -extern const std::string DEFAULT_TOR_CONTROL; -static const bool DEFAULT_LISTEN_ONION = true; - -void StartTorControl(boost::thread_group& threadGroup); -void InterruptTorControl(); -void StopTorControl(); - -#endif /* BITCOIN_TORCONTROL_H */ diff --git a/src/txdb.cpp b/src/txdb.cpp old mode 100644 new mode 100755 diff --git a/src/txdb.h b/src/txdb.h old mode 100644 new mode 100755 diff --git a/src/txmempool.cpp b/src/txmempool.cpp old mode 100644 new mode 100755 diff --git a/src/txmempool.h b/src/txmempool.h old mode 100644 new mode 100755 diff --git a/src/ui_interface.h b/src/ui_interface.h old mode 100644 new mode 100755 diff --git a/src/uint256.h b/src/uint256.h old mode 100644 new mode 100755 diff --git a/src/util.cpp b/src/util.cpp index fec23944f..33d570e58 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -7,7 +7,6 @@ #include "util.h" #include "chainparams.h" -#include "random.h" #include "netbase.h" #include "sync.h" #include "ui_interface.h" @@ -16,7 +15,6 @@ #include "allocators.h" #include -#include #include #include @@ -95,10 +93,6 @@ namespace boost { using namespace std; -// Log rotation -#define MAX_ALLOWED_DEGUB_SIZE_IN_BYTES 10000000 // 10MB -long long debugFileSize = 0; - //Interzone only features bool fMasterNode = false; string strMasterNodePrivKey = ""; @@ -130,7 +124,6 @@ bool fLogTimestamps = false; volatile bool fReopenDebugLog = false; CClientUIInterface uiInterface; - // Init OpenSSL library multithreading support static CCriticalSection** ppmutexOpenSSL; void locking_callback(int mode, int i, const char* file, int line) @@ -257,14 +250,6 @@ static boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT; static FILE* fileout = NULL; static boost::mutex* mutexDebugLog = NULL; -long long getFileSize(FILE *fp){ - long long prev = ftell(fp); - fseek(fp, 0L, SEEK_END); - long long sz = ftell(fp); - fseek(fp,prev,SEEK_SET); //go back to where we were - return sz; -} - static void DebugPrintInit() { assert(fileout == NULL); @@ -273,7 +258,7 @@ static void DebugPrintInit() boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; fileout = fopen(pathDebug.string().c_str(), "a"); if (fileout) setbuf(fileout, NULL); // unbuffered - debugFileSize = getFileSize(fileout); + mutexDebugLog = new boost::mutex(); } @@ -305,42 +290,6 @@ bool LogAcceptCategory(const char* category) return true; } -void rotateDebugFile() { - boost::system::error_code err; - boost::filesystem::path oldLogsDir = GetDataDir() / "logs"; - if (fileout != NULL){ - fclose (fileout); - } - if(!is_directory(oldLogsDir.parent_path()) || exists(oldLogsDir)) { - assert(!create_directory(oldLogsDir, err)); - - if(is_directory(oldLogsDir)) { - assert(!err.value()); - } else { - assert(err.value()); - } - } - try { - if (create_directories(oldLogsDir)) { - assert(!create_directory(oldLogsDir)); - } - } catch (std::exception& exc) { - std::stringstream ss; - ss << "Could not create directory for rotated logs! Exception info: " << exc.what() << '\n'; - LogPrintStr(ss.str()); - } - boost::filesystem::path oldPathDebug = GetDataDir() / "debug.log"; - std::string newName = "debug-" + DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()) + ".log"; - boost::filesystem::path newPathDebug = oldLogsDir / newName; - - rename (oldPathDebug.string().c_str() , newPathDebug.string().c_str()); - - boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; - fileout = fopen(pathDebug.string().c_str(), "w"); - if (fileout) setbuf(fileout, NULL); // unbuffered - debugFileSize = 0; -} - int LogPrintStr(const std::string &str) { int ret = 0; // Returns total number of characters written @@ -365,7 +314,6 @@ int LogPrintStr(const std::string &str) boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL) setbuf(fileout, NULL); // unbuffered - debugFileSize = getFileSize(fileout); } // Debug print useful for profiling @@ -375,12 +323,8 @@ int LogPrintStr(const std::string &str) fStartedNewLine = true; else fStartedNewLine = false; - ret = fwrite(str.data(), 1, str.size(), fileout); - debugFileSize += str.size(); - if (debugFileSize>MAX_ALLOWED_DEGUB_SIZE_IN_BYTES) { - rotateDebugFile(); - } + ret = fwrite(str.data(), 1, str.size(), fileout); } return ret; @@ -1441,6 +1385,27 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime) } } +uint32_t insecure_rand_Rz = 11; +uint32_t insecure_rand_Rw = 11; +void seed_insecure_rand(bool fDeterministic) +{ + //The seed values have some unlikely fixed points which we avoid. + if(fDeterministic) + { + insecure_rand_Rz = insecure_rand_Rw = 11; + } else { + uint32_t tmp; + do { + RAND_bytes((unsigned char*)&tmp, 4); + } while(tmp == 0 || tmp == 0x9068ffffU); + insecure_rand_Rz = tmp; + do { + RAND_bytes((unsigned char*)&tmp, 4); + } while(tmp == 0 || tmp == 0x464fffffU); + insecure_rand_Rw = tmp; + } +} + string FormatVersion(int nVersion) { if (nVersion%100 == 0) @@ -1511,20 +1476,7 @@ void runCommand(std::string strCommand) if (nErr) LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr); } -std::string DurationToDHMS(int64_t nDurationTime) -{ - int seconds = nDurationTime % 60; - nDurationTime /= 60; - int minutes = nDurationTime % 60; - nDurationTime /= 60; - int hours = nDurationTime % 24; - int days = nDurationTime / 24; - if(days) - return strprintf("%dd %02dh:%02dm:%02ds", days, hours, minutes, seconds); - if(hours) - return strprintf("%02dh:%02dm:%02ds", hours, minutes, seconds); - return strprintf("%02dm:%02ds", minutes, seconds); -} + void RenameThread(const char* name) { #if defined(PR_SET_NAME) @@ -1554,11 +1506,11 @@ void SetupEnvironment() #ifndef WIN32 try { - #if BOOST_FILESYSTEM_VERSION == 3 + #if BOOST_FILESYSTEM_VERSION == 3 boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid - #else // boost filesystem v2 + #else // boost filesystem v2 std::locale(); // Raises runtime error if current locale is invalid - #endif + #endif } catch(std::runtime_error &e) { setenv("LC_ALL", "C", 1); // Force C locale diff --git a/src/util.h b/src/util.h old mode 100644 new mode 100755 index 7c3f9d98e..aec9f5619 --- a/src/util.h +++ b/src/util.h @@ -166,7 +166,7 @@ static inline bool error(const char* format) return false; } -void rotateDebugFile(); + void LogException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); std::string FormatMoney(int64_t n, bool fPlus=false); @@ -220,7 +220,7 @@ std::string FormatFullVersion(); std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); void AddTimeData(const CNetAddr& ip, int64_t nTime); void runCommand(std::string strCommand); -std::string DurationToDHMS(int64_t nDurationTime); + @@ -403,6 +403,28 @@ bool SoftSetArg(const std::string& strArg, const std::string& strValue); */ bool SoftSetBoolArg(const std::string& strArg, bool fValue); +/** + * MWC RNG of George Marsaglia + * This is intended to be fast. It has a period of 2^59.3, though the + * least significant 16 bits only have a period of about 2^30.1. + * + * @return random value + */ +extern uint32_t insecure_rand_Rz; +extern uint32_t insecure_rand_Rw; +static inline uint32_t insecure_rand(void) +{ + insecure_rand_Rz = 36969 * (insecure_rand_Rz & 65535) + (insecure_rand_Rz >> 16); + insecure_rand_Rw = 18000 * (insecure_rand_Rw & 65535) + (insecure_rand_Rw >> 16); + return (insecure_rand_Rw << 16) + insecure_rand_Rz; +} + +/** + * Seed insecure_rand using the random pool. + * @param Deterministic Use a determinstic seed + */ +void seed_insecure_rand(bool fDeterministic=false); + /** * Timing-attack-resistant comparison. * Takes time proportional to length diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp deleted file mode 100644 index bf304a935..000000000 --- a/src/utilstrencodings.cpp +++ /dev/null @@ -1,663 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "utilstrencodings.h" - -#include "tinyformat.h" - -#include -#include -#include -#include - -using namespace std; - -static const string CHARS_ALPHA_NUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - -static const string SAFE_CHARS[] = -{ - CHARS_ALPHA_NUM + " .,;-_/:?@()", // SAFE_CHARS_DEFAULT - CHARS_ALPHA_NUM + " .,;-_?@" // SAFE_CHARS_UA_COMMENT -}; - -string SanitizeString(const string& str, int rule) -{ - string strResult; - for (std::string::size_type i = 0; i < str.size(); i++) - { - if (SAFE_CHARS[rule].find(str[i]) != std::string::npos) - strResult.push_back(str[i]); - } - return strResult; -} - -const signed char p_util_hexdigit[256] = -{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, - -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; - -signed char HexDigit(char c) -{ - return p_util_hexdigit[(unsigned char)c]; -} - -bool IsHex(const string& str) -{ - for(std::string::const_iterator it(str.begin()); it != str.end(); ++it) - { - if (HexDigit(*it) < 0) - return false; - } - return (str.size() > 0) && (str.size()%2 == 0); -} - -vector ParseHex(const char* psz) -{ - // convert hex dump to vector - vector vch; - while (true) - { - while (isspace(*psz)) - psz++; - signed char c = HexDigit(*psz++); - if (c == (signed char)-1) - break; - unsigned char n = (c << 4); - c = HexDigit(*psz++); - if (c == (signed char)-1) - break; - n |= c; - vch.push_back(n); - } - return vch; -} - -vector ParseHex(const string& str) -{ - return ParseHex(str.c_str()); -} - -string EncodeBase64(const unsigned char* pch, size_t len) -{ - static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - string strRet=""; - strRet.reserve((len+2)/3*4); - - int mode=0, left=0; - const unsigned char *pchEnd = pch+len; - - while (pch> 2]; - left = (enc & 3) << 4; - mode = 1; - break; - - case 1: // we have two bits - strRet += pbase64[left | (enc >> 4)]; - left = (enc & 15) << 2; - mode = 2; - break; - - case 2: // we have four bits - strRet += pbase64[left | (enc >> 6)]; - strRet += pbase64[enc & 63]; - mode = 0; - break; - } - } - - if (mode) - { - strRet += pbase64[left]; - strRet += '='; - if (mode == 1) - strRet += '='; - } - - return strRet; -} - -string EncodeBase64(const string& str) -{ - return EncodeBase64((const unsigned char*)str.c_str(), str.size()); -} - -vector DecodeBase64(const char* p, bool* pfInvalid) -{ - static const int decode64_table[256] = - { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, - -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; - - if (pfInvalid) - *pfInvalid = false; - - vector vchRet; - vchRet.reserve(strlen(p)*3/4); - - int mode = 0; - int left = 0; - - while (1) - { - int dec = decode64_table[(unsigned char)*p]; - if (dec == -1) break; - p++; - switch (mode) - { - case 0: // we have no bits and get 6 - left = dec; - mode = 1; - break; - - case 1: // we have 6 bits and keep 4 - vchRet.push_back((left<<2) | (dec>>4)); - left = dec & 15; - mode = 2; - break; - - case 2: // we have 4 bits and get 6, we keep 2 - vchRet.push_back((left<<4) | (dec>>2)); - left = dec & 3; - mode = 3; - break; - - case 3: // we have 2 bits and get 6 - vchRet.push_back((left<<6) | dec); - mode = 0; - break; - } - } - - if (pfInvalid) - switch (mode) - { - case 0: // 4n base64 characters processed: ok - break; - - case 1: // 4n+1 base64 character processed: impossible - *pfInvalid = true; - break; - - case 2: // 4n+2 base64 characters processed: require '==' - if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1) - *pfInvalid = true; - break; - - case 3: // 4n+3 base64 characters processed: require '=' - if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1) - *pfInvalid = true; - break; - } - - return vchRet; -} - -string DecodeBase64(const string& str) -{ - vector vchRet = DecodeBase64(str.c_str()); - return (vchRet.size() == 0) ? string() : string((const char*)&vchRet[0], vchRet.size()); -} - -string EncodeBase32(const unsigned char* pch, size_t len) -{ - static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567"; - - string strRet=""; - strRet.reserve((len+4)/5*8); - - int mode=0, left=0; - const unsigned char *pchEnd = pch+len; - - while (pch> 3]; - left = (enc & 7) << 2; - mode = 1; - break; - - case 1: // we have three bits - strRet += pbase32[left | (enc >> 6)]; - strRet += pbase32[(enc >> 1) & 31]; - left = (enc & 1) << 4; - mode = 2; - break; - - case 2: // we have one bit - strRet += pbase32[left | (enc >> 4)]; - left = (enc & 15) << 1; - mode = 3; - break; - - case 3: // we have four bits - strRet += pbase32[left | (enc >> 7)]; - strRet += pbase32[(enc >> 2) & 31]; - left = (enc & 3) << 3; - mode = 4; - break; - - case 4: // we have two bits - strRet += pbase32[left | (enc >> 5)]; - strRet += pbase32[enc & 31]; - mode = 0; - } - } - - static const int nPadding[5] = {0, 6, 4, 3, 1}; - if (mode) - { - strRet += pbase32[left]; - for (int n=0; n DecodeBase32(const char* p, bool* pfInvalid) -{ - static const int decode32_table[256] = - { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 0, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; - - if (pfInvalid) - *pfInvalid = false; - - vector vchRet; - vchRet.reserve((strlen(p))*5/8); - - int mode = 0; - int left = 0; - - while (1) - { - int dec = decode32_table[(unsigned char)*p]; - if (dec == -1) break; - p++; - switch (mode) - { - case 0: // we have no bits and get 5 - left = dec; - mode = 1; - break; - - case 1: // we have 5 bits and keep 2 - vchRet.push_back((left<<3) | (dec>>2)); - left = dec & 3; - mode = 2; - break; - - case 2: // we have 2 bits and keep 7 - left = left << 5 | dec; - mode = 3; - break; - - case 3: // we have 7 bits and keep 4 - vchRet.push_back((left<<1) | (dec>>4)); - left = dec & 15; - mode = 4; - break; - - case 4: // we have 4 bits, and keep 1 - vchRet.push_back((left<<4) | (dec>>1)); - left = dec & 1; - mode = 5; - break; - - case 5: // we have 1 bit, and keep 6 - left = left << 5 | dec; - mode = 6; - break; - - case 6: // we have 6 bits, and keep 3 - vchRet.push_back((left<<2) | (dec>>3)); - left = dec & 7; - mode = 7; - break; - - case 7: // we have 3 bits, and keep 0 - vchRet.push_back((left<<5) | dec); - mode = 0; - break; - } - } - - if (pfInvalid) - switch (mode) - { - case 0: // 8n base32 characters processed: ok - break; - - case 1: // 8n+1 base32 characters processed: impossible - case 3: // +3 - case 6: // +6 - *pfInvalid = true; - break; - - case 2: // 8n+2 base32 characters processed: require '======' - if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1) - *pfInvalid = true; - break; - - case 4: // 8n+4 base32 characters processed: require '====' - if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1) - *pfInvalid = true; - break; - - case 5: // 8n+5 base32 characters processed: require '===' - if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1) - *pfInvalid = true; - break; - - case 7: // 8n+7 base32 characters processed: require '=' - if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1) - *pfInvalid = true; - break; - } - - return vchRet; -} - -string DecodeBase32(const string& str) -{ - vector vchRet = DecodeBase32(str.c_str()); - return (vchRet.size() == 0) ? string() : string((const char*)&vchRet[0], vchRet.size()); -} - -static bool ParsePrechecks(const std::string& str) -{ - if (str.empty()) // No empty string allowed - return false; - if (str.size() >= 1 && (isspace(str[0]) || isspace(str[str.size()-1]))) // No padding allowed - return false; - if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed - return false; - return true; -} - -bool ParseInt32(const std::string& str, int32_t *out) -{ - if (!ParsePrechecks(str)) - return false; - char *endp = NULL; - errno = 0; // strtol will not set errno if valid - long int n = strtol(str.c_str(), &endp, 10); - if(out) *out = (int32_t)n; - // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow - // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit - // platforms the size of these types may be different. - return endp && *endp == 0 && !errno && - n >= std::numeric_limits::min() && - n <= std::numeric_limits::max(); -} - -bool ParseInt64(const std::string& str, int64_t *out) -{ - if (!ParsePrechecks(str)) - return false; - char *endp = NULL; - errno = 0; // strtoll will not set errno if valid - long long int n = strtoll(str.c_str(), &endp, 10); - if(out) *out = (int64_t)n; - // Note that strtoll returns a *long long int*, so even if strtol doesn't report a over/underflow - // we still have to check that the returned value is within the range of an *int64_t*. - return endp && *endp == 0 && !errno && - n >= std::numeric_limits::min() && - n <= std::numeric_limits::max(); -} - -bool ParseDouble(const std::string& str, double *out) -{ - if (!ParsePrechecks(str)) - return false; - if (str.size() >= 2 && str[0] == '0' && str[1] == 'x') // No hexadecimal floats allowed - return false; - std::istringstream text(str); - text.imbue(std::locale::classic()); - double result; - text >> result; - if(out) *out = result; - return text.eof() && !text.fail(); -} - -std::string FormatParagraph(const std::string& in, size_t width, size_t indent) -{ - std::stringstream out; - size_t col = 0; - size_t ptr = 0; - while(ptr < in.size()) - { - // Find beginning of next word - ptr = in.find_first_not_of(' ', ptr); - if (ptr == std::string::npos) - break; - // Find end of next word - size_t endword = in.find_first_of(' ', ptr); - if (endword == std::string::npos) - endword = in.size(); - // Add newline and indentation if this wraps over the allowed width - if (col > 0) - { - if ((col + endword - ptr) > width) - { - out << '\n'; - for(size_t i=0; i (UPPER_BOUND / 10LL)) - return false; /* overflow */ - mantissa *= 10; - } - mantissa += ch - '0'; - mantissa_tzeros = 0; - } - return true; -} - -bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) -{ - int64_t mantissa = 0; - int64_t exponent = 0; - int mantissa_tzeros = 0; - bool mantissa_sign = false; - bool exponent_sign = false; - int ptr = 0; - int end = val.size(); - int point_ofs = 0; - - if (ptr < end && val[ptr] == '-') { - mantissa_sign = true; - ++ptr; - } - if (ptr < end) - { - if (val[ptr] == '0') { - /* pass single 0 */ - ++ptr; - } else if (val[ptr] >= '1' && val[ptr] <= '9') { - while (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') { - if (!ProcessMantissaDigit(val[ptr], mantissa, mantissa_tzeros)) - return false; /* overflow */ - ++ptr; - } - } else return false; /* missing expected digit */ - } else return false; /* empty string or loose '-' */ - if (ptr < end && val[ptr] == '.') - { - ++ptr; - if (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') - { - while (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') { - if (!ProcessMantissaDigit(val[ptr], mantissa, mantissa_tzeros)) - return false; /* overflow */ - ++ptr; - ++point_ofs; - } - } else return false; /* missing expected digit */ - } - if (ptr < end && (val[ptr] == 'e' || val[ptr] == 'E')) - { - ++ptr; - if (ptr < end && val[ptr] == '+') - ++ptr; - else if (ptr < end && val[ptr] == '-') { - exponent_sign = true; - ++ptr; - } - if (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') { - while (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') { - if (exponent > (UPPER_BOUND / 10LL)) - return false; /* overflow */ - exponent = exponent * 10 + val[ptr] - '0'; - ++ptr; - } - } else return false; /* missing expected digit */ - } - if (ptr != end) - return false; /* trailing garbage */ - - /* finalize exponent */ - if (exponent_sign) - exponent = -exponent; - exponent = exponent - point_ofs + mantissa_tzeros; - - /* finalize mantissa */ - if (mantissa_sign) - mantissa = -mantissa; - - /* convert to one 64-bit fixed-point value */ - exponent += decimals; - if (exponent < 0) - return false; /* cannot represent values smaller than 10^-decimals */ - if (exponent >= 18) - return false; /* cannot represent values larger than or equal to 10^(18-decimals) */ - - for (int i=0; i < exponent; ++i) { - if (mantissa > (UPPER_BOUND / 10LL) || mantissa < -(UPPER_BOUND / 10LL)) - return false; /* overflow */ - mantissa *= 10; - } - if (mantissa > UPPER_BOUND || mantissa < -UPPER_BOUND) - return false; /* overflow */ - - if (amount_out) - *amount_out = mantissa; - - return true; -} diff --git a/src/utilstrencodings.h b/src/utilstrencodings.h deleted file mode 100644 index fd1be20b4..000000000 --- a/src/utilstrencodings.h +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -/** - * Utilities for converting data from/to strings. - */ -#ifndef BITCOIN_UTILSTRENCODINGS_H -#define BITCOIN_UTILSTRENCODINGS_H - -#include -#include -#include - -#define BEGIN(a) ((char*)&(a)) -#define END(a) ((char*)&((&(a))[1])) -#define UBEGIN(a) ((unsigned char*)&(a)) -#define UEND(a) ((unsigned char*)&((&(a))[1])) -#define ARRAYLEN(array) (sizeof(array)/sizeof((array)[0])) - -/** This is needed because the foreach macro can't get over the comma in pair */ -#define PAIRTYPE(t1, t2) std::pair - -/** Used by SanitizeString() */ -enum SafeChars -{ - SAFE_CHARS_DEFAULT, //!< The full set of allowed chars - SAFE_CHARS_UA_COMMENT //!< BIP-0014 subset -}; - -/** -* Remove unsafe chars. Safe chars chosen to allow simple messages/URLs/email -* addresses, but avoid anything even possibly remotely dangerous like & or > -* @param[in] str The string to sanitize -* @param[in] rule The set of safe chars to choose (default: least restrictive) -* @return A new string without unsafe chars -*/ -std::string SanitizeString(const std::string& str, int rule = SAFE_CHARS_DEFAULT); -std::vector ParseHex(const char* psz); -std::vector ParseHex(const std::string& str); -signed char HexDigit(char c); -bool IsHex(const std::string& str); -std::string EncodeBase64(const unsigned char* pch, size_t len); -std::string EncodeBase64(const std::string& str); -std::string EncodeBase32(const unsigned char* pch, size_t len); -std::string EncodeBase32(const std::string& str); - -std::string i64tostr(int64_t n); -std::string itostr(int n); -int64_t atoi64(const char* psz); -int64_t atoi64(const std::string& str); -int atoi(const std::string& str); - -/** - * Convert string to signed 32-bit integer with strict parse error feedback. - * @returns true if the entire string could be parsed as valid integer, - * false if not the entire string could be parsed or when overflow or underflow occurred. - */ -bool ParseInt32(const std::string& str, int32_t *out); - -/** - * Convert string to signed 64-bit integer with strict parse error feedback. - * @returns true if the entire string could be parsed as valid integer, - * false if not the entire string could be parsed or when overflow or underflow occurred. - */ -bool ParseInt64(const std::string& str, int64_t *out); - -/** - * Convert string to double with strict parse error feedback. - * @returns true if the entire string could be parsed as valid double, - * false if not the entire string could be parsed or when overflow or underflow occurred. - */ -bool ParseDouble(const std::string& str, double *out); - -/** - * Format a paragraph of text to a fixed width, adding spaces for - * indentation to any added line. - */ -std::string FormatParagraph(const std::string& in, size_t width = 79, size_t indent = 0); - -/** Parse number as fixed point according to JSON number syntax. - * See http://json.org/number.gif - * @returns true on success, false on error. - * @note The result must be in the range (-10^18,10^18), otherwise an overflow error will trigger. - */ -bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out); - -#endif // BITCOIN_UTILSTRENCODINGS_H diff --git a/src/version.cpp b/src/version.cpp old mode 100644 new mode 100755 index dd73dab1e..162893fb2 --- a/src/version.cpp +++ b/src/version.cpp @@ -35,10 +35,11 @@ const std::string CLIENT_NAME("Core"); # include "build.h" #endif -// git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ +// git will put "#define GIT_ARCHIVE 1" on the next line inside archives. +#define GIT_ARCHIVE 1 #ifdef GIT_ARCHIVE -# define GIT_COMMIT_ID "$Format:%h$" -# define GIT_COMMIT_DATE "$Format:%cD$" +# define GIT_COMMIT_ID "c0b3d63834f" +# define GIT_COMMIT_DATE "Sun, 16 Jul 2017 21:26:06 +0200" #endif #define BUILD_DESC_WITH_SUFFIX(maj,min,rev,build,suffix) \ diff --git a/src/version.h b/src/version.h old mode 100644 new mode 100755 index 2d27b269d..a5a9d5c62 --- a/src/version.h +++ b/src/version.h @@ -27,13 +27,13 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 80000; +static const int PROTOCOL_VERSION = 80001; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; // disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 70000; +static const int MIN_PEER_PROTO_VERSION = 80000; // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this diff --git a/src/wallet.cpp b/src/wallet.cpp old mode 100644 new mode 100755 index c57d6180a..2d1cf534e --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1688,7 +1688,7 @@ int CWallet::CountInputsWithAmount(int64_t nInputAmount) { int64_t nTotal = 0; { - LOCK2(cs_main, cs_wallet); + LOCK(cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; diff --git a/src/wallet.h b/src/wallet.h old mode 100644 new mode 100755 index 085500a0e..c896e7efa --- a/src/wallet.h +++ b/src/wallet.h @@ -153,7 +153,7 @@ class CWallet : public CCryptoKeyStore, public CWalletInterface bool fFileBacked; bool fWalletUnlockAnonymizeOnly; - const std::string strWalletFile; + std::string strWalletFile; std::set setKeyPool; std::map mapKeyMetadata; @@ -166,9 +166,11 @@ class CWallet : public CCryptoKeyStore, public CWalletInterface { SetNull(); } - CWallet(std::string strWalletFileIn) : strWalletFile(strWalletFileIn) + CWallet(std::string strWalletFileIn) { SetNull(); + + strWalletFile = strWalletFileIn; fFileBacked = true; } void SetNull() diff --git a/src/walletdb.cpp b/src/walletdb.cpp old mode 100644 new mode 100755 diff --git a/src/walletdb.h b/src/walletdb.h old mode 100644 new mode 100755