Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: litecoin-project/litecoin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Rin-coin/rincoin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Mar 26, 2025

  1. update: Rincoin

    ysmreg authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    25a0cfb View commit details
  2. add : rinhash

    ysmreg committed Mar 26, 2025
    Copy the full SHA
    31f68fa View commit details

Commits on Mar 27, 2025

  1. Create genesis

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    fa6ff01 View commit details
  2. update rincoin

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    5f9e976 View commit details
  3. update rincoin process

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    5bd3dab View commit details
  4. change data dir for rincoin

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    22f24a0 View commit details
  5. update for rin

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    e5603f8 View commit details
  6. change version

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    fda9d8f View commit details
  7. change port

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    90e0bcf View commit details
  8. fix: bug

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c702fb3 View commit details
  9. fix fix-pthread-stack.patch

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a677edc View commit details
  10. Update boost.mk

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    930d9e3 View commit details
  11. Update boost.mk

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a159d92 View commit details
  12. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cb17daf View commit details
  13. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8ad7cc6 View commit details
  14. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0d77f65 View commit details
  15. fix build

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    db36c3b View commit details
  16. fix build

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    705a6c2 View commit details
  17. fix miss

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    ad2d5c0 View commit details
  18. fix build

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dbd227a View commit details
  19. fix process

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1e6a27c View commit details
  20. fix 2

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    a9e5269 View commit details
  21. Copy the full SHA
    d54ee20 View commit details
  22. fix param

    ysmreg committed Mar 27, 2025
    Copy the full SHA
    e38c145 View commit details
  23. fix build

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f7203d5 View commit details
  24. fix bug

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    66e8e32 View commit details
  25. fix bug

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    587ad68 View commit details
  26. fix build

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    04cd28d View commit details
  27. fix typo

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    14adbe5 View commit details
  28. Makefile.am の更新

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    839eb5e View commit details
  29. fix build

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ffdaba9 View commit details
  30. Makefile.am の更新

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0ad6adf View commit details
  31. Makefile.am の更新

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    97df88f View commit details
  32. Makefile.am の更新

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ee6a7ed View commit details
  33. configure.ac を更新

    ysmreg authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    be1e4f4 View commit details

Commits on Mar 28, 2025

  1. move argon2

    ysmreg committed Mar 28, 2025
    Copy the full SHA
    55073bb View commit details
  2. Copy the full SHA
    fb0423d View commit details
  3. Update Makefile.am

    ysmreg committed Mar 28, 2025
    Copy the full SHA
    3e2a349 View commit details
  4. Makefile.am の更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    253fd04 View commit details
  5. Makefile.am の更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2e91144 View commit details
  6. fix build

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    748794e View commit details
  7. Makefile.am の更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    639a50c View commit details
  8. Makefile.am の更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e668013 View commit details
  9. Makefile.am の更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7da181c View commit details
  10. configure.ac を更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c30252c View commit details
  11. Update configure.ac

    ysmreg committed Mar 28, 2025
    Copy the full SHA
    c74ac2d View commit details
  12. Update configure.ac

    ysmreg committed Mar 28, 2025
    Copy the full SHA
    49f4bae View commit details
  13. README.md の更新

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8567c7a View commit details
  14. update discord

    ysmreg authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    82fb153 View commit details

Commits on Mar 29, 2025

  1. fix genesis data

    ysmreg committed Mar 29, 2025
    Copy the full SHA
    991b0f7 View commit details
Showing with 83,764 additions and 761 deletions.
  1. +3 −3 .github/ISSUE_TEMPLATE.md
  2. +13 −13 .gitignore
  3. +9 −9 CONTRIBUTING.md
  4. +2 −2 INSTALL.md
  5. +7 −6 Makefile.am
  6. +34 −71 README.md
  7. +7 −7 build_msvc/bitcoin_config.h
  8. +1 −1 ci/test/05_before_script.sh
  9. +24 −24 configure.ac
  10. +6 −6 contrib/bitcoin-cli.bash-completion
  11. +1 −1 contrib/bitcoin-qt.pro
  12. +5 −5 contrib/bitcoin-tx.bash-completion
  13. +4 −4 contrib/bitcoind.bash-completion
  14. +5 −5 contrib/linearize/example-linearize.cfg
  15. +1 −1 contrib/macdeploy/README.md
  16. +1 −1 contrib/seeds/makeseeds.py
  17. +1 −1 contrib/zmq/zmq_sub.py
  18. +2 −2 depends/README.md
  19. +1 −1 depends/description.md
  20. +2 −1 depends/packages/boost.mk
  21. +2 −1 depends/packages/qt.mk
  22. +10 −10 doc/build-osx.md
  23. +8 −8 doc/build-unix.md
  24. +6 −6 doc/build-windows.md
  25. +1 −1 doc/files.md
  26. +4 −6 doc/{release-notes-litecoin.md → release-notes-rincoin.md}
  27. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.10.2.2.md
  28. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.10.4.md
  29. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.13.2.md
  30. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.13.3.md
  31. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.14.2.md
  32. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.15.0.1.md
  33. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.15.1.md
  34. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.16.0.md
  35. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.16.2.md
  36. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.16.3.md
  37. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.17.1.md
  38. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.18.1.md
  39. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.21.1.md
  40. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.21.2.1.md
  41. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.21.2.2.md
  42. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.21.2.md
  43. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.21.3.md
  44. 0 doc/{litecoin-release-notes → rincoin-release-notes}/release-notes-0.21.4.md
  45. +12 −12 share/examples/{litecoin.conf → rincoin.conf}
  46. +5 −5 share/qt/Info.plist.in
  47. +1 −1 share/rpcauth/rpcauth.py
  48. +4 −4 share/setup.nsi.in
  49. +52 −43 src/Makefile.am
  50. +31 −31 src/Makefile.qt.include
  51. +18 −18 src/Makefile.qttest.include
  52. +1 −1 src/amount.h
  53. +1 −1 src/bench/.gitignore
  54. +1 −1 src/bench/checkblock.cpp
  55. +5 −5 src/bitcoin-cli-res.rc
  56. +9 −9 src/bitcoin-cli.cpp
  57. +5 −5 src/bitcoin-tx-res.rc
  58. +3 −3 src/bitcoin-tx.cpp
  59. +5 −5 src/bitcoin-wallet-res.rc
  60. +5 −5 src/bitcoin-wallet.cpp
  61. +5 −5 src/bitcoind-res.rc
  62. +2 −2 src/bitcoind.cpp
  63. +92 −104 src/chainparams.cpp
  64. +4 −4 src/chainparamsbase.cpp
  65. +2 −81 src/chainparamsseeds.h
  66. +1 −1 src/clientversion.cpp
  67. +1 −1 src/compat/assumptions.h
  68. +1 −0 src/consensus/params.h
  69. +158 −0 src/crypto/argon2/Argon2.sln
  70. +32 −0 src/crypto/argon2/CHANGELOG.md
  71. +314 −0 src/crypto/argon2/LICENSE
  72. +12 −0 src/crypto/argon2/Makefile.am
  73. +46 −0 src/crypto/argon2/Package.swift
  74. +303 −0 src/crypto/argon2/README.md
  75. BIN src/crypto/argon2/argon2-specs.pdf
  76. +452 −0 src/crypto/argon2/argon2.c
  77. +111 −0 src/crypto/argon2/bench.c
  78. +156 −0 src/crypto/argon2/blake2/blake2-impl.h
  79. +89 −0 src/crypto/argon2/blake2/blake2.h
  80. +390 −0 src/crypto/argon2/blake2/blake2b.c
  81. +471 −0 src/crypto/argon2/blake2/blamka-round-opt.h
  82. +56 −0 src/crypto/argon2/blake2/blamka-round-ref.h
  83. +648 −0 src/crypto/argon2/core.c
  84. +228 −0 src/crypto/argon2/core.h
  85. +463 −0 src/crypto/argon2/encoding.c
  86. +57 −0 src/crypto/argon2/encoding.h
  87. +213 −0 src/crypto/argon2/genkat.c
  88. +51 −0 src/crypto/argon2/genkat.h
  89. +437 −0 src/crypto/argon2/include/argon2.h
  90. +12,304 −0 src/crypto/argon2/kats/argon2d
  91. +1 −0 src/crypto/argon2/kats/argon2d.shasum
  92. +12,304 −0 src/crypto/argon2/kats/argon2d_v16
  93. +1 −0 src/crypto/argon2/kats/argon2d_v16.shasum
  94. +12,304 −0 src/crypto/argon2/kats/argon2i
  95. +1 −0 src/crypto/argon2/kats/argon2i.shasum
  96. +12,304 −0 src/crypto/argon2/kats/argon2i_v16
  97. +1 −0 src/crypto/argon2/kats/argon2i_v16.shasum
  98. +12,304 −0 src/crypto/argon2/kats/argon2id
  99. +1 −0 src/crypto/argon2/kats/argon2id.shasum
  100. +12,304 −0 src/crypto/argon2/kats/argon2id_v16
  101. +1 −0 src/crypto/argon2/kats/argon2id_v16.shasum
  102. +42 −0 src/crypto/argon2/kats/check-sums.ps1
  103. +13 −0 src/crypto/argon2/kats/check-sums.sh
  104. +50 −0 src/crypto/argon2/kats/test.ps1
  105. +49 −0 src/crypto/argon2/kats/test.sh
  106. +18 −0 src/crypto/argon2/libargon2.pc.in
  107. +57 −0 src/crypto/argon2/man/argon2.1
  108. +283 −0 src/crypto/argon2/opt.c
  109. +194 −0 src/crypto/argon2/ref.c
  110. +337 −0 src/crypto/argon2/run.c
  111. +289 −0 src/crypto/argon2/test.c
  112. +57 −0 src/crypto/argon2/thread.c
  113. +67 −0 src/crypto/argon2/thread.h
  114. +231 −0 src/crypto/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj
  115. +69 −0 src/crypto/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters
  116. +231 −0 src/crypto/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj
  117. +69 −0 src/crypto/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters
  118. +230 −0 src/crypto/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj
  119. +66 −0 src/crypto/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters
  120. +244 −0 src/crypto/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj
  121. +72 −0 src/crypto/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters
  122. +235 −0 src/crypto/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj
  123. +69 −0 src/crypto/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters
  124. +243 −0 src/crypto/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj
  125. +69 −0 src/crypto/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters
  126. +231 −0 src/crypto/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj
  127. +69 −0 src/crypto/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters
  128. +230 −0 src/crypto/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj
  129. +66 −0 src/crypto/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters
  130. +232 −0 src/crypto/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj
  131. +72 −0 src/crypto/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters
  132. +231 −0 src/crypto/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj
  133. +69 −0 src/crypto/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters
  134. +51 −0 src/crypto/rinhash.cpp
  135. +12 −0 src/crypto/rinhash.h
  136. +4 −4 src/init.cpp
  137. +1 −1 src/policy/feerate.h
  138. +58 −0 src/pow.cpp
  139. +3 −5 src/primitives/block.cpp
  140. +6 −6 src/qt/README.md
  141. +2 −2 src/qt/askpassphrasedialog.cpp
  142. +1 −1 src/qt/bitcoin.cpp
  143. +9 −9 src/qt/bitcoingui.cpp
  144. +6 −6 src/qt/bitcoinunits.cpp
  145. +1 −1 src/qt/editaddressdialog.cpp
  146. +5 −5 src/qt/forms/addressbookpage.ui
  147. +5 −5 src/qt/forms/debugwindow.ui
  148. +2 −2 src/qt/forms/helpmessagedialog.ui
  149. +2 −2 src/qt/forms/modaloverlay.ui
  150. +2 −2 src/qt/forms/openuridialog.ui
  151. +3 −3 src/qt/forms/optionsdialog.ui
  152. +4 −4 src/qt/forms/overviewpage.ui
  153. +6 −6 src/qt/forms/receivecoinsdialog.ui
  154. +1 −1 src/qt/forms/receiverequestdialog.ui
  155. +12 −12 src/qt/forms/sendcoinsdialog.ui
  156. +9 −9 src/qt/forms/sendcoinsentry.ui
  157. +14 −14 src/qt/forms/signverifymessagedialog.ui
  158. +5 −5 src/qt/guiconstants.h
  159. +10 −10 src/qt/guiutil.cpp
  160. +2 −2 src/qt/intro.cpp
  161. +1 −1 src/qt/macnotificationhandler.mm
  162. +1 −1 src/qt/networkstyle.cpp
  163. +6 −6 src/qt/paymentserver.cpp
  164. BIN src/qt/res/icons/bitcoin.ico
  165. BIN src/qt/res/icons/bitcoin.png
  166. BIN src/qt/res/icons/bitcoin_testnet.ico
  167. BIN src/qt/res/icons/connect0.png
  168. BIN src/qt/res/icons/connect1.png
  169. BIN src/qt/res/icons/connect2.png
  170. BIN src/qt/res/icons/connect3.png
  171. BIN src/qt/res/icons/connect4.png
  172. BIN src/qt/res/icons/litecoin_splash.png
  173. BIN src/qt/res/icons/rincoin.png
  174. BIN src/qt/res/icons/rincoin_splash.png
  175. +4 −4 src/qt/res/{bitcoin-qt-res.rc → rincoin-qt-res.rc}
  176. +3 −3 src/qt/{bitcoin.qrc → rincoin.qrc}
  177. +5 −5 src/qt/sendcoinsdialog.cpp
  178. +1 −1 src/qt/utilitydialog.cpp
  179. +2 −2 src/rpc/blockchain.cpp
  180. +4 −4 src/rpc/mining.cpp
  181. +5 −5 src/rpc/misc.cpp
  182. +1 −1 src/rpc/net.cpp
  183. +8 −8 src/rpc/rawtransaction.cpp
  184. +1 −1 src/rpc/rawtransaction_util.cpp
  185. +1 −1 src/rpc/util.cpp
  186. +1 −1 src/test/pow_tests.cpp
  187. +1 −1 src/util/message.cpp
  188. +5 −5 src/util/system.cpp
  189. +1 −1 src/validation.cpp
  190. +7 −7 src/wallet/rpcdump.cpp
  191. +40 −40 src/wallet/rpcwallet.cpp
  192. +1 −1 src/wallet/test/wallet_tests.cpp
  193. +2 −2 src/wallet/txlist.cpp
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- This issue tracker is only for technical issues related to Litecoin Core.
<!-- This issue tracker is only for technical issues related to Rincoin Core.
General litecoin questions and/or support requests and are best directed to the [litecointalk.io forums](https://litecointalk.io/).
For reporting security issues, please contact the Litecoin developers on the #litecoin-dev Freenode IRC channel or alternatively you can email us at contact@litecoin.org.
For reporting security issues, please contact the Rincoin developers on the #litecoin-dev Freenode IRC channel or alternatively you can email us at contact@litecoin.org.
If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue!
@@ -17,7 +17,7 @@ https://github.com/bitcoin-core/gui/issues/

<!--- How reliably can you reproduce the issue, what are the steps to do so? -->

<!-- What version of Litecoin Core are you using, where did you get it (website, self-compiled, etc)? -->
<!-- What version of Rincoin Core are you using, where did you get it (website, self-compiled, etc)? -->

<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

26 changes: 13 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,17 +2,17 @@

*.exe
*.pdb
src/litecoin
src/litecoind
src/litecoin-cli
src/litecoin-gui
src/litecoin-node
src/litecoin-tx
src/litecoin-wallet
src/rincoin
src/rincoind
src/rincoin-cli
src/rincoin-gui
src/rincoin-node
src/rincoin-tx
src/rincoin-wallet
src/test/fuzz/*
!src/test/fuzz/*.*
src/test/test_litecoin
src/qt/test/test_litecoin-qt
src/test/test_rincoin
src/qt/test/test_rincoin-qt

# autoreconf
Makefile.in
@@ -94,16 +94,16 @@ src/qt/bitcoin-qt.includes
*.qm
Makefile
!depends/Makefile
src/qt/litecoin-qt
Litecoin-Qt.app
src/qt/rincoin-qt
rincoin-Qt.app
background.tiff*

# Qt Creator
Makefile.am.user

# Unit-tests
Makefile.test
litecoin-qt_test
rincoin-qt_test

# Resources cpp
qrc_*.cpp
@@ -118,7 +118,7 @@ releases
*.gcno
*.gcda
/*.info
test_litecoin.coverage/
test_rincoin.coverage/
total.coverage/
fuzz.coverage/
coverage_percent.txt
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Contributing to Litecoin Core
Contributing to Rincoin Core
============================

The Litecoin Core project operates an open contributor model where anyone is
The Rincoin Core project operates an open contributor model where anyone is
welcome to contribute towards development in the form of peer review, testing
and patches. This document explains the practical process and guidelines for
contributing.
@@ -25,7 +25,7 @@ as a new contributor. It also will teach you much more about the code and
process than opening pull requests. Please refer to the [peer review](#peer-review)
section below.

Before you start contributing, familiarize yourself with the Litecoin Core build
Before you start contributing, familiarize yourself with the Rincoin Core build
system and tests. Refer to the documentation in the repository on how to build
Bitcoin Core and how to run the unit tests, functional tests, and fuzz tests.

@@ -282,11 +282,11 @@ workload on reviewing.
"Decision Making" Process
-------------------------

The following applies to code changes to the Litecoin Core project (and related
projects such as libsecp256k1), and is not to be confused with overall Litecoin
The following applies to code changes to the Rincoin Core project (and related
projects such as libsecp256k1), and is not to be confused with overall Rincoin
Network Protocol consensus changes.

Whether a pull request is merged into Litecoin Core rests with the project merge
Whether a pull request is merged into Rincoin Core rests with the project merge
maintainers and ultimately the project lead.

Maintainers will take into consideration if a patch is in line with the general
@@ -305,7 +305,7 @@ In general, all pull requests must:
demonstrating the bug and also proving the fix. This helps prevent regression.
- Change relevant comments and documentation when behaviour of code changes.

Patches that change Litecoin consensus rules are considerably more involved than
Patches that change Rincoin consensus rules are considerably more involved than
normal because they affect the entire ecosystem and so must be preceded by
extensive mailing list discussions and have a numbered BIP. While each case will
be different, one should be prepared to expend more time and effort than for
@@ -358,7 +358,7 @@ higher in terms of discussion and peer review requirements, keeping in mind that
mistakes could be very costly to the wider community. This includes refactoring
of consensus-critical code.

Where a patch set proposes to change the Litecoin consensus, it must have been
Where a patch set proposes to change the Rincoin consensus, it must have been
discussed extensively on the mailing list and IRC, be accompanied by a widely
discussed BIP and have a generally widely perceived technical consensus of being
a worthwhile change based on the judgement of the maintainers.
@@ -425,7 +425,7 @@ https://github.com/bitcoin-core/bitcoin-maintainer-tools#backport).
Release Policy
--------------

The project leader is the release manager for each Litecoin Core release.
The project leader is the release manager for each Rincoin Core release.

Copyright
---------
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Building Litecoin
Building Rincoin
================

See doc/build-*.md for instructions on building the various
elements of the Litecoin Core reference implementation of Litecoin.
elements of the Rincoin Core reference implementation of Rincoin.
13 changes: 7 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ print-%:
@echo $* = $($*)

ACLOCAL_AMFLAGS = -I build-aux/m4
SUBDIRS = src
SUBDIRS = src/crypto/argon2 src
if ENABLE_MAN
SUBDIRS += doc/man
endif
@@ -19,6 +19,7 @@ if BUILD_BITCOIN_LIBS
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libbitcoinconsensus.pc
endif
CRYPTO_LIBS += $(top_builddir)/src/crypto/argon2/libargon2.a

BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
@@ -30,7 +31,7 @@ BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win64-setup$(EXEEXT)
empty :=
space := $(empty) $(empty)

OSX_APP=Litecoin-Qt.app
OSX_APP=Rincoin-Qt.app
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
OSX_DMG = $(OSX_VOLNAME).dmg
OSX_TEMP_ISO = $(OSX_DMG:.dmg=).temp.iso
@@ -101,7 +102,7 @@ $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@

$(OSX_APP)/Contents/MacOS/Litecoin-Qt: all-recursive
$(OSX_APP)/Contents/MacOS/Rincoin-Qt: all-recursive
$(MKDIR_P) $(@D)
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $@

@@ -111,7 +112,7 @@ $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:

OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
$(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/Litecoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
$(OSX_APP)/Contents/MacOS/Rincoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings

osx_volname:
echo $(OSX_VOLNAME) >$@
@@ -136,7 +137,7 @@ $(APP_DIST_DIR)/Applications:
@rm -f $@
@cd $(@D); $(LN_S) /Applications $(@F)

$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Litecoin-Qt
$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Rincoin-Qt

.INTERMEDIATE: $(OSX_TEMP_ISO)
$(OSX_TEMP_ISO): $(APP_DIST_EXTRAS)
@@ -155,7 +156,7 @@ $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIF
$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
$(PYTHON) $< "$@" "$(OSX_VOLNAME)"

$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Litecoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Rincoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2

deploydir: $(APP_DIST_EXTRAS)
105 changes: 34 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,48 @@
Litecoin Core integration/staging tree
=====================================

[![Build Status](https://travis-ci.org/litecoin-project/litecoin.svg?branch=master)](https://travis-ci.org/litecoin-project/litecoin)
# RinCoin Core

https://litecoin.org
RinCoin is a decentralized digital currency, based on Bitcoin Core, that introduces a new Proof-of-Work hashing algorithm called **RinHash**. RinHash is a hybrid PoW algorithm designed for both security and ASIC-resistance, combining BLAKE3, Argon2d, and SHA3-256. This README provides an overview of RinCoin’s specifications, the RinHash algorithm, and network parameters.

What is Litecoin?
----------------
## Key Specifications

Litecoin is an experimental digital currency that enables instant payments to
anyone, anywhere in the world. Litecoin uses peer-to-peer technology to operate
with no central authority: managing transactions and issuing money are carried
out collectively by the network. Litecoin Core is the name of open source
software which enables the use of this currency.
- **Coin Name / Ticker:** RinCoin (**RIN**)
- **Consensus Mechanism:** Proof-of-Work (PoW) – **RinHash** algorithm (BLAKE3 → Argon2d → SHA3-256)
- **Block Target Time:** 1 minute (60 seconds per block)
- **Block Reward:** 50 RIN (initial coinbase reward per block)
- **Halving Schedule:** Reward halves every 210,000 blocks (~145 days at 1 min blocks)
- **Difficulty Adjustment:** Every 2016 blocks (~33.6 hours)
- **Proof-of-Work Hash:** 256-bit output
- **Address Format:** Base58 addresses start with **R**
- **Network Ports:** P2P: 9555, RPC: 9556
- **Network Magic:** 0x52 0x49 0x4E 0x43 ("RINC")

For more information, as well as an immediately useable, binary version of
the Litecoin Core software, see [https://litecoin.org](https://litecoin.org).
## Proof-of-Work Algorithm: RinHash

License
-------
RinHash is a custom proof-of-work algorithm using:

Litecoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more
information or see https://opensource.org/licenses/MIT.
1. **BLAKE3**: Fast initial hashing
2. **Argon2d**: Memory-hard step to resist ASICs
3. **SHA3-256**: Final standard cryptographic hash

Development Process
-------------------
A valid block satisfies:
`SHA3-256( Argon2d( BLAKE3(block_header) )) < Target`

The `master` branch is regularly built (see `doc/build-*.md` for instructions) and tested, but it is not guaranteed to be
completely stable. [Tags](https://github.com/litecoin-project/litecoin/tags) are created
regularly from release branches to indicate new official, stable release versions of Litecoin Core.
This design provides:
- Fast verification
- Memory-hardness to deter ASICs
- Compatibility with existing 256-bit PoW frameworks

The https://github.com/litecoin-project/gui repository is used exclusively for the
development of the GUI. Its master branch is identical in all monotree
repositories. Release branches and tags do not exist, so please do not fork
that repository unless it is for development reasons.
## Network and Usage

The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md)
and useful hints for developers can be found in [doc/developer-notes.md](doc/developer-notes.md).
- **Magic bytes:** `0x52 0x49 0x4E 0x43`
- **Ports:** 9555 (P2P), 9556 (RPC)
- **Mining:** CPU/GPU mining supported
- **Wallet:** Full-node wallet with RIN units

The developer [mailing list](https://groups.google.com/forum/#!forum/litecoin-dev)
should be used to discuss complicated or controversial changes before working
on a patch set.
## Developer Notes

Developer IRC can be found on Freenode at #litecoin-dev.
See `chainparams.cpp` for network configuration.
See `GetPoWHash()` for RinHash implementation.

Testing
-------

Testing and code review is the bottleneck for development; we get more pull
requests than we can review and test on short notice. Please be patient and help out by testing
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
lots of money.

### Automated Testing

Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to
submit new unit tests for old code. Unit tests can be compiled and run
(assuming they weren't disabled in configure) with: `make check`. Further details on running
and extending unit tests can be found in [/src/test/README.md](/src/test/README.md).

There are also [regression and integration tests](/test), written
in Python, that are run automatically on the build server.
These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py`

The Travis CI system makes sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

### Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the
code. This is especially important for large or high-risk changes. It is useful
to add a test plan to the pull request description if testing the changes is
not straightforward.

Translations
------------

We only accept translation fixes that are submitted through [Bitcoin Core's Transifex page](https://www.transifex.com/projects/p/bitcoin/).
Translations are converted to Litecoin periodically.

Translations are periodically pulled from Transifex and merged into the git repository. See the
[translation process](doc/translation_process.md) for details on how this works.

**Important**: We do not accept translation changes as GitHub pull requests because the next
pull from Transifex would automatically overwrite them again.
## Rincoin Communitys
[![Discord Banner 2](https://discord.com/api/guilds/1354664874176680017/widget.png?style=banner2)](https://discord.gg/Ap7TUXYRBf)
14 changes: 7 additions & 7 deletions build_msvc/bitcoin_config.h
Original file line number Diff line number Diff line change
@@ -27,10 +27,10 @@
#define COPYRIGHT_HOLDERS "The %s developers"

/* Copyright holder(s) */
#define COPYRIGHT_HOLDERS_FINAL "The Litecoin Core developers"
#define COPYRIGHT_HOLDERS_FINAL "The Rincoin Core developers"

/* Replacement for %s in copyright holders string */
#define COPYRIGHT_HOLDERS_SUBSTITUTION "Litecoin Core"
#define COPYRIGHT_HOLDERS_SUBSTITUTION "Rincoin Core"

/* Copyright year */
#define COPYRIGHT_YEAR 2024
@@ -247,19 +247,19 @@
#define LT_OBJDIR ".libs/"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://github.com/litecoin-project/litecoin/issues"
#define PACKAGE_BUGREPORT "https://github.com/Rin-coin/rincoin/issues"

/* Define to the full name of this package. */
#define PACKAGE_NAME "Litecoin Core"
#define PACKAGE_NAME "Rincoin Core"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Litecoin Core 0.21.3"
#define PACKAGE_STRING "Rincoin Core 0.21.3"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "litecoin"
#define PACKAGE_TARNAME "rincoin"

/* Define to the home page for this package. */
#define PACKAGE_URL "https://litecoin.org/"
#define PACKAGE_URL "https://coin.rin.so/"

/* Define to the version of this package. */
#define PACKAGE_VERSION "0.21.3"
2 changes: 1 addition & 1 deletion ci/test/05_before_script.sh
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ export LC_ALL=C.UTF-8
if [ "$CI_OS_NAME" == "macos" ]; then
echo > $HOME/Library/Application\ Support/Litecoin
else
DOCKER_EXEC echo \> \$HOME/.litecoin
DOCKER_EXEC echo \> \$HOME/.rincoin
fi

DOCKER_EXEC mkdir -p ${DEPENDS_DIR}/SDKs ${DEPENDS_DIR}/sdk-sources
48 changes: 24 additions & 24 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 21)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2024)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Litecoin Core]])
AC_INIT([Litecoin Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/litecoin-project/litecoin/issues],[litecoin],[https://litecoin.org/])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Rincoin Core]])
AC_INIT([Rincoin Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/Rin-coin/rincoin/issues],[rincoin],[https://coin.rin.so/])
AC_CONFIG_SRCDIR([src/validation.cpp])
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
AC_CONFIG_AUX_DIR([build-aux])
@@ -20,11 +20,11 @@ if test "x$PKG_CONFIG" = x; then
AC_MSG_ERROR([pkg-config not found])
fi

BITCOIN_DAEMON_NAME=litecoind
BITCOIN_GUI_NAME=litecoin-qt
BITCOIN_CLI_NAME=litecoin-cli
BITCOIN_TX_NAME=litecoin-tx
BITCOIN_WALLET_TOOL_NAME=litecoin-wallet
BITCOIN_DAEMON_NAME=rincoind
BITCOIN_GUI_NAME=rincoin-qt
BITCOIN_CLI_NAME=rincoin-cli
BITCOIN_TX_NAME=rincoin-tx
BITCOIN_WALLET_TOOL_NAME=rincoin-wallet

dnl Unless the user specified ARFLAGS, force it to be cr
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
@@ -266,7 +266,7 @@ AC_ARG_WITH([mpgen],

AC_ARG_ENABLE([multiprocess],
[AS_HELP_STRING([--enable-multiprocess],
[build multiprocess litecoin-node, litecoin-wallet, and litecoin-gui executables in addition to monolithic litecoind and litecoin-qt executables. Requires libmultiprocess library. Experimental (default is no)])],
[build multiprocess rincoin-node, rincoin-wallet, and rincoin-gui executables in addition to monolithic rincoind and rincoin-qt executables. Requires libmultiprocess library. Experimental (default is no)])],
[enable_multiprocess=$enableval],
[enable_multiprocess=no])

@@ -561,25 +561,25 @@ CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"

AC_ARG_WITH([utils],
[AS_HELP_STRING([--with-utils],
[build litecoin-cli litecoin-tx litecoin-wallet (default=yes)])],
[build rincoin-cli rincoin-tx rincoin-wallet (default=yes)])],
[build_bitcoin_utils=$withval],
[build_bitcoin_utils=yes])

AC_ARG_ENABLE([util-cli],
[AS_HELP_STRING([--enable-util-cli],
[build litecoin-cli])],
[build rincoin-cli])],
[build_bitcoin_cli=$enableval],
[build_bitcoin_cli=$build_bitcoin_utils])

AC_ARG_ENABLE([util-tx],
[AS_HELP_STRING([--enable-util-tx],
[build litecoin-tx])],
[build rincoin-tx])],
[build_bitcoin_tx=$enableval],
[build_bitcoin_tx=$build_bitcoin_utils])

AC_ARG_ENABLE([util-wallet],
[AS_HELP_STRING([--enable-util-wallet],
[build litecoin-wallet])],
[build rincoin-wallet])],
[build_bitcoin_wallet=$enableval],
[build_bitcoin_wallet=$build_bitcoin_utils])

@@ -591,7 +591,7 @@ AC_ARG_WITH([libs],

AC_ARG_WITH([daemon],
[AS_HELP_STRING([--with-daemon],
[build litecoind daemon (default=yes)])],
[build rincoind daemon (default=yes)])],
[build_bitcoind=$withval],
[build_bitcoind=yes])

@@ -1375,7 +1375,7 @@ if test "x$pkg_openssl" = xyes; then
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
else
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS="-lcrypto \$(top_builddir)/src/crypto/argon2/libargon2.a", AC_MSG_ERROR(libcrypto missing))
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
fi
@@ -1489,19 +1489,19 @@ if test x$build_multiprocess != xno; then
AC_SUBST(MPGEN_PREFIX)
fi

AC_MSG_CHECKING([whether to build litecoind])
AC_MSG_CHECKING([whether to build rincoind])
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
AC_MSG_RESULT($build_bitcoind)

AC_MSG_CHECKING([whether to build litecoin-cli])
AC_MSG_CHECKING([whether to build rincoin-cli])
AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes])
AC_MSG_RESULT($build_bitcoin_cli)

AC_MSG_CHECKING([whether to build litecoin-tx])
AC_MSG_CHECKING([whether to build rincoin-tx])
AM_CONDITIONAL([BUILD_BITCOIN_TX], [test x$build_bitcoin_tx = xyes])
AC_MSG_RESULT($build_bitcoin_tx)

AC_MSG_CHECKING([whether to build litecoin-wallet])
AC_MSG_CHECKING([whether to build rincoin-wallet])
AM_CONDITIONAL([BUILD_BITCOIN_WALLET], [test x$build_bitcoin_wallet = xyes])
AC_MSG_RESULT($build_bitcoin_wallet)

@@ -1598,7 +1598,7 @@ if test x$bitcoin_enable_qt != xno; then
AC_MSG_WARN("xgettext is required to update qt translations")
fi

AC_MSG_CHECKING([whether to build test_litecoin-qt])
AC_MSG_CHECKING([whether to build test_rincoin-qt])
if test x$use_gui_tests$bitcoin_enable_qt_test = xyesyes; then
AC_MSG_RESULT([yes])
BUILD_TEST_QT="yes"
@@ -1609,7 +1609,7 @@ fi

AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])

AC_MSG_CHECKING([whether to build test_litecoin])
AC_MSG_CHECKING([whether to build test_rincoin])
if test x$use_tests = xyes; then
AC_MSG_RESULT([yes])
BUILD_TEST="yes"
@@ -1734,7 +1734,7 @@ AC_SUBST(HAVE_BUILTIN_PREFETCH)
AC_SUBST(HAVE_MM_PREFETCH)
AC_SUBST(HAVE_STRONG_GETAUXVAL)
AC_SUBST(HAVE_WEAK_GETAUXVAL)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([Makefile src/Makefile src/crypto/argon2/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
AC_CONFIG_LINKS([contrib/devtools/security-check.py:contrib/devtools/security-check.py])
12 changes: 6 additions & 6 deletions contrib/bitcoin-cli.bash-completion
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# bash programmable completion for bitcoin-cli(1)
# bash programmable completion for rincoin-cli(1)
# Copyright (c) 2012-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# call $bitcoin-cli for RPC
# call $rincoin-cli for RPC
_bitcoin_rpc() {
# determine already specified args necessary for RPC
local rpcargs=()
@@ -21,8 +21,8 @@ _bitcoin_cli() {
local cur prev words=() cword
local bitcoin_cli

# save and use original argument to invoke bitcoin-cli for -help, help and RPC
# as bitcoin-cli might not be in $PATH
# save and use original argument to invoke rincoin-cli for -help, help and RPC
# as rincoin-cli might not be in $PATH
bitcoin_cli="$1"

COMPREPLY=()
@@ -104,7 +104,7 @@ _bitcoin_cli() {
_filedir -d
return 0
;;
-*=*) # prevent nonsense completions
-*=*)# prevent nonsense completions
return 0
;;
*)
@@ -130,7 +130,7 @@ _bitcoin_cli() {
;;
esac
} &&
complete -F _bitcoin_cli bitcoin-cli
complete -F _bitcoin_cli rincoin-cli

# Local variables:
# mode: shell-script
2 changes: 1 addition & 1 deletion contrib/bitcoin-qt.pro
Original file line number Diff line number Diff line change
@@ -19,4 +19,4 @@ FORMS += \
../src/qt/forms/createwalletdialog.ui

RESOURCES += \
../src/qt/bitcoin.qrc
../src/qt/rincoin.qrc
10 changes: 5 additions & 5 deletions contrib/bitcoin-tx.bash-completion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bash programmable completion for bitcoin-tx(1)
# bash programmable completion for rincoin-tx(1)
# Copyright (c) 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.
@@ -7,7 +7,7 @@ _bitcoin_tx() {
local cur prev words=() cword
local bitcoin_tx

# save and use original argument to invoke bitcoin-tx for -help
# save and use original argument to invoke rincoin-tx for -help
# it might not be in $PATH
bitcoin_tx="$1"

@@ -20,14 +20,14 @@ _bitcoin_tx() {
_filedir
return 0
;;
*=*) # prevent attempts to complete other arguments
*=*)# prevent attempts to complete other arguments
return 0
;;
esac

if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then
# only options (or an uncompletable hex-string) allowed
# parse bitcoin-tx -help for options
# parse rincoin-tx -help for options
local helpopts
helpopts=$($bitcoin_tx -help | sed -e '/^ -/ p' -e d )
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )
@@ -46,7 +46,7 @@ _bitcoin_tx() {

return 0
} &&
complete -F _bitcoin_tx bitcoin-tx
complete -F _bitcoin_tx rincoin-tx

# Local variables:
# mode: shell-script
8 changes: 4 additions & 4 deletions contrib/bitcoind.bash-completion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bash programmable completion for bitcoind(1) and bitcoin-qt(1)
# bash programmable completion for rincoind(1) and rincoin-qt(1)
# Copyright (c) 2012-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -7,7 +7,7 @@ _bitcoind() {
local cur prev words=() cword
local bitcoind

# save and use original argument to invoke bitcoind for -help
# save and use original argument to invoke rincoind for -help
# it might not be in $PATH
bitcoind="$1"

@@ -25,7 +25,7 @@ _bitcoind() {
_filedir -d
return 0
;;
-*=*) # prevent nonsense completions
-*=*)# prevent nonsense completions
return 0
;;
*)
@@ -45,7 +45,7 @@ _bitcoind() {
;;
esac
} &&
complete -F _bitcoind bitcoind bitcoin-qt
complete -F _bitcoind rincoind rincoin-qt

# Local variables:
# mode: shell-script
10 changes: 5 additions & 5 deletions contrib/linearize/example-linearize.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# litecoind RPC settings (linearize-hashes)
rpcuser=someuser
rpcpassword=somepassword
#datadir=~/.litecoin
#datadir=~/.rincoin
host=127.0.0.1

#mainnet default
@@ -22,14 +22,14 @@ max_height=313000
# bootstrap.dat input/output settings (linearize-data)

# mainnet
netmagic=fbc0b6db
genesis=12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2
input=/home/example/.litecoin/blocks
netmagic=52494E43
genesis=c93937b9649bf1ef4f09f1ac835bba3563e016fda7425ad8b47d5a0bc2d80000
input=/home/example/.rincoin/blocks

# testnet
#netmagic=fdd2c8f1
#genesis=4966625a4b2851d9fdee139e56211a0d88575f59ed816ff5e6a63deb4e3e29a0
#input=/home/example/.litecoin/testnet3/blocks
#input=/home/example/.rincoin/testnet3/blocks

# regtest
#netmagic=fabfb5da
2 changes: 1 addition & 1 deletion contrib/macdeploy/README.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ During the deployment process, the disk image window will pop up briefly
when the fancy settings are applied. This is normal, please do not interfere,
the process will unmount the DMG and cleanup before finishing.

When complete, it will have produced `Litecoin-Qt.dmg`.
When complete, it will have produced `Rincoin-Qt.dmg`.

## SDK Extraction

2 changes: 1 addition & 1 deletion contrib/seeds/makeseeds.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")
PATTERN_ONION = re.compile(r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$")
PATTERN_AGENT = re.compile(
r"^/LitecoinCore:("
r"^/RincoinCore:("
r"0.14.(0|1|2|3|99)|"
r"0.15.(0|1|2|99)|"
r"0.16.(0|1|2|3|99)|"
2 changes: 1 addition & 1 deletion contrib/zmq/zmq_sub.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"""
ZMQ example using python3's asyncio
Litecoind should be started with the command line arguments:
Rincoind should be started with the command line arguments:
litecoind -testnet -daemon \
-zmqpubrawtx=tcp://127.0.0.1:28332 \
-zmqpubrawblock=tcp://127.0.0.1:28332 \
4 changes: 2 additions & 2 deletions depends/README.md
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@ For example:

make HOST=x86_64-w64-mingw32 -j4

**Litecoin Core's configure script by default will ignore the depends output.** In
**Rincoin Core's configure script by default will ignore the depends output.** In
order for it to pick up libraries, tools, and settings from the depends build,
you must point it at the appropriate `--prefix` directory generated by the
build. In the above example, a prefix dir named x86_64-w64-mingw32 will be
created. To use it for Litecoin:
created. To use it for Rincoin:

./configure --prefix=$PWD/depends/x86_64-w64-mingw32

2 changes: 1 addition & 1 deletion depends/description.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a system of building and caching dependencies necessary for building Litecoin.
This is a system of building and caching dependencies necessary for building Rincoin.
There are several features that make it different from most similar systems:

### It is designed to be builder and host agnostic
3 changes: 2 additions & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
@@ -34,7 +34,8 @@ endef

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam && \
sed -i '1i#undef PTHREAD_STACK_MIN\n#define PTHREAD_STACK_MIN 16384' boost/thread/pthread/thread_data.hpp
endef

define $(package)_config_cmds
3 changes: 2 additions & 1 deletion depends/packages/qt.mk
Original file line number Diff line number Diff line change
@@ -224,7 +224,8 @@ define $(package)_preprocess_cmds
sed -i.old "0,/^QMAKE_LFLAGS_/s|^QMAKE_LFLAGS_|!host_build: QMAKE_LFLAGS = $($(package)_ldflags)\n&|" qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old "s|QMAKE_CC = clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \
sed -i.old "s|QMAKE_CXX = clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf && \
sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf
sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf && \
sed -i '1i#include <limits>\n#include <algorithm>' qtbase/src/corelib/tools/qbytearraymatcher.h
endef

define $(package)_config_cmds
20 changes: 10 additions & 10 deletions doc/build-osx.md
Original file line number Diff line number Diff line change
@@ -62,17 +62,17 @@ Also, the Homebrew package could be installed:
brew install berkeley-db4
```

## Build Litecoin Core
## Build Rincoin Core

1. Clone the Litecoin Core source code:
1. Clone the Rincoin Core source code:
```shell
git clone https://github.com/litecoin-project/litecoin
cd litecoin
```

2. Build Litecoin Core:
2. Build Rincoin Core:

Configure and build the headless Litecoin Core binaries as well as the GUI (if Qt is found).
Configure and build the headless Rincoin Core binaries as well as the GUI (if Qt is found).

You can disable the GUI build by passing `--without-gui` to configure.
```shell
@@ -92,7 +92,7 @@ brew install berkeley-db4
```

## Disable-wallet mode
When the intention is to run only a P2P node without a wallet, Litecoin Core may be
When the intention is to run only a P2P node without a wallet, Rincoin Core may be
compiled in disable-wallet mode with:
```shell
./configure --disable-wallet
@@ -103,23 +103,23 @@ In this case there is no dependency on [*Berkeley DB*](#berkeley-db) and [*SQLit
Mining is also possible in disable-wallet mode using the `getblocktemplate` RPC call.

## Running
Litecoin Core is now available at `./src/litecoind`
Rincoin Core is now available at `./src/litecoind`

Before running, you may create an empty configuration file:
```shell
mkdir -p "/Users/${USER}/Library/Application Support/Litecoin"
mkdir -p "/Users/${USER}/Library/Application Support/Rincoin"
touch "/Users/${USER}/Library/Application Support/Litecoin/litecoin.conf"
touch "/Users/${USER}/Library/Application Support/Rincoin/litecoin.conf"
chmod 600 "/Users/${USER}/Library/Application Support/Litecoin/litecoin.conf"
chmod 600 "/Users/${USER}/Library/Application Support/Rincoin/litecoin.conf"
```

The first time you run litecoind, it will start downloading the blockchain. This process could
take many hours, or even days on slower than average systems.

You can monitor the download process by looking at the debug.log file:
```shell
tail -f $HOME/Library/Application\ Support/Litecoin/debug.log
tail -f $HOME/Library/Application\ Support/Rincoin/debug.log
```

## Other commands:
16 changes: 8 additions & 8 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
UNIX BUILD NOTES
====================
Some notes on how to build Litecoin Core in Unix.
Some notes on how to build Rincoin Core in Unix.

(For BSD specific instructions, see `build-*bsd.md` in this directory.)

Note
---------------------
Always use absolute paths to configure and compile Litecoin Core and the dependencies.
Always use absolute paths to configure and compile Rincoin Core and the dependencies.
For example, when specifying the path of the dependency:

../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
@@ -54,7 +54,7 @@ Memory Requirements
--------------------

C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of
memory available when compiling Litecoin Core. On systems with less, gcc can be
memory available when compiling Rincoin Core. On systems with less, gcc can be
tuned to conserve memory with additional CXXFLAGS:


@@ -96,7 +96,7 @@ SQLite is required for the wallet:

sudo apt install libsqlite3-dev

To build Litecoin Core without wallet, see [*Disable-wallet mode*](/doc/build-unix.md#disable-wallet-mode)
To build Rincoin Core without wallet, see [*Disable-wallet mode*](/doc/build-unix.md#disable-wallet-mode)


Optional (see `--with-miniupnpc` and `--enable-upnp-default`):
@@ -196,7 +196,7 @@ If you need to build Boost yourself:

Security
--------
To help make your Litecoin Core installation more secure by making certain attacks impossible to
To help make your Rincoin Core installation more secure by making certain attacks impossible to
exploit even if a vulnerability is found, binaries are hardened by default.
This can be disabled with:

@@ -226,7 +226,7 @@ Hardening enables the following features:
ET_DYN

* _Non-executable Stack_: If the stack is executable then trivial stack-based buffer overflow exploits are possible if
vulnerable buffers are found. By default, Litecoin Core should be built with a non-executable stack,
vulnerable buffers are found. By default, Rincoin Core should be built with a non-executable stack,
but if one of the libraries it uses asks for an executable stack or someone makes a mistake
and uses a compiler extension which requires an executable stack, it will silently build an
executable without the non-executable stack protection.
@@ -242,7 +242,7 @@ Hardening enables the following features:

Disable-wallet mode
--------------------
When the intention is to run only a P2P node without a wallet, Litecoin Core may be compiled in
When the intention is to run only a P2P node without a wallet, Rincoin Core may be compiled in
disable-wallet mode with:

./configure --disable-wallet
@@ -273,7 +273,7 @@ Note:
Enabling wallet support requires either compiling against a Berkeley DB newer than 4.8 (package `db`) using `--with-incompatible-bdb`,
or building and depending on a local version of Berkeley DB 4.8. The readily available Arch Linux packages are currently built using
`--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD).
As mentioned above, when maintaining portability of the wallet between the standard Litecoin Core distributions and independently built
As mentioned above, when maintaining portability of the wallet between the standard Rincoin Core distributions and independently built
node software is desired, Berkeley DB 4.8 must be used.


12 changes: 6 additions & 6 deletions doc/build-windows.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
WINDOWS BUILD NOTES
====================

Below are some notes on how to build Litecoin Core for Windows.
Below are some notes on how to build Rincoin Core for Windows.

The options known to work for building Litecoin Core on Windows are:
The options known to work for building Rincoin Core on Windows are:

* On Linux, using the [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Ubuntu Bionic 18.04 is required
and is the platform used to build the Litecoin Core Windows release binaries.
and is the platform used to build the Rincoin Core Windows release binaries.
* On Windows, using [Windows
Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about) and the Mingw-w64 cross compiler tool chain.
* On Windows, using a native compiler tool chain such as [Visual Studio](https://www.visualstudio.com). See [README.md](/build_msvc/README.md).
@@ -87,7 +87,7 @@ Ubuntu Bionic 18.04 <sup>[1](#footnote1)</sup>:

Once the toolchain is installed the build steps are common:

Note that for WSL the Litecoin Core source path MUST be somewhere in the default mount file system, for
Note that for WSL the Rincoin Core source path MUST be somewhere in the default mount file system, for
example /usr/src/litecoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
This means you cannot use a directory that is located directly on the host Windows file system to perform the build.

@@ -133,5 +133,5 @@ Footnotes
compiler options to allow a choice between either posix or win32 threads. The default option is win32 threads which is the more
efficient since it will result in binary code that links directly with the Windows kernel32.lib. Unfortunately, the headers
required to support win32 threads conflict with some of the classes in the C++11 standard library, in particular std::mutex.
It's not possible to build the Litecoin Core code using the win32 version of the Mingw-w64 cross compilers (at least not without
modifying headers in the Litecoin Core source code).
It's not possible to build the Rincoin Core code using the win32 version of the Mingw-w64 cross compilers (at least not without
modifying headers in the Rincoin Core source code).
2 changes: 1 addition & 1 deletion doc/files.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ The data directory is the default location where the Litecoin Core files are sto

Platform | Data directory path
---------|--------------------
Linux | `$HOME/.litecoin/`
Linux | `$HOME/.rincoin/`
macOS | `$HOME/Library/Application Support/Litecoin/`
Windows | `%APPDATA%\Litecoin\` <sup>[\[1\]](#note1)</sup>

10 changes: 4 additions & 6 deletions doc/release-notes-litecoin.md → doc/release-notes-rincoin.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Litecoin Core version 0.21.4 is now available from:
Rincoin Core version 0.21.4 is now available from:

<https://download.litecoin.org/litecoin-0.21.4/>.
<https://download.rin.so/rincoin-0.21.4/>

This is a new patch version release that includes, new features and important security updates.

Please report bugs using the issue tracker at GitHub:

<https://github.com/litecoin-project/litecoin/issues>
<https://github.com/rincoin/rincoin/issues>

Notable changes
===============
@@ -44,6 +44,4 @@ Credits
Thanks to everyone who directly contributed to this release:

- [The Bitcoin Core Developers](https://github.com/bitcoin/bitcoin/)
- [David Burkett](https://github.com/DavidBurkett/)
- [Hector Chu](https://github.com/hectorchu)
- [Loshan](https://github.com/losh11)
- [The Rincoin Core Developers](https://github.com/rincoin/rincoin/)
24 changes: 12 additions & 12 deletions share/examples/litecoin.conf → share/examples/rincoin.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##
## litecoin.conf configuration file. Lines beginning with # are comments.
## rincoin.conf configuration file. Lines beginning with # are comments.
##

# Network-related settings:
@@ -67,18 +67,18 @@
#maxconnections=

#
# JSON-RPC options (for controlling a running Litecoin/litecoind process)
# JSON-RPC options (for controlling a running Rincoin/rincoind process)
#

# server=1 tells Litecoin-Qt and litecoind to accept JSON-RPC commands
# server=1 tells Rincoin-Qt and rincoind to accept JSON-RPC commands
#server=0

# Bind to given address to listen for JSON-RPC connections.
# Refer to the manpage or litecoind -help for further details.
# Refer to the manpage or rincoind -help for further details.
#rpcbind=<addr>

# If no rpcpassword is set, rpc cookie auth is sought. The default `-rpccookiefile` name
# is .cookie and found in the `-datadir` being used for litecoind. This option is typically used
# is .cookie and found in the `-datadir` being used for rincoind. This option is typically used
# when the server and client are run as the same user.
#
# If not, you must set rpcuser and rpcpassword to secure the JSON-RPC API.
@@ -87,7 +87,7 @@
# using the output from the script in share/rpcauth/rpcauth.py after providing a username:
#
# ./share/rpcauth/rpcauth.py alice
# String to be appended to litecoin.conf:
# String to be appended to rincoin.conf:
# rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae
# Your password:
# DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
@@ -99,7 +99,7 @@
# You can even add multiple entries of these to the server conf file, and client can use any of them:
# rpcauth=bob:b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99

# How many seconds litecoin will wait for a complete RPC HTTP request.
# How many seconds rincoin will wait for a complete RPC HTTP request.
# after the HTTP connection is established.
#rpcclienttimeout=30

@@ -110,16 +110,16 @@
# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,
# because the rpcpassword is transmitted over the network unencrypted.

# server=1 tells Litecoin-Qt to accept JSON-RPC commands.
# it is also read by litecoind to determine if RPC should be enabled
# server=1 tells Rincoin-Qt to accept JSON-RPC commands.
# it is also read by rincoind to determine if RPC should be enabled
#rpcallowip=10.1.1.34/255.255.255.0
#rpcallowip=1.2.3.4/24
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96

# Listen for RPC connections on this TCP port:
#rpcport=9332

# You can use Litecoin or litecoind to send commands to Litecoin/litecoind
# You can use Rincoin or rincoind to send commands to Rincoin/rincoind
# running on another host using this option:
#rpcconnect=127.0.0.1

@@ -133,7 +133,7 @@
# This setting is over-ridden by the -paytxfee option.
#txconfirmtarget=n

# Pay a transaction fee every time you send litecoins.
# Pay a transaction fee every time you send rincoins.
#paytxfee=0.000x

# Miscellaneous options
@@ -151,7 +151,7 @@

# User interface options

# Start Litecoin minimized
# Start Rincoin minimized
#min=1

# Minimize to the system tray
10 changes: 5 additions & 5 deletions share/qt/Info.plist.in
Original file line number Diff line number Diff line change
@@ -29,27 +29,27 @@
<string>????</string>

<key>CFBundleExecutable</key>
<string>Litecoin-Qt</string>
<string>rincoin-Qt</string>

<key>CFBundleName</key>
<string>Litecoin-Qt</string>
<string>rincoin-Qt</string>

<key>LSHasLocalizedDisplayName</key>
<true/>

<key>CFBundleIdentifier</key>
<string>org.litecoin.Litecoin-Qt</string>
<string>org.rincoin.rincoin-Qt</string>

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>org.litecoin.LitecoinPayment</string>
<string>org.rincoin.rincoinPayment</string>
<key>CFBundleURLSchemes</key>
<array>
<string>litecoin</string>
<string>rincoin</string>
</array>
</dict>
</array>
2 changes: 1 addition & 1 deletion share/rpcauth/rpcauth.py
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ def main():
salt = generate_salt(16)
password_hmac = password_to_hmac(salt, args.password)

print('String to be appended to litecoin.conf:')
print('String to be appended to rincoin.conf:')
print('rpcauth={0}:{1}${2}'.format(args.username, salt, password_hmac))
print('Your password:\n{0}'.format(args.password))

8 changes: 4 additions & 4 deletions share/setup.nsi.in
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ Var StartMenuGroup
!insertmacro MUI_LANGUAGE English

# Installer attributes
InstallDir $PROGRAMFILES64\Litecoin
InstallDir $PROGRAMFILES64\rincoin
CRCCheck on
XPStyle on
BrandingText " "
@@ -99,12 +99,12 @@ Section -post SEC0001
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "@PACKAGE_VERSION@"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\litecoin-qt.exe
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\rincoin-qt.exe
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
WriteRegStr HKCR "@PACKAGE_TARNAME@" "URL Protocol" ""
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Litecoin"
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:rincoin"
WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
SectionEnd
@@ -137,7 +137,7 @@ Section -un.post UNSEC0001
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet, 64-bit).lnk"
Delete /REBOOTOK "$SMSTARTUP\Litecoin.lnk"
Delete /REBOOTOK "$SMSTARTUP\rincoin.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
Delete /REBOOTOK $INSTDIR\debug.log
Delete /REBOOTOK $INSTDIR\db.log
95 changes: 52 additions & 43 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -88,22 +88,22 @@ TESTS =
BENCHMARKS =

if BUILD_BITCOIND
bin_PROGRAMS += litecoind
bin_PROGRAMS += rincoind
endif

if BUILD_BITCOIN_NODE
bin_PROGRAMS += litecoin-node
bin_PROGRAMS += rincoin-node
endif

if BUILD_BITCOIN_CLI
bin_PROGRAMS += litecoin-cli
bin_PROGRAMS += rincoin-cli
endif
if BUILD_BITCOIN_TX
bin_PROGRAMS += litecoin-tx
bin_PROGRAMS += rincoin-tx
endif
if ENABLE_WALLET
if BUILD_BITCOIN_WALLET
bin_PROGRAMS += litecoin-wallet
bin_PROGRAMS += rincoin-wallet
endif
endif

@@ -459,6 +459,7 @@ crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
crypto_libbitcoin_crypto_base_a_SOURCES = \
crypto/aes.cpp \
crypto/aes.h \
crypto/argon2/include/argon2.h \
crypto/chacha_poly_aead.h \
crypto/chacha_poly_aead.cpp \
crypto/chacha20.h \
@@ -472,6 +473,8 @@ crypto_libbitcoin_crypto_base_a_SOURCES = \
crypto/hmac_sha512.h \
crypto/poly1305.h \
crypto/poly1305.cpp \
crypto/rinhash.cpp \
crypto/rinhash.h \
crypto/ripemd160.cpp \
crypto/ripemd160.h \
crypto/scrypt.cpp \
@@ -489,6 +492,8 @@ crypto_libbitcoin_crypto_base_a_SOURCES = \
crypto/siphash.h \
libmw/src/crypto/Hasher.cpp

crypto_libbitcoin_crypto_base_a_LIBADD = $(builddir)/crypto/argon2/libargon2.a

if USE_ASM
crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
endif
@@ -644,16 +649,16 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
#

# bitcoind & bitcoin-node binaries #
litecoin_daemon_sources = bitcoind.cpp
litecoin_bin_cppflags = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
litecoin_bin_cxxflags = $(AM_CXXFLAGS) $(PIE_FLAGS)
litecoin_bin_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
rincoin_daemon_sources = bitcoind.cpp
rincoin_bin_cppflags = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
rincoin_bin_cxxflags = $(AM_CXXFLAGS) $(PIE_FLAGS)
rincoin_bin_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)

if TARGET_WINDOWS
litecoin_daemon_sources += bitcoind-res.rc
rincoin_daemon_sources += bitcoind-res.rc
endif

litecoin_bin_ldadd = \
rincoin_bin_ldadd = \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
@@ -667,50 +672,54 @@ litecoin_bin_ldadd = \
$(LIBSECP256K1) \
$(LIBMW)

litecoin_bin_ldadd += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS) $(SQLITE_LIBS) $(MWEB_LIBS)
rincoin_bin_ldadd += \
$(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS) $(SQLITE_LIBS) \
$(MWEB_LIBS)


litecoind_SOURCES = $(litecoin_daemon_sources)
litecoind_CPPFLAGS = $(litecoin_bin_cppflags)
litecoind_CXXFLAGS = $(litecoin_bin_cxxflags)
litecoind_LDFLAGS = $(litecoin_bin_ldflags)
litecoind_LDADD = $(LIBBITCOIN_SERVER) $(litecoin_bin_ldadd)
rincoind_SOURCES = $(rincoin_daemon_sources)
rincoind_CPPFLAGS = $(rincoin_bin_cppflags)
rincoind_CXXFLAGS = $(rincoin_bin_cxxflags)
rincoind_LDFLAGS = $(rincoin_bin_ldflags)
rincoind_LDADD = $(LIBBITCOIN_SERVER) $(rincoin_bin_ldadd)

litecoin_node_SOURCES = $(litecoin_daemon_sources)
litecoin_node_CPPFLAGS = $(litecoin_bin_cppflags)
litecoin_node_CXXFLAGS = $(litecoin_bin_cxxflags)
litecoin_node_LDFLAGS = $(litecoin_bin_ldflags)
litecoin_node_LDADD = $(LIBBITCOIN_SERVER) $(litecoin_bin_ldadd)
rincoin_node_SOURCES = $(rincoin_daemon_sources)
rincoin_node_CPPFLAGS = $(rincoin_bin_cppflags)
rincoin_node_CXXFLAGS = $(rincoin_bin_cxxflags)
rincoin_node_LDFLAGS = $(rincoin_bin_ldflags)
rincoin_node_LDADD = $(LIBBITCOIN_SERVER) $(rincoin_bin_ldadd)

# bitcoin-cli binary #
litecoin_cli_SOURCES = bitcoin-cli.cpp
litecoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
litecoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
litecoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
rincoin_cli_SOURCES = bitcoin-cli.cpp
rincoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
rincoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
rincoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)

if TARGET_WINDOWS
litecoin_cli_SOURCES += bitcoin-cli-res.rc
rincoin_cli_SOURCES += bitcoin-cli-res.rc
endif

litecoin_cli_LDADD = \
rincoin_cli_LDADD = \
$(LIBBITCOIN_CLI) \
$(LIBUNIVALUE) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CRYPTO)

litecoin_cli_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS) $(MWEB_LIBS)
rincoin_cli_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS) $(MWEB_LIBS)
#

# bitcoin-tx binary #
litecoin_tx_SOURCES = bitcoin-tx.cpp
litecoin_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
litecoin_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
litecoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
rincoin_tx_SOURCES = bitcoin-tx.cpp
rincoin_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
rincoin_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
rincoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)

if TARGET_WINDOWS
litecoin_tx_SOURCES += bitcoin-tx-res.rc
rincoin_tx_SOURCES += bitcoin-tx-res.rc
endif

litecoin_tx_LDADD = \
rincoin_tx_LDADD = \
$(LIBUNIVALUE) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
@@ -719,17 +728,17 @@ litecoin_tx_LDADD = \
$(LIBSECP256K1) \
$(LIBMW)

litecoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) $(MWEB_LIBS)
rincoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) $(MWEB_LIBS)

# bitcoin-wallet binary #
litecoin_wallet_SOURCES = bitcoin-wallet.cpp
litecoin_wallet_CPPFLAGS = $(litecoin_bin_cppflags)
litecoin_wallet_CXXFLAGS = $(litecoin_bin_cxxflags)
litecoin_wallet_LDFLAGS = $(litecoin_bin_ldflags)
litecoin_wallet_LDADD = $(LIBBITCOIN_WALLET_TOOL) $(litecoin_bin_ldadd)
rincoin_wallet_SOURCES = bitcoin-wallet.cpp
rincoin_wallet_CPPFLAGS = $(rincoin_bin_cppflags)
rincoin_wallet_CXXFLAGS = $(rincoin_bin_cxxflags)
rincoin_wallet_LDFLAGS = $(rincoin_bin_ldflags)
rincoin_wallet_LDADD = $(LIBBITCOIN_WALLET_TOOL) $(rincoin_bin_ldadd)

if TARGET_WINDOWS
litecoin_wallet_SOURCES += bitcoin-wallet-res.rc
rincoin_wallet_SOURCES += bitcoin-wallet-res.rc
endif
#

@@ -743,7 +752,7 @@ if GLIBC_BACK_COMPAT
endif

libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) $(CRYPTO_LIBS) $(MWEB_LIBS)
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) $(CRYPTO_LIBS) $(MWEB_LIBS) $(LIBBITCOIN_UTIL)
libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1-zkp/include -DBUILD_BITCOIN_INTERNAL $(SSL_CFLAGS) $(LIBMW_CPPFLAGS)
libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

62 changes: 31 additions & 31 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

bin_PROGRAMS += qt/litecoin-qt
bin_PROGRAMS += qt/rincoin-qt

if BUILD_BITCOIN_GUI
bin_PROGRAMS += litecoin-gui
bin_PROGRAMS += rincoin-gui
endif

EXTRA_LIBRARIES += qt/libbitcoinqt.a
@@ -99,7 +99,7 @@ QT_MOC = \
qt/rpcconsole.moc

QT_QRC_CPP = qt/qrc_bitcoin.cpp
QT_QRC = qt/bitcoin.qrc
QT_QRC = qt/rincoin.qrc
QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp
QT_QRC_LOCALE = qt/bitcoin_locale.qrc

@@ -168,7 +168,7 @@ RES_ICONS = \
qt/res/icons/address-book.png \
qt/res/icons/bitcoin.ico \
qt/res/icons/bitcoin_testnet.ico \
qt/res/icons/bitcoin.png \
qt/res/icons/rincoin.png \
qt/res/icons/chevron.png \
qt/res/icons/clock1.png \
qt/res/icons/clock2.png \
@@ -192,7 +192,7 @@ RES_ICONS = \
qt/res/icons/hd_disabled.png \
qt/res/icons/hd_enabled.png \
qt/res/icons/history.png \
qt/res/icons/litecoin_splash.png \
qt/res/icons/rincoin_splash.png \
qt/res/icons/lock_closed.png \
qt/res/icons/lock_open.png \
qt/res/icons/network_disabled.png \
@@ -279,7 +279,7 @@ endif # ENABLE_WALLET

RES_ANIMATION = $(wildcard $(srcdir)/qt/res/animation/spinner-*.png)

BITCOIN_RC = qt/res/bitcoin-qt-res.rc
BITCOIN_RC = qt/res/rincoin-qt-res.rc

BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS

@@ -305,40 +305,40 @@ $(QT_MOC): $(QT_FORMS_H)
$(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) $(bitcoin_gui_OBJECTS) : | $(QT_MOC)

# bitcoin-qt and bitcoin-gui binaries #
litecoin_qt_cppflags = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
rincoin_qt_cppflags = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QR_CFLAGS)
litecoin_qt_cxxflags = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
rincoin_qt_cxxflags = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)

litecoin_qt_sources = qt/main.cpp
rincoin_qt_sources = qt/main.cpp
if TARGET_WINDOWS
litecoin_qt_sources += $(BITCOIN_RC)
rincoin_qt_sources += $(BITCOIN_RC)
endif
litecoin_qt_ldadd = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
rincoin_qt_ldadd = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
if ENABLE_WALLET
litecoin_qt_ldadd += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
rincoin_qt_ldadd += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
endif
if ENABLE_ZMQ
litecoin_qt_ldadd += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
rincoin_qt_ldadd += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif
litecoin_qt_ldadd += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \
rincoin_qt_ldadd += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \
$(LIBMW) $(MWEB_LIBS) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) $(CRYPTO_LIBS) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS)
litecoin_qt_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
litecoin_qt_libtoolflags = $(AM_LIBTOOLFLAGS) --tag CXX

qt_litecoin_qt_CPPFLAGS = $(litecoin_qt_cppflags)
qt_litecoin_qt_CXXFLAGS = $(litecoin_qt_cxxflags)
qt_litecoin_qt_SOURCES = $(litecoin_qt_sources)
qt_litecoin_qt_LDADD = $(litecoin_qt_ldadd)
qt_litecoin_qt_LDFLAGS = $(litecoin_qt_ldflags)
qt_litecoin_qt_LIBTOOLFLAGS = $(litecoin_qt_libtoolflags)

litecoin_gui_CPPFLAGS = $(litecoin_qt_cppflags)
litecoin_gui_CXXFLAGS = $(litecoin_qt_cxxflags)
litecoin_gui_SOURCES = $(litecoin_qt_sources)
litecoin_gui_LDADD = $(litecoin_qt_ldadd)
litecoin_gui_LDFLAGS = $(litecoin_qt_ldflags)
litecoin_gui_LIBTOOLFLAGS = $(litecoin_qt_libtoolflags)
rincoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
rincoin_qt_libtoolflags = $(AM_LIBTOOLFLAGS) --tag CXX

qt_rincoin_qt_CPPFLAGS = $(rincoin_qt_cppflags)
qt_rincoin_qt_CXXFLAGS = $(rincoin_qt_cxxflags)
qt_rincoin_qt_SOURCES = $(rincoin_qt_sources)
qt_rincoin_qt_LDADD = $(rincoin_qt_ldadd)
qt_rincoin_qt_LDFLAGS = $(rincoin_qt_LDFLAGS)
qt_rincoin_qt_LIBTOOLFLAGS = $(rincoin_qt_libtoolflags)

litecoin_gui_CPPFLAGS = $(rincoin_qt_cppflags)
litecoin_gui_CXXFLAGS = $(rincoin_qt_cxxflags)
rincoin_gui_SOURCES = $(rincoin_qt_sources)
rincoin_gui_LDADD = $(rincoin_qt_ldadd)
litecoin_gui_LDFLAGS = $(rincoin_qt_LDFLAGS)
litecoin_gui_LIBTOOLFLAGS = $(rincoin_qt_libtoolflags)

#locale/foo.ts -> locale/foo.qm
QT_QM=$(QT_TS:.ts=.qm)
@@ -370,7 +370,7 @@ CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda
CLEANFILES += $(CLEAN_QT)

bitcoin_qt_clean: FORCE
rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_litecoin_qt_OBJECTS) qt/litecoin-qt$(EXEEXT) $(LIBBITCOINQT)
rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_rincoin_qt_OBJECTS) qt/litecoin-qt$(EXEEXT) $(LIBBITCOINQT)

bitcoin_qt : qt/litecoin-qt$(EXEEXT)

36 changes: 18 additions & 18 deletions src/Makefile.qttest.include
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

bin_PROGRAMS += qt/test/test_litecoin-qt
TESTS += qt/test/test_litecoin-qt
bin_PROGRAMS += qt/test/test_rincoin-qt
TESTS += qt/test/test_rincoin-qt

TEST_QT_MOC_CPP = \
qt/test/moc_apptests.cpp \
@@ -26,10 +26,10 @@ TEST_QT_H = \
qt/test/util.h \
qt/test/wallettests.h

qt_test_test_litecoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
qt_test_test_rincoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_TEST_INCLUDES)

qt_test_test_litecoin_qt_SOURCES = \
qt_test_test_rincoin_qt_SOURCES = \
qt/test/apptests.cpp \
qt/test/compattests.cpp \
qt/test/rpcnestedtests.cpp \
@@ -38,36 +38,36 @@ qt_test_test_litecoin_qt_SOURCES = \
qt/test/util.cpp \
$(TEST_QT_H)
if ENABLE_WALLET
qt_test_test_litecoin_qt_SOURCES += \
qt_test_test_rincoin_qt_SOURCES += \
qt/test/addressbooktests.cpp \
qt/test/wallettests.cpp \
wallet/test/wallet_test_fixture.cpp
endif # ENABLE_WALLET

nodist_qt_test_test_litecoin_qt_SOURCES = $(TEST_QT_MOC_CPP)
nodist_qt_test_test_rincoin_qt_SOURCES = $(TEST_QT_MOC_CPP)

qt_test_test_litecoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) $(LIBTEST_UTIL)
qt_test_test_rincoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) $(LIBTEST_UTIL)
if ENABLE_WALLET
qt_test_test_litecoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
qt_test_test_rincoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET)
endif
if ENABLE_ZMQ
qt_test_test_litecoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
qt_test_test_rincoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif
qt_test_test_litecoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
qt_test_test_rincoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
$(LIBLEVELDB_SSE42) $(LIBMEMENV) $(LIBMW) $(MWEB_LIBS) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
$(QR_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS)
qt_test_test_litecoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
qt_test_test_litecoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
qt_test_test_rincoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
qt_test_test_rincoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)

CLEAN_LITECOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno
CLEAN_RINCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno

CLEANFILES += $(CLEAN_LITECOIN_QT_TEST)
CLEANFILES += $(CLEAN_RINCOIN_QT_TEST)

test_litecoin_qt : qt/test/test_litecoin-qt$(EXEEXT)
test_rincoin_qt : qt/test/test_rincoin-qt$(EXEEXT)

test_litecoin_qt_check : qt/test/test_litecoin-qt$(EXEEXT) FORCE
test_rincoin_qt_check : qt/test/test_rincoin-qt$(EXEEXT) FORCE
$(MAKE) check-TESTS TESTS=$^

test_litecoin_qt_clean: FORCE
rm -f $(CLEAN_litecoin_QT_TEST) $(qt_test_test_litecoin_qt_OBJECTS)
test_rincoin_qt_clean: FORCE
rm -f $(CLEAN_rincoin_qt_TEST) $(qt_test_test_rincoin_qt_OBJECTS)
2 changes: 1 addition & 1 deletion src/amount.h
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ static const CAmount COIN = 100000000;
* critical; in unusual circumstances like a(nother) overflow bug that allowed
* for the creation of coins out of thin air modification could lead to a fork.
* */
static const CAmount MAX_MONEY = 84000000 * COIN;
static const CAmount MAX_MONEY = 168000000 * COIN;
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }

#endif // BITCOIN_AMOUNT_H
2 changes: 1 addition & 1 deletion src/bench/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bench_litecoin
bench_rincoin
2 changes: 1 addition & 1 deletion src/bench/checkblock.cpp
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
// a block off the wire, but before we can relay the block on to peers using
// compact block relay.

// Litecoin uses block height 878439, hash 0babe680f55a55d54339511226755f0837261da89a4e78eba4d6436a63026df8
// rincoin uses block height 878439, hash 0babe680f55a55d54339511226755f0837261da89a4e78eba4d6436a63026df8
// which contains 3808 transactions.

static void DeserializeBlockTest(benchmark::Bench& bench)
10 changes: 5 additions & 5 deletions src/bitcoin-cli-res.rc
Original file line number Diff line number Diff line change
@@ -16,14 +16,14 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Litecoin"
VALUE "FileDescription", "litecoin-cli (JSON-RPC client for " PACKAGE_NAME ")"
VALUE "CompanyName", "Rincoin"
VALUE "FileDescription", "rincoin-cli (JSON-RPC client for " PACKAGE_NAME ")"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "litecoin-cli"
VALUE "InternalName", "rincoin-cli"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "litecoin-cli.exe"
VALUE "ProductName", "litecoin-cli"
VALUE "OriginalFilename", "rincoin-cli.exe"
VALUE "ProductName", "rincoin-cli"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
18 changes: 9 additions & 9 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ static void SetupCliArgs(ArgsManager& argsman)
argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-generate", strprintf("Generate blocks immediately, equivalent to RPC generatenewaddress followed by RPC generatetoaddress. Optional positional integer arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to RPC generatetoaddress nblocks and maxtries arguments. Example: litecoin-cli -generate 4 1000", DEFAULT_NBLOCKS, DEFAULT_MAX_TRIES), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-generate", strprintf("Generate blocks immediately, equivalent to RPC generatenewaddress followed by RPC generatetoaddress. Optional positional integer arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to RPC generatetoaddress nblocks and maxtries arguments. Example: rincoin-cli -generate 4 1000", DEFAULT_NBLOCKS, DEFAULT_MAX_TRIES), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-netinfo", "Get network peer connection information from the remote server. An optional integer argument from 0 to 4 can be passed for different peers listings (default: 0).", ArgsManager::ALLOW_INT, OptionsCategory::OPTIONS);

@@ -70,7 +70,7 @@ static void SetupCliArgs(ArgsManager& argsman)
argsman.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u, testnet: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcwait", "Wait for RPC server to start", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to litecoind). This changes the RPC endpoint used, e.g. http://127.0.0.1:8332/wallet/<walletname>", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to rincoind). This changes the RPC endpoint used, e.g. http://127.0.0.1:8332/wallet/<walletname>", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password. When combined with -stdinwalletpassphrase, -stdinrpcpass consumes the first line, and -stdinwalletpassphrase consumes the second.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-stdinwalletpassphrase", "Read wallet passphrase from standard input as a single line. When combined with -stdin, the first line from standard input is used for the wallet passphrase.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
@@ -118,10 +118,10 @@ static int AppInitRPC(int argc, char* argv[])
std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n";
if (!gArgs.IsArgSet("-version")) {
strUsage += "\n"
"Usage: litecoin-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
"or: litecoin-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
"or: litecoin-cli [options] help List commands\n"
"or: litecoin-cli [options] help <command> Get help for a command\n";
"Usage: rincoin-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
"or: rincoin-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
"or: rincoin-cli [options] help List commands\n"
"or: rincoin-cli [options] help <command> Get help for a command\n";
strUsage += "\n" + gArgs.GetHelpMessage();
}

@@ -377,7 +377,7 @@ class NetinfoRequestHandler : public BaseRequestHandler

const UniValue& networkinfo{batch[ID_NETWORKINFO]["result"]};
if (networkinfo["version"].get_int() < 209900) {
throw std::runtime_error("-netinfo requires litecoind server to be running v0.21.0 and up");
throw std::runtime_error("-netinfo requires rincoind server to be running v0.21.0 and up");
}

// Count peer connection totals, and if DetailsRequested(), store peer data in a vector of structs.
@@ -609,7 +609,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
if (response.error != -1) {
responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
}
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the litecoind server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the rincoind server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
} else if (response.status == HTTP_UNAUTHORIZED) {
if (failedToGetAuthCookie) {
throw std::runtime_error(strprintf(
@@ -689,7 +689,7 @@ static void ParseError(const UniValue& error, std::string& strPrint, int& nRet)
strPrint += ("error message:\n" + err_msg.get_str());
}
if (err_code.isNum() && err_code.get_int() == RPC_WALLET_NOT_SPECIFIED) {
strPrint += "\nTry adding \"-rpcwallet=<filename>\" option to litecoin-cli command line.";
strPrint += "\nTry adding \"-rpcwallet=<filename>\" option to rincoin-cli command line.";
}
} else {
strPrint = "error: " + error.write();
10 changes: 5 additions & 5 deletions src/bitcoin-tx-res.rc
Original file line number Diff line number Diff line change
@@ -16,14 +16,14 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Litecoin"
VALUE "FileDescription", "litecoin-tx (CLI Litecoin transaction editor utility)"
VALUE "CompanyName", "Rincoin"
VALUE "FileDescription", "rincoin-tx (CLI Rincoin transaction editor utility)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "litecoin-tx"
VALUE "InternalName", "rincoin-tx"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "litecoin-tx.exe"
VALUE "ProductName", "litecoin-tx"
VALUE "OriginalFilename", "rincoin-tx.exe"
VALUE "ProductName", "rincoin-tx"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
6 changes: 3 additions & 3 deletions src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
@@ -97,9 +97,9 @@ static int AppInitRawTx(int argc, char* argv[])

if (argc < 2 || HelpRequested(gArgs)) {
// First part of help message is specific to this utility
std::string strUsage = PACKAGE_NAME " litecoin-tx utility version " + FormatFullVersion() + "\n\n" +
"Usage: litecoin-tx [options] <hex-tx> [commands] Update hex-encoded litecoin transaction\n" +
"or: litecoin-tx [options] -create [commands] Create hex-encoded litecoin transaction\n" +
std::string strUsage = PACKAGE_NAME " rincoin-tx utility version " + FormatFullVersion() + "\n\n" +
"Usage: rincoin-tx [options] <hex-tx> [commands] Update hex-encoded rincoin transaction\n" +
"or: rincoin-tx [options] -create [commands] Create hex-encoded rincoin transaction\n" +
"\n";
strUsage += gArgs.GetHelpMessage();

10 changes: 5 additions & 5 deletions src/bitcoin-wallet-res.rc
Original file line number Diff line number Diff line change
@@ -16,14 +16,14 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Litecoin"
VALUE "FileDescription", "litecoin-wallet (CLI tool for " PACKAGE_NAME " wallets)"
VALUE "CompanyName", "Rincoin"
VALUE "FileDescription", "rincoin-wallet (CLI tool for " PACKAGE_NAME " wallets)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "litecoin-wallet"
VALUE "InternalName", "rincoin-wallet"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "litecoin-wallet.exe"
VALUE "ProductName", "litecoin-wallet"
VALUE "OriginalFilename", "rincoin-wallet.exe"
VALUE "ProductName", "rincoin-wallet"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
10 changes: 5 additions & 5 deletions src/bitcoin-wallet.cpp
Original file line number Diff line number Diff line change
@@ -43,12 +43,12 @@ static bool WalletAppInit(int argc, char* argv[])
return false;
}
if (argc < 2 || HelpRequested(gArgs)) {
std::string usage = strprintf("%s litecoin-wallet version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n\n" +
"litecoin-wallet is an offline tool for creating and interacting with " PACKAGE_NAME " wallet files.\n" +
"By default litecoin-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n" +
std::string usage = strprintf("%s rincoin-wallet version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n\n" +
"rincoin-wallet is an offline tool for creating and interacting with " PACKAGE_NAME " wallet files.\n" +
"By default rincoin-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n" +
"To change the target wallet, use the -datadir, -wallet and -testnet/-regtest arguments.\n\n" +
"Usage:\n" +
" litecoin-wallet [options] <command>\n\n" +
" rincoin-wallet [options] <command>\n\n" +
gArgs.GetHelpMessage();

tfm::format(std::cout, "%s", usage);
@@ -98,7 +98,7 @@ int main(int argc, char* argv[])
}

if (method.empty()) {
tfm::format(std::cerr, "No method provided. Run `litecoin-wallet -help` for valid methods.\n");
tfm::format(std::cerr, "No method provided. Run `rincoin-wallet -help` for valid methods.\n");
return EXIT_FAILURE;
}

10 changes: 5 additions & 5 deletions src/bitcoind-res.rc
Original file line number Diff line number Diff line change
@@ -16,14 +16,14 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Litecoin"
VALUE "FileDescription", "litecoind (Litecoin node with a JSON-RPC server)"
VALUE "CompanyName", "Rincoin"
VALUE "FileDescription", "Rincoind (Rincoin node with a JSON-RPC server)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "litecoind"
VALUE "InternalName", "rincoind"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "litecoind.exe"
VALUE "ProductName", "litecoind"
VALUE "OriginalFilename", "rincoind.exe"
VALUE "ProductName", "rincoind"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
4 changes: 2 additions & 2 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ static bool AppInit(int argc, char* argv[])
if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo()) + "\n";
} else {
strUsage += "\nUsage: litecoind [options] Start " PACKAGE_NAME "\n";
strUsage += "\nUsage: rincoind [options] Start " PACKAGE_NAME "\n";
strUsage += "\n" + args.GetHelpMessage();
}

@@ -87,7 +87,7 @@ static bool AppInit(int argc, char* argv[])
// Error out when loose non-argument tokens are encountered on command line
for (int i = 1; i < argc; i++) {
if (!IsSwitchChar(argv[i][0])) {
return InitError(Untranslated(strprintf("Command line contains unexpected token '%s', see litecoind -h for a list of options.\n", argv[i])));
return InitError(Untranslated(strprintf("Command line contains unexpected token '%s', see rincoind -h for a list of options.\n", argv[i])));
}
}

196 changes: 92 additions & 104 deletions src/chainparams.cpp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
@@ -44,13 +44,13 @@ const CBaseChainParams& BaseParams()
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain)
{
if (chain == CBaseChainParams::MAIN) {
return MakeUnique<CBaseChainParams>("", 9332, 9333);
return MakeUnique<CBaseChainParams>("", 9556, 9555);
} else if (chain == CBaseChainParams::TESTNET) {
return MakeUnique<CBaseChainParams>("testnet4", 19332, 19335);
return MakeUnique<CBaseChainParams>("testnet4", 19556, 19555);
} else if (chain == CBaseChainParams::SIGNET) {
return MakeUnique<CBaseChainParams>("signet", 39332, 39335);
return MakeUnique<CBaseChainParams>("signet", 39556, 39555);
} else if (chain == CBaseChainParams::REGTEST) {
return MakeUnique<CBaseChainParams>("regtest", 19443, 19444);
return MakeUnique<CBaseChainParams>("regtest", 29556, 29555);
}
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
}
83 changes: 2 additions & 81 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
@@ -7,89 +7,10 @@
* Each line contains a BIP155 serialized (networkID, addr, port) tuple.
*/
static const uint8_t chainparams_seed_main[] = {
0x01,0x04,0x03,0x44,0x22,0xc4,0x24,0x75,
0x01,0x04,0x05,0x64,0xfa,0x8c,0x24,0x75,
0x01,0x04,0x05,0x85,0x41,0x52,0x24,0x75,
0x01,0x04,0x05,0x95,0xfa,0x4c,0x24,0x75,
0x01,0x04,0x05,0xc7,0xa8,0x65,0x24,0x75,
0x01,0x04,0x0f,0xcc,0xb7,0x03,0x24,0x75,
0x01,0x04,0x12,0xc1,0xda,0x08,0x24,0x75,
0x01,0x04,0x22,0xce,0xc7,0x9a,0x24,0x75,
0x01,0x04,0x25,0xbb,0x1d,0x8c,0x24,0x75,
0x01,0x04,0x2d,0x4d,0xa2,0xce,0x24,0x75,
0x01,0x04,0x2d,0x87,0x5c,0x29,0x24,0x75,
0x01,0x04,0x2e,0x13,0x43,0x42,0x24,0x75,
0x01,0x04,0x2e,0x04,0x23,0xc6,0x24,0x75,
0x01,0x04,0x33,0xd2,0xd9,0x90,0x24,0x75,
0x01,0x04,0x36,0x25,0x50,0x07,0x24,0x75,
0x01,0x04,0x36,0x25,0x50,0xd6,0x24,0x75,
0x01,0x04,0x36,0xd3,0xaf,0x27,0x24,0x75,
0x01,0x04,0x40,0xe3,0x69,0xdb,0x24,0x75,
0x01,0x04,0x43,0x15,0x5d,0x4a,0x24,0x75,
0x01,0x04,0x45,0xa5,0xcd,0x8e,0x26,0xcd,
0x01,0x04,0x46,0xb5,0x0d,0x8f,0x24,0x75,
0x01,0x04,0x48,0x44,0xd3,0xd7,0x24,0x75,
0x01,0x04,0x4b,0x77,0x87,0x9b,0x24,0x75,
0x01,0x04,0x4d,0xdd,0xd3,0x89,0x24,0x75,
0x01,0x04,0x4d,0xf7,0xb2,0x9e,0x24,0x75,
0x01,0x04,0x50,0x6f,0x8e,0xd5,0x24,0x75,
0x01,0x04,0x51,0x4e,0xc0,0x62,0x24,0x75,
0x01,0x04,0x54,0xc9,0xad,0x17,0x24,0x75,
0x01,0x04,0x55,0x0f,0xb3,0xab,0x24,0x75,
0x01,0x04,0x55,0xd6,0x3d,0xd1,0x24,0x75,
0x01,0x04,0x56,0x47,0x2f,0x0b,0x24,0x75,
0x01,0x04,0x59,0x13,0x1a,0xd3,0x24,0x75,
0x01,0x04,0x5a,0x7f,0x6d,0x68,0x24,0x75,
0x01,0x04,0x5b,0xc1,0xb5,0x03,0x24,0x75,
0x01,0x04,0x5b,0xe4,0x93,0x99,0x24,0x75,
0x01,0x04,0x5d,0xb7,0x48,0xc3,0x24,0x75,
0x01,0x04,0x5e,0x82,0x31,0xa4,0x24,0x75,
0x01,0x04,0x5f,0x2b,0x61,0x54,0x24,0x75,
0x01,0x04,0x5f,0xd3,0xd2,0x26,0x24,0x75,
0x01,0x04,0x61,0x73,0xf8,0x6e,0x24,0x75,
0x01,0x04,0x88,0xf4,0x41,0xd4,0x24,0x75,
0x01,0x04,0x8e,0x84,0xda,0xfb,0x24,0x75,
0x01,0x04,0x90,0x5b,0x68,0xb8,0x24,0x75,
0x01,0x04,0x92,0x3b,0x45,0xf5,0x24,0x75,
0x01,0x04,0x95,0x07,0x10,0x89,0x24,0x75,
0x01,0x04,0x9d,0xa1,0x80,0x39,0x24,0x75,
0x01,0x04,0xa5,0xe3,0x94,0x6c,0x24,0x75,
0x01,0x04,0xad,0xd0,0xac,0xa5,0x24,0x75,
0x01,0x04,0xad,0xd4,0xf2,0x05,0x24,0x75,
0x01,0x04,0xae,0x3c,0xba,0xfe,0x24,0x75,
0x01,0x04,0xb2,0x0a,0xec,0xcd,0x24,0x75,
0x01,0x04,0xb2,0x29,0x0b,0xfe,0x24,0x75,
0x01,0x04,0xb2,0xc4,0x15,0xf1,0x24,0x75,
0x01,0x04,0xb9,0x1a,0x1e,0x86,0x1c,0x23,
0x01,0x04,0xbc,0x8f,0x8c,0x9a,0x24,0x75,
0x01,0x04,0xbe,0x02,0x82,0x1b,0x24,0x75,
0x01,0x04,0xc3,0x9a,0xbb,0x06,0x24,0x75,
0x01,0x04,0xce,0xbd,0xc3,0x01,0x24,0x75,
0x01,0x04,0xcf,0xf6,0x60,0x51,0x24,0x75,
0x01,0x04,0xcf,0xff,0xc1,0x2f,0x24,0x75,
0x01,0x04,0xd4,0x07,0xca,0x78,0x24,0x75,
0x01,0x04,0xd4,0x5c,0x65,0xbd,0x24,0x75,
0x01,0x04,0xd5,0x81,0x7c,0x32,0x24,0x75,
0x01,0x04,0xd9,0xb6,0xc8,0xb1,0x24,0x75,
0x01,0x04,0xdd,0xd8,0x8d,0xc1,0x09,0x11,
0x02,0x10,0x20,0x01,0x40,0x60,0x44,0x19,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x57,0x24,0x75,
0x02,0x10,0x20,0x01,0x06,0x7c,0x02,0xb0,0xdb,0x32,0x00,0x00,0x00,0x01,0x05,0x64,0xfa,0x8c,0x24,0x75,
0x02,0x10,0x20,0x01,0x06,0x7c,0x02,0xb0,0xdb,0x32,0x00,0x00,0x00,0x01,0xa5,0xe3,0x54,0xc8,0x24,0x75,
0x02,0x10,0x20,0x01,0x0b,0x07,0x5d,0x2b,0xd1,0x87,0x35,0x83,0xa8,0x07,0xa4,0x4b,0xa5,0xce,0x24,0x75,
0x02,0x10,0x24,0x0b,0x00,0x11,0xd1,0x40,0xcf,0xe1,0x09,0x74,0x74,0x5e,0xfc,0x8b,0x36,0x2a,0x24,0x75,
0x02,0x10,0x24,0x0d,0x00,0x1b,0x00,0x64,0x62,0x02,0x1f,0x7a,0xa4,0x02,0x09,0x16,0xdc,0x86,0x24,0x75,
0x02,0x10,0x26,0x00,0x17,0x00,0x53,0x9e,0xb0,0x0f,0x50,0x54,0x00,0xff,0xfe,0x1b,0x29,0x13,0x24,0x75,
0x02,0x10,0x2a,0x01,0x04,0xf8,0x01,0x61,0x10,0xb2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x24,0x75,
0x02,0x10,0x2a,0x01,0x04,0xf9,0x00,0x1a,0xb2,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x24,0x75,
0x02,0x10,0x2a,0x01,0x05,0xf0,0xbe,0xef,0x00,0x05,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0xcb,0x8d,
0x02,0x10,0x2a,0x02,0x84,0x2a,0x01,0xdf,0x8a,0x01,0x1e,0x1b,0x0d,0xff,0xfe,0x0b,0x23,0x6d,0x24,0x75,
0x02,0x10,0x2a,0x03,0x6f,0x00,0x00,0x05,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xf1,0x24,0x75,
0x02,0x10,0x2a,0x07,0x0e,0x00,0x00,0x00,0x00,0x00,0x34,0x8a,0x1a,0xff,0xfe,0x80,0xae,0xae,0x24,0x75,
0x04,0x20,0x5b,0xa4,0x70,0x36,0x28,0xd8,0xbf,0x95,0xa9,0x5a,0x8e,0x88,0xe0,0xd0,0xf6,0x8c,0xaa,0xa5,0xde,0xa9,0x3c,0x71,0xd5,0xec,0x3f,0x22,0xcf,0x41,0x66,0xcc,0xd6,0x69,0x24,0x75,
0x04,0x20,0xc4,0x1b,0x96,0x6d,0x19,0x12,0xc6,0xe8,0xab,0xbc,0x7f,0xb6,0xad,0x86,0x24,0xcb,0x8f,0xd8,0xb5,0x17,0x25,0x8d,0x04,0x3a,0xd8,0xaf,0x6b,0x57,0x1b,0x52,0x63,0x77,0x24,0x75,
0x04,0x20,0x62,0x6f,0xda,0xe5,0x64,0x98,0xb3,0x27,0x5b,0xd8,0xae,0x0c,0x4e,0x14,0x8c,0x6d,0x15,0x17,0x0f,0x92,0x66,0xfd,0x2d,0x62,0xd8,0x4e,0xdb,0x6c,0x01,0x86,0x49,0x1d,0x24,0x75,
0x01, 0x04, 0x71, 0x96, 0xe9, 0x4b, 0x25, 0x53
};


static const uint8_t chainparams_seed_test[] = {
0x01,0x04,0xd9,0x48,0x04,0x9d,0x4b,0x87,
0x01,0x04,0x41,0x6c,0xc9,0x71,0x4b,0x87,
2 changes: 1 addition & 1 deletion src/clientversion.cpp
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
* for both bitcoind and bitcoin-qt, to make it harder for attackers to
* target servers or GUI users specifically.
*/
const std::string CLIENT_NAME("LitecoinCore");
const std::string CLIENT_NAME("RincoinCore");


#ifdef HAVE_BUILD_INFO
2 changes: 1 addition & 1 deletion src/compat/assumptions.h
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
// Example(s): We use assert(...) extensively with the assumption of it never
// being a noop at runtime.
#if defined(NDEBUG)
# error "Litecoin cannot be compiled without assertions."
# error "rincoin cannot be compiled without assertions."
#endif

// Assumption: We assume a C++11 (ISO/IEC 14882:2011) compiler (minimum requirement).
1 change: 1 addition & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
@@ -100,6 +100,7 @@ struct Params {
*/
bool signet_blocks{false};
std::vector<uint8_t> signet_challenge;
int DGWHeight;
};
} // namespace Consensus

158 changes: 158 additions & 0 deletions src/crypto/argon2/Argon2.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptTestCI", "vs2015\Argon2OptTestCI\Argon2OptTestCI.vcxproj", "{12956597-5E42-433A-93F3-D4EFF50AA207}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefTestCI", "vs2015\Argon2RefTestCI\Argon2RefTestCI.vcxproj", "{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptGenKAT", "vs2015\Argon2OptGenKAT\Argon2OptGenKAT.vcxproj", "{DBBAAAE6-4560-4D11-8280-30A6650A82EF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefGenKAT", "vs2015\Argon2RefGenKAT\Argon2RefGenKAT.vcxproj", "{71921B4C-A795-4A37-95A3-99D600E01211}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2Opt", "vs2015\Argon2Opt\Argon2Opt.vcxproj", "{CAA75C57-998C-494E-B8A5-5894EF0FC528}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2Ref", "vs2015\Argon2Ref\Argon2Ref.vcxproj", "{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptBench", "vs2015\Argon2OptBench\Argon2OptBench.vcxproj", "{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefBench", "vs2015\Argon2RefBench\Argon2RefBench.vcxproj", "{99203F6A-6E8C-42FC-8C7C-C07E8913D539}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2OptDll", "vs2015\Argon2OptDll\Argon2OptDll.vcxproj", "{3A898DD8-ACAE-4269-ADFE-EB7260D71583}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Argon2RefDll", "vs2015\Argon2RefDll\Argon2RefDll.vcxproj", "{19D911A1-533C-4475-B313-F372481A35D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseStatic|x64 = ReleaseStatic|x64
ReleaseStatic|x86 = ReleaseStatic|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x64.ActiveCfg = Debug|x64
{12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x64.Build.0 = Debug|x64
{12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x86.ActiveCfg = Debug|Win32
{12956597-5E42-433A-93F3-D4EFF50AA207}.Debug|x86.Build.0 = Debug|Win32
{12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x64.ActiveCfg = Release|x64
{12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x64.Build.0 = Release|x64
{12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x86.ActiveCfg = Release|Win32
{12956597-5E42-433A-93F3-D4EFF50AA207}.Release|x86.Build.0 = Release|Win32
{12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{12956597-5E42-433A-93F3-D4EFF50AA207}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x64.ActiveCfg = Debug|x64
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x64.Build.0 = Debug|x64
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x86.ActiveCfg = Debug|Win32
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Debug|x86.Build.0 = Debug|Win32
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x64.ActiveCfg = Release|x64
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x64.Build.0 = Release|x64
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x86.ActiveCfg = Release|Win32
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.Release|x86.Build.0 = Release|Win32
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x64.ActiveCfg = Debug|x64
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x64.Build.0 = Debug|x64
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x86.ActiveCfg = Debug|Win32
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Debug|x86.Build.0 = Debug|Win32
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x64.ActiveCfg = Release|x64
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x64.Build.0 = Release|x64
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x86.ActiveCfg = Release|Win32
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.Release|x86.Build.0 = Release|Win32
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{DBBAAAE6-4560-4D11-8280-30A6650A82EF}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x64.ActiveCfg = Debug|x64
{71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x64.Build.0 = Debug|x64
{71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x86.ActiveCfg = Debug|Win32
{71921B4C-A795-4A37-95A3-99D600E01211}.Debug|x86.Build.0 = Debug|Win32
{71921B4C-A795-4A37-95A3-99D600E01211}.Release|x64.ActiveCfg = Release|x64
{71921B4C-A795-4A37-95A3-99D600E01211}.Release|x64.Build.0 = Release|x64
{71921B4C-A795-4A37-95A3-99D600E01211}.Release|x86.ActiveCfg = Release|Win32
{71921B4C-A795-4A37-95A3-99D600E01211}.Release|x86.Build.0 = Release|Win32
{71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{71921B4C-A795-4A37-95A3-99D600E01211}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x64.ActiveCfg = Debug|x64
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x64.Build.0 = Debug|x64
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x86.ActiveCfg = Debug|Win32
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Debug|x86.Build.0 = Debug|Win32
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x64.ActiveCfg = Release|x64
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x64.Build.0 = Release|x64
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x86.ActiveCfg = Release|Win32
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.Release|x86.Build.0 = Release|Win32
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{CAA75C57-998C-494E-B8A5-5894EF0FC528}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x64.ActiveCfg = Debug|x64
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x64.Build.0 = Debug|x64
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x86.ActiveCfg = Debug|Win32
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Debug|x86.Build.0 = Debug|Win32
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x64.ActiveCfg = Release|x64
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x64.Build.0 = Release|x64
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x86.ActiveCfg = Release|Win32
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.Release|x86.Build.0 = Release|Win32
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{B9CAC9CE-9F0D-4F52-8D67-FDBBAFCD0DE2}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x64.ActiveCfg = Debug|x64
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x64.Build.0 = Debug|x64
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x86.ActiveCfg = Debug|Win32
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Debug|x86.Build.0 = Debug|Win32
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x64.ActiveCfg = Release|x64
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x64.Build.0 = Release|x64
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x86.ActiveCfg = Release|Win32
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.Release|x86.Build.0 = Release|Win32
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{B3A0FB44-0C1C-4EC3-B155-8B39371F8EE4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x64.ActiveCfg = Debug|x64
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x64.Build.0 = Debug|x64
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x86.ActiveCfg = Debug|Win32
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Debug|x86.Build.0 = Debug|Win32
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x64.ActiveCfg = Release|x64
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x64.Build.0 = Release|x64
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x86.ActiveCfg = Release|Win32
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.Release|x86.Build.0 = Release|Win32
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{99203F6A-6E8C-42FC-8C7C-C07E8913D539}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x64.ActiveCfg = Debug|x64
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x64.Build.0 = Debug|x64
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x86.ActiveCfg = Debug|Win32
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Debug|x86.Build.0 = Debug|Win32
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x64.ActiveCfg = Release|x64
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x64.Build.0 = Release|x64
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x86.ActiveCfg = Release|Win32
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.Release|x86.Build.0 = Release|Win32
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{3A898DD8-ACAE-4269-ADFE-EB7260D71583}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
{19D911A1-533C-4475-B313-F372481A35D4}.Debug|x64.ActiveCfg = Debug|x64
{19D911A1-533C-4475-B313-F372481A35D4}.Debug|x64.Build.0 = Debug|x64
{19D911A1-533C-4475-B313-F372481A35D4}.Debug|x86.ActiveCfg = Debug|Win32
{19D911A1-533C-4475-B313-F372481A35D4}.Debug|x86.Build.0 = Debug|Win32
{19D911A1-533C-4475-B313-F372481A35D4}.Release|x64.ActiveCfg = Release|x64
{19D911A1-533C-4475-B313-F372481A35D4}.Release|x64.Build.0 = Release|x64
{19D911A1-533C-4475-B313-F372481A35D4}.Release|x86.ActiveCfg = Release|Win32
{19D911A1-533C-4475-B313-F372481A35D4}.Release|x86.Build.0 = Release|Win32
{19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64
{19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64
{19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32
{19D911A1-533C-4475-B313-F372481A35D4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
32 changes: 32 additions & 0 deletions src/crypto/argon2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 20171227
* Added ABI version number
* AVX2/AVX-512F optimizations of BLAMKA
* Set Argon2 version number from the command line
* New bindings
* Minor bug and warning fixes (no security issue)

# 20161029

* Argon2id added
* Better documentation
* Dual licensing CC0 / Apache 2.0
* Minor bug fixes (no security issue)

# 20160406

* Version 1.3 of Argon2
* Version number in encoded hash
* Refactored low-level API
* Visibility control for library symbols
* Microsoft Visual Studio solution
* New bindings
* Minor bug and warning fixes (no security issue)


# 20151206

* Python bindings
* Password read from stdin, instead of being an argument
* Compatibility FreeBSD, NetBSD, OpenBSD
* Constant-time verification
* Minor bug and warning fixes (no security issue)
314 changes: 314 additions & 0 deletions src/crypto/argon2/LICENSE

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/crypto/argon2/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
noinst_LIBRARIES = libargon2.a

libargon2_a_SOURCES = \
core.c \
blake2/blake2b.c \
encoding.c \
argon2.c \
ref.c \
thread.c

AM_CFLAGS = -O2 -fPIC
AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/blake2
46 changes: 46 additions & 0 deletions src/crypto/argon2/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "argon2",
products: [
.library(
name: "argon2",
targets: ["argon2"]),
],
targets: [
.target(
name: "argon2",
path: ".",
exclude: [
"kats",
"vs2015",
"latex",
"libargon2.pc.in",
"export.sh",
"appveyor.yml",
"Argon2.sln",
"argon2-specs.pdf",
"CHANGELOG.md",
"LICENSE",
"Makefile",
"man",
"README.md",
"src/bench.c",
"src/genkat.c",
"src/opt.c",
"src/run.c",
"src/test.c",
],
sources: [
"src/blake2/blake2b.c",
"src/argon2.c",
"src/core.c",
"src/encoding.c",
"src/ref.c",
"src/thread.c"
]
)
]
)
303 changes: 303 additions & 0 deletions src/crypto/argon2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
# Argon2

[![Build Status](https://travis-ci.org/P-H-C/phc-winner-argon2.svg?branch=master)](https://travis-ci.org/P-H-C/phc-winner-argon2)
[![Build status](https://ci.appveyor.com/api/projects/status/8nfwuwq55sgfkele?svg=true)](https://ci.appveyor.com/project/P-H-C/phc-winner-argon2)
[![codecov.io](https://codecov.io/github/P-H-C/phc-winner-argon2/coverage.svg?branch=master)](https://codecov.io/github/P-H-C/phc-winner-argon2?branch=master)

This is the reference C implementation of Argon2, the password-hashing
function that won the [Password Hashing Competition
(PHC)](https://password-hashing.net).

Argon2 is a password-hashing function that summarizes the state of the
art in the design of memory-hard functions and can be used to hash
passwords for credential storage, key derivation, or other applications.

It has a simple design aimed at the highest memory filling rate and
effective use of multiple computing units, while still providing defense
against tradeoff attacks (by exploiting the cache and memory organization
of the recent processors).

Argon2 has three variants: Argon2i, Argon2d, and Argon2id. Argon2d is faster
and uses data-depending memory access, which makes it highly resistant
against GPU cracking attacks and suitable for applications with no threats
from side-channel timing attacks (eg. cryptocurrencies). Argon2i instead
uses data-independent memory access, which is preferred for password
hashing and password-based key derivation, but it is slower as it makes
more passes over the memory to protect from tradeoff attacks. Argon2id is a
hybrid of Argon2i and Argon2d, using a combination of data-depending and
data-independent memory accesses, which gives some of Argon2i's resistance to
side-channel cache timing attacks and much of Argon2d's resistance to GPU
cracking attacks.

Argon2i, Argon2d, and Argon2id are parametrized by:

* A **time** cost, which defines the amount of computation realized and
therefore the execution time, given in number of iterations
* A **memory** cost, which defines the memory usage, given in kibibytes
* A **parallelism** degree, which defines the number of parallel threads

The [Argon2 document](argon2-specs.pdf) gives detailed specs and design
rationale.

Please report bugs as issues on this repository.

## Usage

`make` builds the executable `argon2`, the static library `libargon2.a`,
and the shared library `libargon2.so` (or on macOS, the dynamic library
`libargon2.dylib` -- make sure to specify the installation prefix when
you compile: `make PREFIX=/usr`). Make sure to run `make test` to verify
that your build produces valid results. `sudo make install PREFIX=/usr`
installs it to your system.

### Command-line utility

`argon2` is a command-line utility to test specific Argon2 instances
on your system. To show usage instructions, run
`./argon2 -h` as
```
Usage: ./argon2 [-h] salt [-i|-d|-id] [-t iterations] [-m memory] [-p parallelism] [-l hash length] [-e|-r] [-v (10|13)]
Password is read from stdin
Parameters:
salt The salt to use, at least 8 characters
-i Use Argon2i (this is the default)
-d Use Argon2d instead of Argon2i
-id Use Argon2id instead of Argon2i
-t N Sets the number of iterations to N (default = 3)
-m N Sets the memory usage of 2^N KiB (default 12)
-p N Sets parallelism to N threads (default 1)
-l N Sets hash output length to N bytes (default 32)
-e Output only encoded hash
-r Output only the raw bytes of the hash
-v (10|13) Argon2 version (defaults to the most recent version, currently 13)
-h Print argon2 usage
```
For example, to hash "password" using "somesalt" as a salt and doing 2
iterations, consuming 64 MiB, using four parallel threads and an output hash
of 24 bytes
```
$ echo -n "password" | ./argon2 somesalt -t 2 -m 16 -p 4 -l 24
Type: Argon2i
Iterations: 2
Memory: 65536 KiB
Parallelism: 4
Hash: 45d7ac72e76f242b20b77b9bf9bf9d5915894e669a24e6c6
Encoded: $argon2i$v=19$m=65536,t=2,p=4$c29tZXNhbHQ$RdescudvJCsgt3ub+b+dWRWJTmaaJObG
0.188 seconds
Verification ok
```

### Library

`libargon2` provides an API to both low-level and high-level functions
for using Argon2.

The example program below hashes the string "password" with Argon2i
using the high-level API and then using the low-level API. While the
high-level API takes the three cost parameters (time, memory, and
parallelism), the password input buffer, the salt input buffer, and the
output buffers, the low-level API takes in these and additional parameters
, as defined in [`include/argon2.h`](include/argon2.h).

There are many additional parameters, but we will highlight three of them here.

1. The `secret` parameter, which is used for [keyed hashing](
https://en.wikipedia.org/wiki/Hash-based_message_authentication_code).
This allows a secret key to be input at hashing time (from some external
location) and be folded into the value of the hash. This means that even if
your salts and hashes are compromised, an attacker cannot brute-force to find
the password without the key.

2. The `ad` parameter, which is used to fold any additional data into the hash
value. Functionally, this behaves almost exactly like the `secret` or `salt`
parameters; the `ad` parameter is folding into the value of the hash.
However, this parameter is used for different data. The `salt` should be a
random string stored alongside your password. The `secret` should be a random
key only usable at hashing time. The `ad` is for any other data.

3. The `flags` parameter, which determines which memory should be securely
erased. This is useful if you want to securely delete the `pwd` or `secret`
fields right after they are used. To do this set `flags` to either
`ARGON2_FLAG_CLEAR_PASSWORD` or `ARGON2_FLAG_CLEAR_SECRET`. To change how
internal memory is cleared, change the global flag
`FLAG_clear_internal_memory` (defaults to clearing internal memory).

Here the time cost `t_cost` is set to 2 iterations, the
memory cost `m_cost` is set to 2<sup>16</sup> kibibytes (64 mebibytes),
and parallelism is set to 1 (single-thread).

Compile for example as `gcc test.c libargon2.a -Isrc -o test`, if the program
below is named `test.c` and placed in the project's root directory.

```c
#include "argon2.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define HASHLEN 32
#define SALTLEN 16
#define PWD "password"

int main(void)
{
uint8_t hash1[HASHLEN];
uint8_t hash2[HASHLEN];

uint8_t salt[SALTLEN];
memset( salt, 0x00, SALTLEN );

uint8_t *pwd = (uint8_t *)strdup(PWD);
uint32_t pwdlen = strlen((char *)pwd);

uint32_t t_cost = 2; // 2-pass computation
uint32_t m_cost = (1<<16); // 64 mebibytes memory usage
uint32_t parallelism = 1; // number of threads and lanes

// high-level API
argon2i_hash_raw(t_cost, m_cost, parallelism, pwd, pwdlen, salt, SALTLEN, hash1, HASHLEN);

// low-level API
argon2_context context = {
hash2, /* output array, at least HASHLEN in size */
HASHLEN, /* digest length */
pwd, /* password array */
pwdlen, /* password length */
salt, /* salt array */
SALTLEN, /* salt length */
NULL, 0, /* optional secret data */
NULL, 0, /* optional associated data */
t_cost, m_cost, parallelism, parallelism,
ARGON2_VERSION_13, /* algorithm version */
NULL, NULL, /* custom memory allocation / deallocation functions */
/* by default only internal memory is cleared (pwd is not wiped) */
ARGON2_DEFAULT_FLAGS
};

int rc = argon2i_ctx( &context );
if(ARGON2_OK != rc) {
printf("Error: %s\n", argon2_error_message(rc));
exit(1);
}
free(pwd);

for( int i=0; i<HASHLEN; ++i ) printf( "%02x", hash1[i] ); printf( "\n" );
if (memcmp(hash1, hash2, HASHLEN)) {
for( int i=0; i<HASHLEN; ++i ) {
printf( "%02x", hash2[i] );
}
printf("\nfail\n");
}
else printf("ok\n");
return 0;
}
```
To use Argon2d instead of Argon2i call `argon2d_hash_raw` instead of
`argon2i_hash_raw` using the high-level API, and `argon2d` instead of
`argon2i` using the low-level API. Similarly for Argon2id, call `argon2id_hash_raw`
and `argon2id`.
To produce the crypt-like encoding rather than the raw hash, call
`argon2i_hash_encoded` for Argon2i, `argon2d_hash_encoded` for Argon2d, and
`argon2id_hash_encoded` for Argon2id
See [`include/argon2.h`](include/argon2.h) for API details.
*Note: in this example the salt is set to the all-`0x00` string for the
sake of simplicity, but in your application you should use a random salt.*
### Benchmarks
`make bench` creates the executable `bench`, which measures the execution
time of various Argon2 instances:
```
$ ./bench
Argon2d 1 iterations 1 MiB 1 threads: 5.91 cpb 5.91 Mcycles
Argon2i 1 iterations 1 MiB 1 threads: 4.64 cpb 4.64 Mcycles
0.0041 seconds

Argon2d 1 iterations 1 MiB 2 threads: 2.76 cpb 2.76 Mcycles
Argon2i 1 iterations 1 MiB 2 threads: 2.87 cpb 2.87 Mcycles
0.0038 seconds

Argon2d 1 iterations 1 MiB 4 threads: 3.25 cpb 3.25 Mcycles
Argon2i 1 iterations 1 MiB 4 threads: 3.57 cpb 3.57 Mcycles
0.0048 seconds

(...)

Argon2d 1 iterations 4096 MiB 2 threads: 2.15 cpb 8788.08 Mcycles
Argon2i 1 iterations 4096 MiB 2 threads: 2.15 cpb 8821.59 Mcycles
13.0112 seconds

Argon2d 1 iterations 4096 MiB 4 threads: 1.79 cpb 7343.72 Mcycles
Argon2i 1 iterations 4096 MiB 4 threads: 2.72 cpb 11124.86 Mcycles
19.3974 seconds

(...)
```
## Bindings
Bindings are available for the following languages (make sure to read
their documentation):
* [Android (Java/Kotlin)](https://github.com/lambdapioneer/argon2kt) by [@lambdapioneer](https://github.com/lambdapioneer)
* [Dart](https://github.com/tmthecoder/dargon2) by [@tmthecoder](https://github.com/tmthecoder)
* [Elixir](https://github.com/riverrun/argon2_elixir) by [@riverrun](https://github.com/riverrun)
* [Erlang](https://github.com/ergenius/eargon2) by [@ergenius](https://github.com/ergenius)
* [Go](https://github.com/tvdburgt/go-argon2) by [@tvdburgt](https://github.com/tvdburgt)
* [Haskell](https://hackage.haskell.org/package/argon2) by [@hvr](https://github.com/hvr)
* [JavaScript (native)](https://github.com/ranisalt/node-argon2), by [@ranisalt](https://github.com/ranisalt)
* [JavaScript (native)](https://github.com/jdconley/argon2themax), by [@jdconley](https://github.com/jdconley)
* [JavaScript (ffi)](https://github.com/cjlarose/argon2-ffi), by [@cjlarose](https://github.com/cjlarose)
* [JavaScript (browser)](https://github.com/antelle/argon2-browser), by [@antelle](https://github.com/antelle)
* [JVM](https://github.com/phxql/argon2-jvm) by [@phXql](https://github.com/phxql)
* [JVM (with keyed hashing)](https://github.com/kosprov/jargon2-api) by [@kosprov](https://github.com/kosprov)
* [Lua (native)](https://github.com/thibaultCha/lua-argon2) by [@thibaultCha](https://github.com/thibaultCha)
* [Lua (ffi)](https://github.com/thibaultCha/lua-argon2-ffi) by [@thibaultCha](https://github.com/thibaultCha)
* [OCaml](https://github.com/Khady/ocaml-argon2) by [@Khady](https://github.com/Khady)
* [Python (native)](https://pypi.python.org/pypi/argon2), by [@flamewow](https://github.com/flamewow)
* [Python (ffi)](https://pypi.python.org/pypi/argon2_cffi), by [@hynek](https://github.com/hynek)
* [Python (ffi, with keyed hashing)](https://github.com/thusoy/porridge), by [@thusoy](https://github.com/thusoy)
* [Python (ffi, with keyed hashing)](https://github.com/ultrahorizon/pyargon2), by [@ultrahorizon](https://github.com/ultrahorizon)
* [R](https://cran.r-project.org/package=argon2) by [@wrathematics](https://github.com/wrathematics)
* [Ruby](https://github.com/technion/ruby-argon2) by [@technion](https://github.com/technion)
* [Rust](https://github.com/quininer/argon2-rs) by [@quininer](https://github.com/quininer)
* [Rust](https://docs.rs/argonautica/) by [@bcmyers](https://github.com/bcmyers/)
* [C#/.NET CoreCLR](https://github.com/kmaragon/Konscious.Security.Cryptography) by [@kmaragon](https://github.com/kmaragon)
* [Perl](https://github.com/Leont/crypt-argon2) by [@leont](https://github.com/Leont)
* [mruby](https://github.com/Asmod4n/mruby-argon2) by [@Asmod4n](https://github.com/Asmod4n)
* [Swift](https://github.com/ImKcat/CatCrypto) by [@ImKcat](https://github.com/ImKcat)
* [Swift](https://github.com/tmthecoder/Argon2Swift) by [@tmthecoder](https://github.com/tmthecoder)
## Test suite
There are two sets of test suites. One is a low level test for the hash
function, the other tests the higher level API. Both of these are built and
executed by running:
`make test`
## Intellectual property
Except for the components listed below, the Argon2 code in this
repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main
authors), Jean-Philippe Aumasson and Samuel Neves, and dual licensed under the
[CC0 License](https://creativecommons.org/about/cc0) and the
[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For more info
see the LICENSE file.
The string encoding routines in [`src/encoding.c`](src/encoding.c) are
copyright (c) 2015 Thomas Pornin, and under
[CC0 License](https://creativecommons.org/about/cc0).
The BLAKE2 code in [`src/blake2/`](src/blake2) is copyright (c) Samuel
Neves, 2013-2015, and under
[CC0 License](https://creativecommons.org/about/cc0).
All licenses are therefore GPL-compatible.
Binary file added src/crypto/argon2/argon2-specs.pdf
Binary file not shown.
452 changes: 452 additions & 0 deletions src/crypto/argon2/argon2.c

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions src/crypto/argon2/bench.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef _WIN32
#include <intrin.h>
#endif

#include "argon2.h"

static uint64_t rdtsc(void) {
#ifdef _WIN32
return __rdtsc();
#else
#if defined(__amd64__) || defined(__x86_64__)
uint64_t rax, rdx;
__asm__ __volatile__("rdtsc" : "=a"(rax), "=d"(rdx) : :);
return (rdx << 32) | rax;
#elif defined(__i386__) || defined(__i386) || defined(__X86__)
uint64_t rax;
__asm__ __volatile__("rdtsc" : "=A"(rax) : :);
return rax;
#else
#error "Not implemented!"
#endif
#endif
}

/*
* Benchmarks Argon2 with salt length 16, password length 16, t_cost 3,
and different m_cost and threads
*/
static void benchmark() {
#define BENCH_OUTLEN 16
#define BENCH_INLEN 16
const uint32_t inlen = BENCH_INLEN;
const unsigned outlen = BENCH_OUTLEN;
unsigned char out[BENCH_OUTLEN];
unsigned char pwd_array[BENCH_INLEN];
unsigned char salt_array[BENCH_INLEN];
#undef BENCH_INLEN
#undef BENCH_OUTLEN

uint32_t t_cost = 3;
uint32_t m_cost;
uint32_t thread_test[4] = {1, 2, 4, 8};
argon2_type types[3] = {Argon2_i, Argon2_d, Argon2_id};

memset(pwd_array, 0, inlen);
memset(salt_array, 1, inlen);

for (m_cost = (uint32_t)1 << 10; m_cost <= (uint32_t)1 << 22; m_cost *= 2) {
unsigned i;
for (i = 0; i < 4; ++i) {
double run_time = 0;
uint32_t thread_n = thread_test[i];

unsigned j;
for (j = 0; j < 3; ++j) {
clock_t start_time, stop_time;
uint64_t start_cycles, stop_cycles;
uint64_t delta;
double mcycles;

argon2_type type = types[j];
start_time = clock();
start_cycles = rdtsc();

argon2_hash(t_cost, m_cost, thread_n, pwd_array, inlen,
salt_array, inlen, out, outlen, NULL, 0, type,
ARGON2_VERSION_NUMBER);

stop_cycles = rdtsc();
stop_time = clock();

delta = (stop_cycles - start_cycles) / (m_cost);
mcycles = (double)(stop_cycles - start_cycles) / (1UL << 20);
run_time += ((double)stop_time - start_time) / (CLOCKS_PER_SEC);

printf("%s %d iterations %d MiB %d threads: %2.2f cpb %2.2f "
"Mcycles \n", argon2_type2string(type, 1), t_cost,
m_cost >> 10, thread_n, (float)delta / 1024, mcycles);
}

printf("%2.4f seconds\n\n", run_time);
}
}
}

int main() {
benchmark();
return ARGON2_OK;
}
156 changes: 156 additions & 0 deletions src/crypto/argon2/blake2/blake2-impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef PORTABLE_BLAKE2_IMPL_H
#define PORTABLE_BLAKE2_IMPL_H

#include <stdint.h>
#include <string.h>

#ifdef _WIN32
#define BLAKE2_INLINE __inline
#elif defined(__GNUC__) || defined(__clang__)
#define BLAKE2_INLINE __inline__
#else
#define BLAKE2_INLINE
#endif

/* Argon2 Team - Begin Code */
/*
Not an exhaustive list, but should cover the majority of modern platforms
Additionally, the code will always be correct---this is only a performance
tweak.
*/
#if (defined(__BYTE_ORDER__) && \
(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) || \
defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || defined(__MIPSEL__) || \
defined(__AARCH64EL__) || defined(__amd64__) || defined(__i386__) || \
defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) || \
defined(_M_ARM)
#define NATIVE_LITTLE_ENDIAN
#endif
/* Argon2 Team - End Code */

static BLAKE2_INLINE uint32_t load32(const void *src) {
#if defined(NATIVE_LITTLE_ENDIAN)
uint32_t w;
memcpy(&w, src, sizeof w);
return w;
#else
const uint8_t *p = (const uint8_t *)src;
uint32_t w = *p++;
w |= (uint32_t)(*p++) << 8;
w |= (uint32_t)(*p++) << 16;
w |= (uint32_t)(*p++) << 24;
return w;
#endif
}

static BLAKE2_INLINE uint64_t load64(const void *src) {
#if defined(NATIVE_LITTLE_ENDIAN)
uint64_t w;
memcpy(&w, src, sizeof w);
return w;
#else
const uint8_t *p = (const uint8_t *)src;
uint64_t w = *p++;
w |= (uint64_t)(*p++) << 8;
w |= (uint64_t)(*p++) << 16;
w |= (uint64_t)(*p++) << 24;
w |= (uint64_t)(*p++) << 32;
w |= (uint64_t)(*p++) << 40;
w |= (uint64_t)(*p++) << 48;
w |= (uint64_t)(*p++) << 56;
return w;
#endif
}

static BLAKE2_INLINE void store32(void *dst, uint32_t w) {
#if defined(NATIVE_LITTLE_ENDIAN)
memcpy(dst, &w, sizeof w);
#else
uint8_t *p = (uint8_t *)dst;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
#endif
}

static BLAKE2_INLINE void store64(void *dst, uint64_t w) {
#if defined(NATIVE_LITTLE_ENDIAN)
memcpy(dst, &w, sizeof w);
#else
uint8_t *p = (uint8_t *)dst;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
#endif
}

static BLAKE2_INLINE uint64_t load48(const void *src) {
const uint8_t *p = (const uint8_t *)src;
uint64_t w = *p++;
w |= (uint64_t)(*p++) << 8;
w |= (uint64_t)(*p++) << 16;
w |= (uint64_t)(*p++) << 24;
w |= (uint64_t)(*p++) << 32;
w |= (uint64_t)(*p++) << 40;
return w;
}

static BLAKE2_INLINE void store48(void *dst, uint64_t w) {
uint8_t *p = (uint8_t *)dst;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
w >>= 8;
*p++ = (uint8_t)w;
}

static BLAKE2_INLINE uint32_t rotr32(const uint32_t w, const unsigned c) {
return (w >> c) | (w << (32 - c));
}

static BLAKE2_INLINE uint64_t rotr64(const uint64_t w, const unsigned c) {
return (w >> c) | (w << (64 - c));
}

void clear_internal_memory(void *v, size_t n);

#endif
89 changes: 89 additions & 0 deletions src/crypto/argon2/blake2/blake2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef PORTABLE_BLAKE2_H
#define PORTABLE_BLAKE2_H

#include <argon2.h>

#if defined(__cplusplus)
extern "C" {
#endif

enum blake2b_constant {
BLAKE2B_BLOCKBYTES = 128,
BLAKE2B_OUTBYTES = 64,
BLAKE2B_KEYBYTES = 64,
BLAKE2B_SALTBYTES = 16,
BLAKE2B_PERSONALBYTES = 16
};

#pragma pack(push, 1)
typedef struct __blake2b_param {
uint8_t digest_length; /* 1 */
uint8_t key_length; /* 2 */
uint8_t fanout; /* 3 */
uint8_t depth; /* 4 */
uint32_t leaf_length; /* 8 */
uint64_t node_offset; /* 16 */
uint8_t node_depth; /* 17 */
uint8_t inner_length; /* 18 */
uint8_t reserved[14]; /* 32 */
uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */
uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */
} blake2b_param;
#pragma pack(pop)

typedef struct __blake2b_state {
uint64_t h[8];
uint64_t t[2];
uint64_t f[2];
uint8_t buf[BLAKE2B_BLOCKBYTES];
unsigned buflen;
unsigned outlen;
uint8_t last_node;
} blake2b_state;

/* Ensure param structs have not been wrongly padded */
/* Poor man's static_assert */
enum {
blake2_size_check_0 = 1 / !!(CHAR_BIT == 8),
blake2_size_check_2 =
1 / !!(sizeof(blake2b_param) == sizeof(uint64_t) * CHAR_BIT)
};

/* Streaming API */
ARGON2_LOCAL int blake2b_init(blake2b_state *S, size_t outlen);
ARGON2_LOCAL int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
size_t keylen);
ARGON2_LOCAL int blake2b_init_param(blake2b_state *S, const blake2b_param *P);
ARGON2_LOCAL int blake2b_update(blake2b_state *S, const void *in, size_t inlen);
ARGON2_LOCAL int blake2b_final(blake2b_state *S, void *out, size_t outlen);

/* Simple API */
ARGON2_LOCAL int blake2b(void *out, size_t outlen, const void *in, size_t inlen,
const void *key, size_t keylen);

/* Argon2 Team - Begin Code */
ARGON2_LOCAL int blake2b_long(void *out, size_t outlen, const void *in, size_t inlen);
/* Argon2 Team - End Code */

#if defined(__cplusplus)
}
#endif

#endif
390 changes: 390 additions & 0 deletions src/crypto/argon2/blake2/blake2b.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,390 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "blake2.h"
#include "blake2-impl.h"

static const uint64_t blake2b_IV[8] = {
UINT64_C(0x6a09e667f3bcc908), UINT64_C(0xbb67ae8584caa73b),
UINT64_C(0x3c6ef372fe94f82b), UINT64_C(0xa54ff53a5f1d36f1),
UINT64_C(0x510e527fade682d1), UINT64_C(0x9b05688c2b3e6c1f),
UINT64_C(0x1f83d9abfb41bd6b), UINT64_C(0x5be0cd19137e2179)};

static const unsigned int blake2b_sigma[12][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},
};

static BLAKE2_INLINE void blake2b_set_lastnode(blake2b_state *S) {
S->f[1] = (uint64_t)-1;
}

static BLAKE2_INLINE void blake2b_set_lastblock(blake2b_state *S) {
if (S->last_node) {
blake2b_set_lastnode(S);
}
S->f[0] = (uint64_t)-1;
}

static BLAKE2_INLINE void blake2b_increment_counter(blake2b_state *S,
uint64_t inc) {
S->t[0] += inc;
S->t[1] += (S->t[0] < inc);
}

static BLAKE2_INLINE void blake2b_invalidate_state(blake2b_state *S) {
clear_internal_memory(S, sizeof(*S)); /* wipe */
blake2b_set_lastblock(S); /* invalidate for further use */
}

static BLAKE2_INLINE void blake2b_init0(blake2b_state *S) {
memset(S, 0, sizeof(*S));
memcpy(S->h, blake2b_IV, sizeof(S->h));
}

int blake2b_init_param(blake2b_state *S, const blake2b_param *P) {
const unsigned char *p = (const unsigned char *)P;
unsigned int i;

if (NULL == P || NULL == S) {
return -1;
}

blake2b_init0(S);
/* IV XOR Parameter Block */
for (i = 0; i < 8; ++i) {
S->h[i] ^= load64(&p[i * sizeof(S->h[i])]);
}
S->outlen = P->digest_length;
return 0;
}

/* Sequential blake2b initialization */
int blake2b_init(blake2b_state *S, size_t outlen) {
blake2b_param P;

if (S == NULL) {
return -1;
}

if ((outlen == 0) || (outlen > BLAKE2B_OUTBYTES)) {
blake2b_invalidate_state(S);
return -1;
}

/* Setup Parameter Block for unkeyed BLAKE2 */
P.digest_length = (uint8_t)outlen;
P.key_length = 0;
P.fanout = 1;
P.depth = 1;
P.leaf_length = 0;
P.node_offset = 0;
P.node_depth = 0;
P.inner_length = 0;
memset(P.reserved, 0, sizeof(P.reserved));
memset(P.salt, 0, sizeof(P.salt));
memset(P.personal, 0, sizeof(P.personal));

return blake2b_init_param(S, &P);
}

int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
size_t keylen) {
blake2b_param P;

if (S == NULL) {
return -1;
}

if ((outlen == 0) || (outlen > BLAKE2B_OUTBYTES)) {
blake2b_invalidate_state(S);
return -1;
}

if ((key == 0) || (keylen == 0) || (keylen > BLAKE2B_KEYBYTES)) {
blake2b_invalidate_state(S);
return -1;
}

/* Setup Parameter Block for keyed BLAKE2 */
P.digest_length = (uint8_t)outlen;
P.key_length = (uint8_t)keylen;
P.fanout = 1;
P.depth = 1;
P.leaf_length = 0;
P.node_offset = 0;
P.node_depth = 0;
P.inner_length = 0;
memset(P.reserved, 0, sizeof(P.reserved));
memset(P.salt, 0, sizeof(P.salt));
memset(P.personal, 0, sizeof(P.personal));

if (blake2b_init_param(S, &P) < 0) {
blake2b_invalidate_state(S);
return -1;
}

{
uint8_t block[BLAKE2B_BLOCKBYTES];
memset(block, 0, BLAKE2B_BLOCKBYTES);
memcpy(block, key, keylen);
blake2b_update(S, block, BLAKE2B_BLOCKBYTES);
/* Burn the key from stack */
clear_internal_memory(block, BLAKE2B_BLOCKBYTES);
}
return 0;
}

static void blake2b_compress(blake2b_state *S, const uint8_t *block) {
uint64_t m[16];
uint64_t v[16];
unsigned int i, r;

for (i = 0; i < 16; ++i) {
m[i] = load64(block + i * sizeof(m[i]));
}

for (i = 0; i < 8; ++i) {
v[i] = S->h[i];
}

v[8] = blake2b_IV[0];
v[9] = blake2b_IV[1];
v[10] = blake2b_IV[2];
v[11] = blake2b_IV[3];
v[12] = blake2b_IV[4] ^ S->t[0];
v[13] = blake2b_IV[5] ^ S->t[1];
v[14] = blake2b_IV[6] ^ S->f[0];
v[15] = blake2b_IV[7] ^ S->f[1];

#define G(r, i, a, b, c, d) \
do { \
a = a + b + m[blake2b_sigma[r][2 * i + 0]]; \
d = rotr64(d ^ a, 32); \
c = c + d; \
b = rotr64(b ^ c, 24); \
a = a + b + m[blake2b_sigma[r][2 * i + 1]]; \
d = rotr64(d ^ a, 16); \
c = c + d; \
b = rotr64(b ^ c, 63); \
} while ((void)0, 0)

#define ROUND(r) \
do { \
G(r, 0, v[0], v[4], v[8], v[12]); \
G(r, 1, v[1], v[5], v[9], v[13]); \
G(r, 2, v[2], v[6], v[10], v[14]); \
G(r, 3, v[3], v[7], v[11], v[15]); \
G(r, 4, v[0], v[5], v[10], v[15]); \
G(r, 5, v[1], v[6], v[11], v[12]); \
G(r, 6, v[2], v[7], v[8], v[13]); \
G(r, 7, v[3], v[4], v[9], v[14]); \
} while ((void)0, 0)

for (r = 0; r < 12; ++r) {
ROUND(r);
}

for (i = 0; i < 8; ++i) {
S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
}

#undef G
#undef ROUND
}

int blake2b_update(blake2b_state *S, const void *in, size_t inlen) {
const uint8_t *pin = (const uint8_t *)in;

if (inlen == 0) {
return 0;
}

/* Sanity check */
if (S == NULL || in == NULL) {
return -1;
}

/* Is this a reused state? */
if (S->f[0] != 0) {
return -1;
}

if (S->buflen + inlen > BLAKE2B_BLOCKBYTES) {
/* Complete current block */
size_t left = S->buflen;
size_t fill = BLAKE2B_BLOCKBYTES - left;
memcpy(&S->buf[left], pin, fill);
blake2b_increment_counter(S, BLAKE2B_BLOCKBYTES);
blake2b_compress(S, S->buf);
S->buflen = 0;
inlen -= fill;
pin += fill;
/* Avoid buffer copies when possible */
while (inlen > BLAKE2B_BLOCKBYTES) {
blake2b_increment_counter(S, BLAKE2B_BLOCKBYTES);
blake2b_compress(S, pin);
inlen -= BLAKE2B_BLOCKBYTES;
pin += BLAKE2B_BLOCKBYTES;
}
}
memcpy(&S->buf[S->buflen], pin, inlen);
S->buflen += (unsigned int)inlen;
return 0;
}

int blake2b_final(blake2b_state *S, void *out, size_t outlen) {
uint8_t buffer[BLAKE2B_OUTBYTES] = {0};
unsigned int i;

/* Sanity checks */
if (S == NULL || out == NULL || outlen < S->outlen) {
return -1;
}

/* Is this a reused state? */
if (S->f[0] != 0) {
return -1;
}

blake2b_increment_counter(S, S->buflen);
blake2b_set_lastblock(S);
memset(&S->buf[S->buflen], 0, BLAKE2B_BLOCKBYTES - S->buflen); /* Padding */
blake2b_compress(S, S->buf);

for (i = 0; i < 8; ++i) { /* Output full hash to temp buffer */
store64(buffer + sizeof(S->h[i]) * i, S->h[i]);
}

memcpy(out, buffer, S->outlen);
clear_internal_memory(buffer, sizeof(buffer));
clear_internal_memory(S->buf, sizeof(S->buf));
clear_internal_memory(S->h, sizeof(S->h));
return 0;
}

int blake2b(void *out, size_t outlen, const void *in, size_t inlen,
const void *key, size_t keylen) {
blake2b_state S;
int ret = -1;

/* Verify parameters */
if (NULL == in && inlen > 0) {
goto fail;
}

if (NULL == out || outlen == 0 || outlen > BLAKE2B_OUTBYTES) {
goto fail;
}

if ((NULL == key && keylen > 0) || keylen > BLAKE2B_KEYBYTES) {
goto fail;
}

if (keylen > 0) {
if (blake2b_init_key(&S, outlen, key, keylen) < 0) {
goto fail;
}
} else {
if (blake2b_init(&S, outlen) < 0) {
goto fail;
}
}

if (blake2b_update(&S, in, inlen) < 0) {
goto fail;
}
ret = blake2b_final(&S, out, outlen);

fail:
clear_internal_memory(&S, sizeof(S));
return ret;
}

/* Argon2 Team - Begin Code */
int blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) {
uint8_t *out = (uint8_t *)pout;
blake2b_state blake_state;
uint8_t outlen_bytes[sizeof(uint32_t)] = {0};
int ret = -1;

if (outlen > UINT32_MAX) {
goto fail;
}

/* Ensure little-endian byte order! */
store32(outlen_bytes, (uint32_t)outlen);

#define TRY(statement) \
do { \
ret = statement; \
if (ret < 0) { \
goto fail; \
} \
} while ((void)0, 0)

if (outlen <= BLAKE2B_OUTBYTES) {
TRY(blake2b_init(&blake_state, outlen));
TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes)));
TRY(blake2b_update(&blake_state, in, inlen));
TRY(blake2b_final(&blake_state, out, outlen));
} else {
uint32_t toproduce;
uint8_t out_buffer[BLAKE2B_OUTBYTES];
uint8_t in_buffer[BLAKE2B_OUTBYTES];
TRY(blake2b_init(&blake_state, BLAKE2B_OUTBYTES));
TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes)));
TRY(blake2b_update(&blake_state, in, inlen));
TRY(blake2b_final(&blake_state, out_buffer, BLAKE2B_OUTBYTES));
memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);
out += BLAKE2B_OUTBYTES / 2;
toproduce = (uint32_t)outlen - BLAKE2B_OUTBYTES / 2;

while (toproduce > BLAKE2B_OUTBYTES) {
memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);
TRY(blake2b(out_buffer, BLAKE2B_OUTBYTES, in_buffer,
BLAKE2B_OUTBYTES, NULL, 0));
memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);
out += BLAKE2B_OUTBYTES / 2;
toproduce -= BLAKE2B_OUTBYTES / 2;
}

memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);
TRY(blake2b(out_buffer, toproduce, in_buffer, BLAKE2B_OUTBYTES, NULL,
0));
memcpy(out, out_buffer, toproduce);
}
fail:
clear_internal_memory(&blake_state, sizeof(blake_state));
return ret;
#undef TRY
}
/* Argon2 Team - End Code */
471 changes: 471 additions & 0 deletions src/crypto/argon2/blake2/blamka-round-opt.h

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions src/crypto/argon2/blake2/blamka-round-ref.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef BLAKE_ROUND_MKA_H
#define BLAKE_ROUND_MKA_H

#include "blake2.h"
#include "blake2-impl.h"

/* designed by the Lyra PHC team */
static BLAKE2_INLINE uint64_t fBlaMka(uint64_t x, uint64_t y) {
const uint64_t m = UINT64_C(0xFFFFFFFF);
const uint64_t xy = (x & m) * (y & m);
return x + y + 2 * xy;
}

#define G(a, b, c, d) \
do { \
a = fBlaMka(a, b); \
d = rotr64(d ^ a, 32); \
c = fBlaMka(c, d); \
b = rotr64(b ^ c, 24); \
a = fBlaMka(a, b); \
d = rotr64(d ^ a, 16); \
c = fBlaMka(c, d); \
b = rotr64(b ^ c, 63); \
} while ((void)0, 0)

#define BLAKE2_ROUND_NOMSG(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, \
v12, v13, v14, v15) \
do { \
G(v0, v4, v8, v12); \
G(v1, v5, v9, v13); \
G(v2, v6, v10, v14); \
G(v3, v7, v11, v15); \
G(v0, v5, v10, v15); \
G(v1, v6, v11, v12); \
G(v2, v7, v8, v13); \
G(v3, v4, v9, v14); \
} while ((void)0, 0)

#endif
648 changes: 648 additions & 0 deletions src/crypto/argon2/core.c

Large diffs are not rendered by default.

228 changes: 228 additions & 0 deletions src/crypto/argon2/core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef ARGON2_CORE_H
#define ARGON2_CORE_H

#include "argon2.h"

#define CONST_CAST(x) (x)(uintptr_t)

/**********************Argon2 internal constants*******************************/

enum argon2_core_constants {
/* Memory block size in bytes */
ARGON2_BLOCK_SIZE = 1024,
ARGON2_QWORDS_IN_BLOCK = ARGON2_BLOCK_SIZE / 8,
ARGON2_OWORDS_IN_BLOCK = ARGON2_BLOCK_SIZE / 16,
ARGON2_HWORDS_IN_BLOCK = ARGON2_BLOCK_SIZE / 32,
ARGON2_512BIT_WORDS_IN_BLOCK = ARGON2_BLOCK_SIZE / 64,

/* Number of pseudo-random values generated by one call to Blake in Argon2i
to
generate reference block positions */
ARGON2_ADDRESSES_IN_BLOCK = 128,

/* Pre-hashing digest length and its extension*/
ARGON2_PREHASH_DIGEST_LENGTH = 64,
ARGON2_PREHASH_SEED_LENGTH = 72
};

/*************************Argon2 internal data types***********************/

/*
* Structure for the (1KB) memory block implemented as 128 64-bit words.
* Memory blocks can be copied, XORed. Internal words can be accessed by [] (no
* bounds checking).
*/
typedef struct block_ { uint64_t v[ARGON2_QWORDS_IN_BLOCK]; } block;

/*****************Functions that work with the block******************/

/* Initialize each byte of the block with @in */
void init_block_value(block *b, uint8_t in);

/* Copy block @src to block @dst */
void copy_block(block *dst, const block *src);

/* XOR @src onto @dst bytewise */
void xor_block(block *dst, const block *src);

/*
* Argon2 instance: memory pointer, number of passes, amount of memory, type,
* and derived values.
* Used to evaluate the number and location of blocks to construct in each
* thread
*/
typedef struct Argon2_instance_t {
block *memory; /* Memory pointer */
uint32_t version;
uint32_t passes; /* Number of passes */
uint32_t memory_blocks; /* Number of blocks in memory */
uint32_t segment_length;
uint32_t lane_length;
uint32_t lanes;
uint32_t threads;
argon2_type type;
int print_internals; /* whether to print the memory blocks */
argon2_context *context_ptr; /* points back to original context */
} argon2_instance_t;

/*
* Argon2 position: where we construct the block right now. Used to distribute
* work between threads.
*/
typedef struct Argon2_position_t {
uint32_t pass;
uint32_t lane;
uint8_t slice;
uint32_t index;
} argon2_position_t;

/*Struct that holds the inputs for thread handling FillSegment*/
typedef struct Argon2_thread_data {
argon2_instance_t *instance_ptr;
argon2_position_t pos;
} argon2_thread_data;

/*************************Argon2 core functions********************************/

/* Allocates memory to the given pointer, uses the appropriate allocator as
* specified in the context. Total allocated memory is num*size.
* @param context argon2_context which specifies the allocator
* @param memory pointer to the pointer to the memory
* @param size the size in bytes for each element to be allocated
* @param num the number of elements to be allocated
* @return ARGON2_OK if @memory is a valid pointer and memory is allocated
*/
int allocate_memory(const argon2_context *context, uint8_t **memory,
size_t num, size_t size);

/*
* Frees memory at the given pointer, uses the appropriate deallocator as
* specified in the context. Also cleans the memory using clear_internal_memory.
* @param context argon2_context which specifies the deallocator
* @param memory pointer to buffer to be freed
* @param size the size in bytes for each element to be deallocated
* @param num the number of elements to be deallocated
*/
void free_memory(const argon2_context *context, uint8_t *memory,
size_t num, size_t size);

/* Function that securely cleans the memory. This ignores any flags set
* regarding clearing memory. Usually one just calls clear_internal_memory.
* @param mem Pointer to the memory
* @param s Memory size in bytes
*/
void secure_wipe_memory(void *v, size_t n);

/* Function that securely clears the memory if FLAG_clear_internal_memory is
* set. If the flag isn't set, this function does nothing.
* @param mem Pointer to the memory
* @param s Memory size in bytes
*/
void clear_internal_memory(void *v, size_t n);

/*
* Computes absolute position of reference block in the lane following a skewed
* distribution and using a pseudo-random value as input
* @param instance Pointer to the current instance
* @param position Pointer to the current position
* @param pseudo_rand 32-bit pseudo-random value used to determine the position
* @param same_lane Indicates if the block will be taken from the current lane.
* If so we can reference the current segment
* @pre All pointers must be valid
*/
uint32_t index_alpha(const argon2_instance_t *instance,
const argon2_position_t *position, uint32_t pseudo_rand,
int same_lane);

/*
* Function that validates all inputs against predefined restrictions and return
* an error code
* @param context Pointer to current Argon2 context
* @return ARGON2_OK if everything is all right, otherwise one of error codes
* (all defined in <argon2.h>
*/
int validate_inputs(const argon2_context *context);

/*
* Hashes all the inputs into @a blockhash[PREHASH_DIGEST_LENGTH], clears
* password and secret if needed
* @param context Pointer to the Argon2 internal structure containing memory
* pointer, and parameters for time and space requirements.
* @param blockhash Buffer for pre-hashing digest
* @param type Argon2 type
* @pre @a blockhash must have at least @a PREHASH_DIGEST_LENGTH bytes
* allocated
*/
void initial_hash(uint8_t *blockhash, argon2_context *context,
argon2_type type);

/*
* Function creates first 2 blocks per lane
* @param instance Pointer to the current instance
* @param blockhash Pointer to the pre-hashing digest
* @pre blockhash must point to @a PREHASH_SEED_LENGTH allocated values
*/
void fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance);

/*
* Function allocates memory, hashes the inputs with Blake, and creates first
* two blocks. Returns the pointer to the main memory with 2 blocks per lane
* initialized
* @param context Pointer to the Argon2 internal structure containing memory
* pointer, and parameters for time and space requirements.
* @param instance Current Argon2 instance
* @return Zero if successful, -1 if memory failed to allocate. @context->state
* will be modified if successful.
*/
int initialize(argon2_instance_t *instance, argon2_context *context);

/*
* XORing the last block of each lane, hashing it, making the tag. Deallocates
* the memory.
* @param context Pointer to current Argon2 context (use only the out parameters
* from it)
* @param instance Pointer to current instance of Argon2
* @pre instance->state must point to necessary amount of memory
* @pre context->out must point to outlen bytes of memory
* @pre if context->free_cbk is not NULL, it should point to a function that
* deallocates memory
*/
void finalize(const argon2_context *context, argon2_instance_t *instance);

/*
* Function that fills the segment using previous segments also from other
* threads
* @param context current context
* @param instance Pointer to the current instance
* @param position Current position
* @pre all block pointers must be valid
*/
void fill_segment(const argon2_instance_t *instance,
argon2_position_t position);

/*
* Function that fills the entire memory t_cost times based on the first two
* blocks in each lane
* @param instance Pointer to the current instance
* @return ARGON2_OK if successful, @context->state
*/
int fill_memory_blocks(argon2_instance_t *instance);

#endif
463 changes: 463 additions & 0 deletions src/crypto/argon2/encoding.c

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions src/crypto/argon2/encoding.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef ENCODING_H
#define ENCODING_H
#include "argon2.h"

#define ARGON2_MAX_DECODED_LANES UINT32_C(255)
#define ARGON2_MIN_DECODED_SALT_LEN UINT32_C(8)
#define ARGON2_MIN_DECODED_OUT_LEN UINT32_C(12)

/*
* encode an Argon2 hash string into the provided buffer. 'dst_len'
* contains the size, in characters, of the 'dst' buffer; if 'dst_len'
* is less than the number of required characters (including the
* terminating 0), then this function returns ARGON2_ENCODING_ERROR.
*
* on success, ARGON2_OK is returned.
*/
int encode_string(char *dst, size_t dst_len, argon2_context *ctx,
argon2_type type);

/*
* Decodes an Argon2 hash string into the provided structure 'ctx'.
* The only fields that must be set prior to this call are ctx.saltlen and
* ctx.outlen (which must be the maximal salt and out length values that are
* allowed), ctx.salt and ctx.out (which must be buffers of the specified
* length), and ctx.pwd and ctx.pwdlen which must hold a valid password.
*
* Invalid input string causes an error. On success, the ctx is valid and all
* fields have been initialized.
*
* Returned value is ARGON2_OK on success, other ARGON2_ codes on error.
*/
int decode_string(argon2_context *ctx, const char *str, argon2_type type);

/* Returns the length of the encoded byte stream with length len */
size_t b64len(uint32_t len);

/* Returns the length of the encoded number num */
size_t numlen(uint32_t num);

#endif
213 changes: 213 additions & 0 deletions src/crypto/argon2/genkat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "argon2.h"
#include "core.h"
#ifdef __MINGW32__
#include <inttypes.h>
#else
/* Don't use <inttypes.h> (it's not C89) */
#define PRIx64 "llx"
#endif

void initial_kat(const uint8_t *blockhash, const argon2_context *context,
argon2_type type) {
unsigned i;

if (blockhash != NULL && context != NULL) {
printf("=======================================\n");

printf("%s version number %d\n", argon2_type2string(type, 1),
context->version);

printf("=======================================\n");


printf("Memory: %u KiB, Iterations: %u, Parallelism: %u lanes, Tag "
"length: %u bytes\n",
context->m_cost, context->t_cost, context->lanes,
context->outlen);

printf("Password[%u]: ", context->pwdlen);

if (context->flags & ARGON2_FLAG_CLEAR_PASSWORD) {
printf("CLEARED\n");
} else {
for (i = 0; i < context->pwdlen; ++i) {
printf("%2.2x ", ((unsigned char *)context->pwd)[i]);
}

printf("\n");
}

printf("Salt[%u]: ", context->saltlen);

for (i = 0; i < context->saltlen; ++i) {
printf("%2.2x ", ((unsigned char *)context->salt)[i]);
}

printf("\n");

printf("Secret[%u]: ", context->secretlen);

if (context->flags & ARGON2_FLAG_CLEAR_SECRET) {
printf("CLEARED\n");
} else {
for (i = 0; i < context->secretlen; ++i) {
printf("%2.2x ", ((unsigned char *)context->secret)[i]);
}

printf("\n");
}

printf("Associated data[%u]: ", context->adlen);

for (i = 0; i < context->adlen; ++i) {
printf("%2.2x ", ((unsigned char *)context->ad)[i]);
}

printf("\n");

printf("Pre-hashing digest: ");

for (i = 0; i < ARGON2_PREHASH_DIGEST_LENGTH; ++i) {
printf("%2.2x ", ((unsigned char *)blockhash)[i]);
}

printf("\n");
}
}

void print_tag(const void *out, uint32_t outlen) {
unsigned i;
if (out != NULL) {
printf("Tag: ");

for (i = 0; i < outlen; ++i) {
printf("%2.2x ", ((uint8_t *)out)[i]);
}

printf("\n");
}
}

void internal_kat(const argon2_instance_t *instance, uint32_t pass) {

if (instance != NULL) {
uint32_t i, j;
printf("\n After pass %u:\n", pass);

for (i = 0; i < instance->memory_blocks; ++i) {
uint32_t how_many_words =
(instance->memory_blocks > ARGON2_QWORDS_IN_BLOCK)
? 1
: ARGON2_QWORDS_IN_BLOCK;

for (j = 0; j < how_many_words; ++j)
printf("Block %.4u [%3u]: %016" PRIx64 "\n", i, j,
(unsigned long long)instance->memory[i].v[j]);
}
}
}

static void fatal(const char *error) {
fprintf(stderr, "Error: %s\n", error);
exit(1);
}

static void generate_testvectors(argon2_type type, const uint32_t version) {
#define TEST_OUTLEN 32
#define TEST_PWDLEN 32
#define TEST_SALTLEN 16
#define TEST_SECRETLEN 8
#define TEST_ADLEN 12
argon2_context context;

unsigned char out[TEST_OUTLEN];
unsigned char pwd[TEST_PWDLEN];
unsigned char salt[TEST_SALTLEN];
unsigned char secret[TEST_SECRETLEN];
unsigned char ad[TEST_ADLEN];
const allocate_fptr myown_allocator = NULL;
const deallocate_fptr myown_deallocator = NULL;

unsigned t_cost = 3;
unsigned m_cost = 32;
unsigned lanes = 4;

memset(pwd, 1, TEST_OUTLEN);
memset(salt, 2, TEST_SALTLEN);
memset(secret, 3, TEST_SECRETLEN);
memset(ad, 4, TEST_ADLEN);

context.out = out;
context.outlen = TEST_OUTLEN;
context.version = version;
context.pwd = pwd;
context.pwdlen = TEST_PWDLEN;
context.salt = salt;
context.saltlen = TEST_SALTLEN;
context.secret = secret;
context.secretlen = TEST_SECRETLEN;
context.ad = ad;
context.adlen = TEST_ADLEN;
context.t_cost = t_cost;
context.m_cost = m_cost;
context.lanes = lanes;
context.threads = lanes;
context.allocate_cbk = myown_allocator;
context.free_cbk = myown_deallocator;
context.flags = ARGON2_DEFAULT_FLAGS;

#undef TEST_OUTLEN
#undef TEST_PWDLEN
#undef TEST_SALTLEN
#undef TEST_SECRETLEN
#undef TEST_ADLEN

argon2_ctx(&context, type);
}

int main(int argc, char *argv[]) {
/* Get and check Argon2 type */
const char *type_str = (argc > 1) ? argv[1] : "i";
argon2_type type = Argon2_i;
uint32_t version = ARGON2_VERSION_NUMBER;
if (!strcmp(type_str, "d")) {
type = Argon2_d;
} else if (!strcmp(type_str, "i")) {
type = Argon2_i;
} else if (!strcmp(type_str, "id")) {
type = Argon2_id;
} else {
fatal("wrong Argon2 type");
}

/* Get and check Argon2 version number */
if (argc > 2) {
version = strtoul(argv[2], NULL, 10);
}
if (ARGON2_VERSION_10 != version && ARGON2_VERSION_NUMBER != version) {
fatal("wrong Argon2 version number");
}

generate_testvectors(type, version);
return ARGON2_OK;
}
51 changes: 51 additions & 0 deletions src/crypto/argon2/genkat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef ARGON2_KAT_H
#define ARGON2_KAT_H

#include "core.h"

/*
* Initial KAT function that prints the inputs to the file
* @param blockhash Array that contains pre-hashing digest
* @param context Holds inputs
* @param type Argon2 type
* @pre blockhash must point to INPUT_INITIAL_HASH_LENGTH bytes
* @pre context member pointers must point to allocated memory of size according
* to the length values
*/
void initial_kat(const uint8_t *blockhash, const argon2_context *context,
argon2_type type);

/*
* Function that prints the output tag
* @param out output array pointer
* @param outlen digest length
* @pre out must point to @a outlen bytes
**/
void print_tag(const void *out, uint32_t outlen);

/*
* Function that prints the internal state at given moment
* @param instance pointer to the current instance
* @param pass current pass number
* @pre instance must have necessary memory allocated
**/
void internal_kat(const argon2_instance_t *instance, uint32_t pass);

#endif
437 changes: 437 additions & 0 deletions src/crypto/argon2/include/argon2.h

Large diffs are not rendered by default.

12,304 changes: 12,304 additions & 0 deletions src/crypto/argon2/kats/argon2d

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/crypto/argon2/kats/argon2d.shasum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
73619cfe0f35e52fdd1ca2595ffaa359879467407f98b61f4969c2861cc329ce argon2d
12,304 changes: 12,304 additions & 0 deletions src/crypto/argon2/kats/argon2d_v16

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/crypto/argon2/kats/argon2d_v16.shasum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4ec4569a016c3accc6a25a34252b03a6135939b3c452389917a3f3b65878165b argon2d_v16
12,304 changes: 12,304 additions & 0 deletions src/crypto/argon2/kats/argon2i

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/crypto/argon2/kats/argon2i.shasum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
40a3aeafb092d10cf457a8ee0139c114c911ecf97bd5accf5a99c7ddd6917061 argon2i
12,304 changes: 12,304 additions & 0 deletions src/crypto/argon2/kats/argon2i_v16

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/crypto/argon2/kats/argon2i_v16.shasum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
334f03e627afb67b946a530b90d2e11fb2e6abb44df992c0fb3198c7bacf5930 argon2i_v16
12,304 changes: 12,304 additions & 0 deletions src/crypto/argon2/kats/argon2id

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/crypto/argon2/kats/argon2id.shasum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ba05643e504fc5778dda99e2d9f42ebe7d22ebb3923cc719fd591b1b14a8d28d argon2id
12,304 changes: 12,304 additions & 0 deletions src/crypto/argon2/kats/argon2id_v16

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/crypto/argon2/kats/argon2id_v16.shasum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
680774be1d3ad2e74bbc56ee715dd6eb97a58279bf22edc57d00e840ca1ae469 argon2id_v16
42 changes: 42 additions & 0 deletions src/crypto/argon2/kats/check-sums.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Set-Variable tempfile -option Constant -value "tempfile"

function hash($path) {
$fullPath = Resolve-Path $path
$hash = new-object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider

$contents = [IO.File]::ReadAllText($fullPath) -replace "`r`n?", "`n"
# create UTF-8 encoding without signature
$utf8 = New-Object System.Text.UTF8Encoding $false
# write the text back
[IO.File]::WriteAllText($tempfile, $contents, $utf8)

$file = [System.IO.File]::Open($tempfile,[System.IO.Filemode]::Open, [System.IO.FileAccess]::Read)
$result = [System.BitConverter]::ToString($hash.ComputeHash($file))
$file.Dispose()

if (Test-Path $tempfile) {
Remove-Item $tempfile
}

return $result
}

function main() {
$files = $(Get-ChildItem * | Where-Object { $_.Name -match '^[a-z2]*(_v)?[0-9]*$' } | select -ExpandProperty name)

foreach ($file in $files) {
$new = $(hash $file).replace("-","")
$new = $new.ToLower()

$old=$(Get-Content $file".shasum")
$old = $old.Substring(0, $old.IndexOf(" "))

if ($new -eq $old) {
Write-Host $file "`tOK"
} else {
Write-Host $file "`tERROR"
}
}
}

main
13 changes: 13 additions & 0 deletions src/crypto/argon2/kats/check-sums.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

for file in `ls | grep '^[a-z2]*\(_v\)\?[0-9]*$' | xargs`
do
new=`shasum -a 256 $file`
old=`cat $file.shasum`
if [ "$new" = "$old" ]
then
echo $file "\t" OK
else
echo $file "\t" ERROR
fi
done
50 changes: 50 additions & 0 deletions src/crypto/argon2/kats/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
$ErrorActionPreference = "Stop"

Set-Variable tempfile -option Constant -value "tempfile"

function CompareFiles($f1, $f2, $i) {
$f1_content = $(Get-Content $f1)
$f2_content = $(Get-Content $f2)

if (Compare-Object $f1_content $f2_content) {
Write-Host -NoNewline "ERROR"
exit $i
} else {
Write-Host -NoNewline "OK"
}
}

function main() {
$i = 0
foreach ($opt in @("Ref", "Opt")) {
Write-Output "$opt"

foreach ($version in @(16, 19)) {
foreach ($type in @("i", "d", "id")) {
$i++

if ("Ref" -eq $opt) {
vs2015\build\Argon2RefGenKAT.exe $type $version > $tempfile
} else {
vs2015\build\Argon2OptGenKAT.exe $type $version > $tempfile
}

if (19 -eq $version) {
$kats = "kats\argon2" + $type
} else {
$kats = "kats\argon2" + $type + "_v" + $version
}

Write-Host -NoNewline "Argon2$type v=$version : "
CompareFiles $tempfile $kats $i
Write-Output ""
}
}
}

if (Test-Path $tempfile) {
Remove-Item $tempfile
}
}

main
49 changes: 49 additions & 0 deletions src/crypto/argon2/kats/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh

for opttest in "" "OPTTEST=1"
do
if [ "" = "$opttest" ]
then
printf "Default build\n"
else
printf "Force OPTTEST=1\n"
fi

make genkat $opttest > /dev/null
if [ $? -ne 0 ]
then
exit $?
fi

i=0
for version in 16 19
do
for type in i d id
do
i=$(($i+1))

printf "argon2$type v=$version: "

if [ 19 -eq $version ]
then
kats="kats/argon2"$type
else
kats="kats/argon2"$type"_v"$version
fi

./genkat $type $version > tmp
if diff tmp $kats
then
printf "OK"
else
printf "ERROR"
exit $i
fi
printf "\n"
done
done
done

rm -f tmp

exit 0
18 changes: 18 additions & 0 deletions src/crypto/argon2/libargon2.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# libargon2 info for pkg-config
## Template for downstream installers:
## - replace @UPSTREAM_VER@ with current version, e.g. '20160406'
## - replace @HOST_MULTIARCH@ with target arch lib, e.g. 'lib', 'lib/x86_64-linux-gnu' or 'lib64'
## - replace @PREFIX@ with install path, e.g. '/usr', '/usr/local', '/usr/pkg'
## - replace @INCLUDE@ with include path, e.g. 'include' or 'include/argon2'

prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@HOST_MULTIARCH@
includedir=${prefix}/@INCLUDE@

Name: libargon2
Description: Development libraries for libargon2
Version: @UPSTREAM_VER@
Libs: -L${libdir} -largon2 @EXTRA_LIBS@
Cflags: -I${includedir}
URL: https://github.com/P-H-C/phc-winner-argon2
57 changes: 57 additions & 0 deletions src/crypto/argon2/man/argon2.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.TH ARGON2 "1" "April 2016" "argon2 " "User Commands"

.SH NAME
argon2 \- generate argon2 hashes

.SH SYNOPSIS
.B argon2 salt
.RB [ OPTIONS ]

.SH DESCRIPTION
Generate Argon2 hashes from the command line.

The supplied salt (the first argument to the command) must be at least
8 octets in length, and the password is supplied on standard input.

By default, this uses Argon2i variant (where memory access is
independent of secret data) which is the preferred one for password
hashing and password-based key derivation.

.SH OPTIONS
.TP
.B \-h
Display tool usage
.TP
.B \-d
Use Argon2d instead of Argon2i (Argon2i is the default)
.TP
.B \-id
Use Argon2id instead of Argon2i (Argon2i is the default)
.TP
.BI \-t " N"
Sets the number of iterations to N (default = 3)
.TP
.BI \-m " N"
Sets the memory usage of 2^N KiB (default = 12)
.TP
.BI \-p " N"
Sets parallelism to N threads (default = 1)
.TP
.BI \-l " N"
Sets hash output length to N bytes (default = 32)
.TP
.B \-e
Output only encoded hash
.TP
.B \-r
Output only the raw bytes of the hash
.TP
.B \-v (10|13)
Argon2 version (defaults to the most recent version, currently 13)

.SH COPYRIGHT
This manpage was written by \fBDaniel Kahn Gillmor\fR for the Debian
distribution (but may be used by others). It is released, like the
rest of this Argon2 implementation, under a dual license. You may use this work
under the terms of a Creative Commons CC0 1.0 License/Waiver or the Apache
Public License 2.0, at your option.
283 changes: 283 additions & 0 deletions src/crypto/argon2/opt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#include <stdint.h>
#include <string.h>
#include <stdlib.h>

#include "argon2.h"
#include "core.h"

#include "blake2/blake2.h"
#include "blake2/blamka-round-opt.h"

/*
* Function fills a new memory block and optionally XORs the old block over the new one.
* Memory must be initialized.
* @param state Pointer to the just produced block. Content will be updated(!)
* @param ref_block Pointer to the reference block
* @param next_block Pointer to the block to be XORed over. May coincide with @ref_block
* @param with_xor Whether to XOR into the new block (1) or just overwrite (0)
* @pre all block pointers must be valid
*/
#if defined(__AVX512F__)
static void fill_block(__m512i *state, const block *ref_block,
block *next_block, int with_xor) {
__m512i block_XY[ARGON2_512BIT_WORDS_IN_BLOCK];
unsigned int i;

if (with_xor) {
for (i = 0; i < ARGON2_512BIT_WORDS_IN_BLOCK; i++) {
state[i] = _mm512_xor_si512(
state[i], _mm512_loadu_si512((const __m512i *)ref_block->v + i));
block_XY[i] = _mm512_xor_si512(
state[i], _mm512_loadu_si512((const __m512i *)next_block->v + i));
}
} else {
for (i = 0; i < ARGON2_512BIT_WORDS_IN_BLOCK; i++) {
block_XY[i] = state[i] = _mm512_xor_si512(
state[i], _mm512_loadu_si512((const __m512i *)ref_block->v + i));
}
}

for (i = 0; i < 2; ++i) {
BLAKE2_ROUND_1(
state[8 * i + 0], state[8 * i + 1], state[8 * i + 2], state[8 * i + 3],
state[8 * i + 4], state[8 * i + 5], state[8 * i + 6], state[8 * i + 7]);
}

for (i = 0; i < 2; ++i) {
BLAKE2_ROUND_2(
state[2 * 0 + i], state[2 * 1 + i], state[2 * 2 + i], state[2 * 3 + i],
state[2 * 4 + i], state[2 * 5 + i], state[2 * 6 + i], state[2 * 7 + i]);
}

for (i = 0; i < ARGON2_512BIT_WORDS_IN_BLOCK; i++) {
state[i] = _mm512_xor_si512(state[i], block_XY[i]);
_mm512_storeu_si512((__m512i *)next_block->v + i, state[i]);
}
}
#elif defined(__AVX2__)
static void fill_block(__m256i *state, const block *ref_block,
block *next_block, int with_xor) {
__m256i block_XY[ARGON2_HWORDS_IN_BLOCK];
unsigned int i;

if (with_xor) {
for (i = 0; i < ARGON2_HWORDS_IN_BLOCK; i++) {
state[i] = _mm256_xor_si256(
state[i], _mm256_loadu_si256((const __m256i *)ref_block->v + i));
block_XY[i] = _mm256_xor_si256(
state[i], _mm256_loadu_si256((const __m256i *)next_block->v + i));
}
} else {
for (i = 0; i < ARGON2_HWORDS_IN_BLOCK; i++) {
block_XY[i] = state[i] = _mm256_xor_si256(
state[i], _mm256_loadu_si256((const __m256i *)ref_block->v + i));
}
}

for (i = 0; i < 4; ++i) {
BLAKE2_ROUND_1(state[8 * i + 0], state[8 * i + 4], state[8 * i + 1], state[8 * i + 5],
state[8 * i + 2], state[8 * i + 6], state[8 * i + 3], state[8 * i + 7]);
}

for (i = 0; i < 4; ++i) {
BLAKE2_ROUND_2(state[ 0 + i], state[ 4 + i], state[ 8 + i], state[12 + i],
state[16 + i], state[20 + i], state[24 + i], state[28 + i]);
}

for (i = 0; i < ARGON2_HWORDS_IN_BLOCK; i++) {
state[i] = _mm256_xor_si256(state[i], block_XY[i]);
_mm256_storeu_si256((__m256i *)next_block->v + i, state[i]);
}
}
#else
static void fill_block(__m128i *state, const block *ref_block,
block *next_block, int with_xor) {
__m128i block_XY[ARGON2_OWORDS_IN_BLOCK];
unsigned int i;

if (with_xor) {
for (i = 0; i < ARGON2_OWORDS_IN_BLOCK; i++) {
state[i] = _mm_xor_si128(
state[i], _mm_loadu_si128((const __m128i *)ref_block->v + i));
block_XY[i] = _mm_xor_si128(
state[i], _mm_loadu_si128((const __m128i *)next_block->v + i));
}
} else {
for (i = 0; i < ARGON2_OWORDS_IN_BLOCK; i++) {
block_XY[i] = state[i] = _mm_xor_si128(
state[i], _mm_loadu_si128((const __m128i *)ref_block->v + i));
}
}

for (i = 0; i < 8; ++i) {
BLAKE2_ROUND(state[8 * i + 0], state[8 * i + 1], state[8 * i + 2],
state[8 * i + 3], state[8 * i + 4], state[8 * i + 5],
state[8 * i + 6], state[8 * i + 7]);
}

for (i = 0; i < 8; ++i) {
BLAKE2_ROUND(state[8 * 0 + i], state[8 * 1 + i], state[8 * 2 + i],
state[8 * 3 + i], state[8 * 4 + i], state[8 * 5 + i],
state[8 * 6 + i], state[8 * 7 + i]);
}

for (i = 0; i < ARGON2_OWORDS_IN_BLOCK; i++) {
state[i] = _mm_xor_si128(state[i], block_XY[i]);
_mm_storeu_si128((__m128i *)next_block->v + i, state[i]);
}
}
#endif

static void next_addresses(block *address_block, block *input_block) {
/*Temporary zero-initialized blocks*/
#if defined(__AVX512F__)
__m512i zero_block[ARGON2_512BIT_WORDS_IN_BLOCK];
__m512i zero2_block[ARGON2_512BIT_WORDS_IN_BLOCK];
#elif defined(__AVX2__)
__m256i zero_block[ARGON2_HWORDS_IN_BLOCK];
__m256i zero2_block[ARGON2_HWORDS_IN_BLOCK];
#else
__m128i zero_block[ARGON2_OWORDS_IN_BLOCK];
__m128i zero2_block[ARGON2_OWORDS_IN_BLOCK];
#endif

memset(zero_block, 0, sizeof(zero_block));
memset(zero2_block, 0, sizeof(zero2_block));

/*Increasing index counter*/
input_block->v[6]++;

/*First iteration of G*/
fill_block(zero_block, input_block, address_block, 0);

/*Second iteration of G*/
fill_block(zero2_block, address_block, address_block, 0);
}

void fill_segment(const argon2_instance_t *instance,
argon2_position_t position) {
block *ref_block = NULL, *curr_block = NULL;
block address_block, input_block;
uint64_t pseudo_rand, ref_index, ref_lane;
uint32_t prev_offset, curr_offset;
uint32_t starting_index, i;
#if defined(__AVX512F__)
__m512i state[ARGON2_512BIT_WORDS_IN_BLOCK];
#elif defined(__AVX2__)
__m256i state[ARGON2_HWORDS_IN_BLOCK];
#else
__m128i state[ARGON2_OWORDS_IN_BLOCK];
#endif
int data_independent_addressing;

if (instance == NULL) {
return;
}

data_independent_addressing =
(instance->type == Argon2_i) ||
(instance->type == Argon2_id && (position.pass == 0) &&
(position.slice < ARGON2_SYNC_POINTS / 2));

if (data_independent_addressing) {
init_block_value(&input_block, 0);

input_block.v[0] = position.pass;
input_block.v[1] = position.lane;
input_block.v[2] = position.slice;
input_block.v[3] = instance->memory_blocks;
input_block.v[4] = instance->passes;
input_block.v[5] = instance->type;
}

starting_index = 0;

if ((0 == position.pass) && (0 == position.slice)) {
starting_index = 2; /* we have already generated the first two blocks */

/* Don't forget to generate the first block of addresses: */
if (data_independent_addressing) {
next_addresses(&address_block, &input_block);
}
}

/* Offset of the current block */
curr_offset = position.lane * instance->lane_length +
position.slice * instance->segment_length + starting_index;

if (0 == curr_offset % instance->lane_length) {
/* Last block in this lane */
prev_offset = curr_offset + instance->lane_length - 1;
} else {
/* Previous block */
prev_offset = curr_offset - 1;
}

memcpy(state, ((instance->memory + prev_offset)->v), ARGON2_BLOCK_SIZE);

for (i = starting_index; i < instance->segment_length;
++i, ++curr_offset, ++prev_offset) {
/*1.1 Rotating prev_offset if needed */
if (curr_offset % instance->lane_length == 1) {
prev_offset = curr_offset - 1;
}

/* 1.2 Computing the index of the reference block */
/* 1.2.1 Taking pseudo-random value from the previous block */
if (data_independent_addressing) {
if (i % ARGON2_ADDRESSES_IN_BLOCK == 0) {
next_addresses(&address_block, &input_block);
}
pseudo_rand = address_block.v[i % ARGON2_ADDRESSES_IN_BLOCK];
} else {
pseudo_rand = instance->memory[prev_offset].v[0];
}

/* 1.2.2 Computing the lane of the reference block */
ref_lane = ((pseudo_rand >> 32)) % instance->lanes;

if ((position.pass == 0) && (position.slice == 0)) {
/* Can not reference other lanes yet */
ref_lane = position.lane;
}

/* 1.2.3 Computing the number of possible reference block within the
* lane.
*/
position.index = i;
ref_index = index_alpha(instance, &position, pseudo_rand & 0xFFFFFFFF,
ref_lane == position.lane);

/* 2 Creating a new block */
ref_block =
instance->memory + instance->lane_length * ref_lane + ref_index;
curr_block = instance->memory + curr_offset;
if (ARGON2_VERSION_10 == instance->version) {
/* version 1.2.1 and earlier: overwrite, not XOR */
fill_block(state, ref_block, curr_block, 0);
} else {
if(0 == position.pass) {
fill_block(state, ref_block, curr_block, 0);
} else {
fill_block(state, ref_block, curr_block, 1);
}
}
}
}
194 changes: 194 additions & 0 deletions src/crypto/argon2/ref.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#include <stdint.h>
#include <string.h>
#include <stdlib.h>

#include "argon2.h"
#include "core.h"

#include "blake2/blamka-round-ref.h"
#include "blake2/blake2-impl.h"
#include "blake2/blake2.h"


/*
* Function fills a new memory block and optionally XORs the old block over the new one.
* @next_block must be initialized.
* @param prev_block Pointer to the previous block
* @param ref_block Pointer to the reference block
* @param next_block Pointer to the block to be constructed
* @param with_xor Whether to XOR into the new block (1) or just overwrite (0)
* @pre all block pointers must be valid
*/
static void fill_block(const block *prev_block, const block *ref_block,
block *next_block, int with_xor) {
block blockR, block_tmp;
unsigned i;

copy_block(&blockR, ref_block);
xor_block(&blockR, prev_block);
copy_block(&block_tmp, &blockR);
/* Now blockR = ref_block + prev_block and block_tmp = ref_block + prev_block */
if (with_xor) {
/* Saving the next block contents for XOR over: */
xor_block(&block_tmp, next_block);
/* Now blockR = ref_block + prev_block and
block_tmp = ref_block + prev_block + next_block */
}

/* Apply Blake2 on columns of 64-bit words: (0,1,...,15) , then
(16,17,..31)... finally (112,113,...127) */
for (i = 0; i < 8; ++i) {
BLAKE2_ROUND_NOMSG(
blockR.v[16 * i], blockR.v[16 * i + 1], blockR.v[16 * i + 2],
blockR.v[16 * i + 3], blockR.v[16 * i + 4], blockR.v[16 * i + 5],
blockR.v[16 * i + 6], blockR.v[16 * i + 7], blockR.v[16 * i + 8],
blockR.v[16 * i + 9], blockR.v[16 * i + 10], blockR.v[16 * i + 11],
blockR.v[16 * i + 12], blockR.v[16 * i + 13], blockR.v[16 * i + 14],
blockR.v[16 * i + 15]);
}

/* Apply Blake2 on rows of 64-bit words: (0,1,16,17,...112,113), then
(2,3,18,19,...,114,115).. finally (14,15,30,31,...,126,127) */
for (i = 0; i < 8; i++) {
BLAKE2_ROUND_NOMSG(
blockR.v[2 * i], blockR.v[2 * i + 1], blockR.v[2 * i + 16],
blockR.v[2 * i + 17], blockR.v[2 * i + 32], blockR.v[2 * i + 33],
blockR.v[2 * i + 48], blockR.v[2 * i + 49], blockR.v[2 * i + 64],
blockR.v[2 * i + 65], blockR.v[2 * i + 80], blockR.v[2 * i + 81],
blockR.v[2 * i + 96], blockR.v[2 * i + 97], blockR.v[2 * i + 112],
blockR.v[2 * i + 113]);
}

copy_block(next_block, &block_tmp);
xor_block(next_block, &blockR);
}

static void next_addresses(block *address_block, block *input_block,
const block *zero_block) {
input_block->v[6]++;
fill_block(zero_block, input_block, address_block, 0);
fill_block(zero_block, address_block, address_block, 0);
}

void fill_segment(const argon2_instance_t *instance,
argon2_position_t position) {
block *ref_block = NULL, *curr_block = NULL;
block address_block, input_block, zero_block;
uint64_t pseudo_rand, ref_index, ref_lane;
uint32_t prev_offset, curr_offset;
uint32_t starting_index;
uint32_t i;
int data_independent_addressing;

if (instance == NULL) {
return;
}

data_independent_addressing =
(instance->type == Argon2_i) ||
(instance->type == Argon2_id && (position.pass == 0) &&
(position.slice < ARGON2_SYNC_POINTS / 2));

if (data_independent_addressing) {
init_block_value(&zero_block, 0);
init_block_value(&input_block, 0);

input_block.v[0] = position.pass;
input_block.v[1] = position.lane;
input_block.v[2] = position.slice;
input_block.v[3] = instance->memory_blocks;
input_block.v[4] = instance->passes;
input_block.v[5] = instance->type;
}

starting_index = 0;

if ((0 == position.pass) && (0 == position.slice)) {
starting_index = 2; /* we have already generated the first two blocks */

/* Don't forget to generate the first block of addresses: */
if (data_independent_addressing) {
next_addresses(&address_block, &input_block, &zero_block);
}
}

/* Offset of the current block */
curr_offset = position.lane * instance->lane_length +
position.slice * instance->segment_length + starting_index;

if (0 == curr_offset % instance->lane_length) {
/* Last block in this lane */
prev_offset = curr_offset + instance->lane_length - 1;
} else {
/* Previous block */
prev_offset = curr_offset - 1;
}

for (i = starting_index; i < instance->segment_length;
++i, ++curr_offset, ++prev_offset) {
/*1.1 Rotating prev_offset if needed */
if (curr_offset % instance->lane_length == 1) {
prev_offset = curr_offset - 1;
}

/* 1.2 Computing the index of the reference block */
/* 1.2.1 Taking pseudo-random value from the previous block */
if (data_independent_addressing) {
if (i % ARGON2_ADDRESSES_IN_BLOCK == 0) {
next_addresses(&address_block, &input_block, &zero_block);
}
pseudo_rand = address_block.v[i % ARGON2_ADDRESSES_IN_BLOCK];
} else {
pseudo_rand = instance->memory[prev_offset].v[0];
}

/* 1.2.2 Computing the lane of the reference block */
ref_lane = ((pseudo_rand >> 32)) % instance->lanes;

if ((position.pass == 0) && (position.slice == 0)) {
/* Can not reference other lanes yet */
ref_lane = position.lane;
}

/* 1.2.3 Computing the number of possible reference block within the
* lane.
*/
position.index = i;
ref_index = index_alpha(instance, &position, pseudo_rand & 0xFFFFFFFF,
ref_lane == position.lane);

/* 2 Creating a new block */
ref_block =
instance->memory + instance->lane_length * ref_lane + ref_index;
curr_block = instance->memory + curr_offset;
if (ARGON2_VERSION_10 == instance->version) {
/* version 1.2.1 and earlier: overwrite, not XOR */
fill_block(instance->memory + prev_offset, ref_block, curr_block, 0);
} else {
if(0 == position.pass) {
fill_block(instance->memory + prev_offset, ref_block,
curr_block, 0);
} else {
fill_block(instance->memory + prev_offset, ref_block,
curr_block, 1);
}
}
}
}
337 changes: 337 additions & 0 deletions src/crypto/argon2/run.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,337 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#define _GNU_SOURCE 1

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "argon2.h"
#include "core.h"

#define T_COST_DEF 3
#define LOG_M_COST_DEF 12 /* 2^12 = 4 MiB */
#define LANES_DEF 1
#define THREADS_DEF 1
#define OUTLEN_DEF 32
#define MAX_PASS_LEN 128

#define UNUSED_PARAMETER(x) (void)(x)

static void usage(const char *cmd) {
printf("Usage: %s [-h] salt [-i|-d|-id] [-t iterations] "
"[-m log2(memory in KiB) | -k memory in KiB] [-p parallelism] "
"[-l hash length] [-e|-r] [-v (10|13)]\n",
cmd);
printf("\tPassword is read from stdin\n");
printf("Parameters:\n");
printf("\tsalt\t\tThe salt to use, at least 8 characters\n");
printf("\t-i\t\tUse Argon2i (this is the default)\n");
printf("\t-d\t\tUse Argon2d instead of Argon2i\n");
printf("\t-id\t\tUse Argon2id instead of Argon2i\n");
printf("\t-t N\t\tSets the number of iterations to N (default = %d)\n",
T_COST_DEF);
printf("\t-m N\t\tSets the memory usage of 2^N KiB (default %d)\n",
LOG_M_COST_DEF);
printf("\t-k N\t\tSets the memory usage of N KiB (default %d)\n",
1 << LOG_M_COST_DEF);
printf("\t-p N\t\tSets parallelism to N threads (default %d)\n",
THREADS_DEF);
printf("\t-l N\t\tSets hash output length to N bytes (default %d)\n",
OUTLEN_DEF);
printf("\t-e\t\tOutput only encoded hash\n");
printf("\t-r\t\tOutput only the raw bytes of the hash\n");
printf("\t-v (10|13)\tArgon2 version (defaults to the most recent version, currently %x)\n",
ARGON2_VERSION_NUMBER);
printf("\t-h\t\tPrint %s usage\n", cmd);
}

static void fatal(const char *error) {
fprintf(stderr, "Error: %s\n", error);
exit(1);
}

static void print_hex(uint8_t *bytes, size_t bytes_len) {
size_t i;
for (i = 0; i < bytes_len; ++i) {
printf("%02x", bytes[i]);
}
printf("\n");
}

/*
Runs Argon2 with certain inputs and parameters, inputs not cleared. Prints the
Base64-encoded hash string
@out output array with at least 32 bytes allocated
@pwd NULL-terminated string, presumably from argv[]
@salt salt array
@t_cost number of iterations
@m_cost amount of requested memory in KB
@lanes amount of requested parallelism
@threads actual parallelism
@type Argon2 type we want to run
@encoded_only display only the encoded hash
@raw_only display only the hexadecimal of the hash
@version Argon2 version
*/
static void run(uint32_t outlen, char *pwd, size_t pwdlen, char *salt, uint32_t t_cost,
uint32_t m_cost, uint32_t lanes, uint32_t threads,
argon2_type type, int encoded_only, int raw_only, uint32_t version) {
clock_t start_time, stop_time;
size_t saltlen, encodedlen;
int result;
unsigned char * out = NULL;
char * encoded = NULL;

start_time = clock();

if (!pwd) {
fatal("password missing");
}

if (!salt) {
clear_internal_memory(pwd, pwdlen);
fatal("salt missing");
}

saltlen = strlen(salt);
if(UINT32_MAX < saltlen) {
fatal("salt is too long");
}

UNUSED_PARAMETER(lanes);

out = malloc(outlen + 1);
if (!out) {
clear_internal_memory(pwd, pwdlen);
fatal("could not allocate memory for output");
}

encodedlen = argon2_encodedlen(t_cost, m_cost, lanes, (uint32_t)saltlen, outlen, type);
encoded = malloc(encodedlen + 1);
if (!encoded) {
clear_internal_memory(pwd, pwdlen);
fatal("could not allocate memory for hash");
}

result = argon2_hash(t_cost, m_cost, threads, pwd, pwdlen, salt, saltlen,
out, outlen, encoded, encodedlen, type,
version);
if (result != ARGON2_OK)
fatal(argon2_error_message(result));

stop_time = clock();

if (encoded_only)
puts(encoded);

if (raw_only)
print_hex(out, outlen);

if (encoded_only || raw_only) {
free(out);
free(encoded);
return;
}

printf("Hash:\t\t");
print_hex(out, outlen);
free(out);

printf("Encoded:\t%s\n", encoded);

printf("%2.3f seconds\n",
((double)stop_time - start_time) / (CLOCKS_PER_SEC));

result = argon2_verify(encoded, pwd, pwdlen, type);
if (result != ARGON2_OK)
fatal(argon2_error_message(result));
printf("Verification ok\n");
free(encoded);
}

int main(int argc, char *argv[]) {
uint32_t outlen = OUTLEN_DEF;
uint32_t m_cost = 1 << LOG_M_COST_DEF;
uint32_t t_cost = T_COST_DEF;
uint32_t lanes = LANES_DEF;
uint32_t threads = THREADS_DEF;
argon2_type type = Argon2_i; /* Argon2i is the default type */
int types_specified = 0;
int m_cost_specified = 0;
int encoded_only = 0;
int raw_only = 0;
uint32_t version = ARGON2_VERSION_NUMBER;
int i;
size_t pwdlen;
char pwd[MAX_PASS_LEN], *salt;

if (argc < 2) {
usage(argv[0]);
return ARGON2_MISSING_ARGS;
} else if (argc >= 2 && strcmp(argv[1], "-h") == 0) {
usage(argv[0]);
return 1;
}

/* get password from stdin */
pwdlen = fread(pwd, 1, sizeof pwd, stdin);
if(pwdlen < 1) {
fatal("no password read");
}
if(pwdlen == MAX_PASS_LEN) {
fatal("Provided password longer than supported in command line utility");
}

salt = argv[1];

/* parse options */
for (i = 2; i < argc; i++) {
const char *a = argv[i];
unsigned long input = 0;
if (!strcmp(a, "-h")) {
usage(argv[0]);
return 1;
} else if (!strcmp(a, "-m")) {
if (m_cost_specified) {
fatal("-m or -k can only be used once");
}
m_cost_specified = 1;
if (i < argc - 1) {
i++;
input = strtoul(argv[i], NULL, 10);
if (input == 0 || input == ULONG_MAX ||
input > ARGON2_MAX_MEMORY_BITS) {
fatal("bad numeric input for -m");
}
m_cost = ARGON2_MIN(UINT64_C(1) << input, UINT32_C(0xFFFFFFFF));
if (m_cost > ARGON2_MAX_MEMORY) {
fatal("m_cost overflow");
}
continue;
} else {
fatal("missing -m argument");
}
} else if (!strcmp(a, "-k")) {
if (m_cost_specified) {
fatal("-m or -k can only be used once");
}
m_cost_specified = 1;
if (i < argc - 1) {
i++;
input = strtoul(argv[i], NULL, 10);
if (input == 0 || input == ULONG_MAX) {
fatal("bad numeric input for -k");
}
m_cost = ARGON2_MIN(input, UINT32_C(0xFFFFFFFF));
if (m_cost > ARGON2_MAX_MEMORY) {
fatal("m_cost overflow");
}
continue;
} else {
fatal("missing -k argument");
}
} else if (!strcmp(a, "-t")) {
if (i < argc - 1) {
i++;
input = strtoul(argv[i], NULL, 10);
if (input == 0 || input == ULONG_MAX ||
input > ARGON2_MAX_TIME) {
fatal("bad numeric input for -t");
}
t_cost = input;
continue;
} else {
fatal("missing -t argument");
}
} else if (!strcmp(a, "-p")) {
if (i < argc - 1) {
i++;
input = strtoul(argv[i], NULL, 10);
if (input == 0 || input == ULONG_MAX ||
input > ARGON2_MAX_THREADS || input > ARGON2_MAX_LANES) {
fatal("bad numeric input for -p");
}
threads = input;
lanes = threads;
continue;
} else {
fatal("missing -p argument");
}
} else if (!strcmp(a, "-l")) {
if (i < argc - 1) {
i++;
input = strtoul(argv[i], NULL, 10);
outlen = input;
continue;
} else {
fatal("missing -l argument");
}
} else if (!strcmp(a, "-i")) {
type = Argon2_i;
++types_specified;
} else if (!strcmp(a, "-d")) {
type = Argon2_d;
++types_specified;
} else if (!strcmp(a, "-id")) {
type = Argon2_id;
++types_specified;
} else if (!strcmp(a, "-e")) {
encoded_only = 1;
} else if (!strcmp(a, "-r")) {
raw_only = 1;
} else if (!strcmp(a, "-v")) {
if (i < argc - 1) {
i++;
if (!strcmp(argv[i], "10")) {
version = ARGON2_VERSION_10;
} else if (!strcmp(argv[i], "13")) {
version = ARGON2_VERSION_13;
} else {
fatal("invalid Argon2 version");
}
} else {
fatal("missing -v argument");
}
} else {
fatal("unknown argument");
}
}

if (types_specified > 1) {
fatal("cannot specify multiple Argon2 types");
}

if(encoded_only && raw_only)
fatal("cannot provide both -e and -r");

if(!encoded_only && !raw_only) {
printf("Type:\t\t%s\n", argon2_type2string(type, 1));
printf("Iterations:\t%u\n", t_cost);
printf("Memory:\t\t%u KiB\n", m_cost);
printf("Parallelism:\t%u\n", lanes);
}

run(outlen, pwd, pwdlen, salt, t_cost, m_cost, lanes, threads, type,
encoded_only, raw_only, version);

return ARGON2_OK;
}

289 changes: 289 additions & 0 deletions src/crypto/argon2/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <assert.h>

#include "argon2.h"

#define OUT_LEN 32
#define ENCODED_LEN 108

/* Test harness will assert:
* argon2_hash() returns ARGON2_OK
* HEX output matches expected
* encoded output matches expected
* argon2_verify() correctly verifies value
*/

void hashtest(uint32_t version, uint32_t t, uint32_t m, uint32_t p, char *pwd,
char *salt, char *hexref, char *mcfref, argon2_type type) {
unsigned char out[OUT_LEN];
unsigned char hex_out[OUT_LEN * 2 + 4];
char encoded[ENCODED_LEN];
int ret, i;

printf("Hash test: $v=%d t=%d, m=%d, p=%d, pass=%s, salt=%s: ", version,
t, m, p, pwd, salt);

ret = argon2_hash(t, 1 << m, p, pwd, strlen(pwd), salt, strlen(salt), out,
OUT_LEN, encoded, ENCODED_LEN, type, version);
assert(ret == ARGON2_OK);

for (i = 0; i < OUT_LEN; ++i)
sprintf((char *)(hex_out + i * 2), "%02x", out[i]);
assert(memcmp(hex_out, hexref, OUT_LEN * 2) == 0);

if (ARGON2_VERSION_NUMBER == version) {
assert(memcmp(encoded, mcfref, strlen(mcfref)) == 0);
}

ret = argon2_verify(encoded, pwd, strlen(pwd), type);
assert(ret == ARGON2_OK);
ret = argon2_verify(mcfref, pwd, strlen(pwd), type);
assert(ret == ARGON2_OK);

printf("PASS\n");
}

int main() {
int ret;
unsigned char out[OUT_LEN];
char const *msg;
int version;

version = ARGON2_VERSION_10;
printf("Test Argon2i version number: %02x\n", version);

/* Multiple test cases for various input values */
hashtest(version, 2, 16, 1, "password", "somesalt",
"f6c4db4a54e2a370627aff3db6176b94a2a209a62c8e36152711802f7b30c694",
"$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ", Argon2_i);
#ifdef TEST_LARGE_RAM
hashtest(version, 2, 20, 1, "password", "somesalt",
"9690ec55d28d3ed32562f2e73ea62b02b018757643a2ae6e79528459de8106e9",
"$argon2i$m=1048576,t=2,p=1$c29tZXNhbHQ"
"$lpDsVdKNPtMlYvLnPqYrArAYdXZDoq5ueVKEWd6BBuk", Argon2_i);
#endif
hashtest(version, 2, 18, 1, "password", "somesalt",
"3e689aaa3d28a77cf2bc72a51ac53166761751182f1ee292e3f677a7da4c2467",
"$argon2i$m=262144,t=2,p=1$c29tZXNhbHQ"
"$Pmiaqj0op3zyvHKlGsUxZnYXURgvHuKS4/Z3p9pMJGc", Argon2_i);
hashtest(version, 2, 8, 1, "password", "somesalt",
"fd4dd83d762c49bdeaf57c47bdcd0c2f1babf863fdeb490df63ede9975fccf06",
"$argon2i$m=256,t=2,p=1$c29tZXNhbHQ"
"$/U3YPXYsSb3q9XxHvc0MLxur+GP960kN9j7emXX8zwY", Argon2_i);
hashtest(version, 2, 8, 2, "password", "somesalt",
"b6c11560a6a9d61eac706b79a2f97d68b4463aa3ad87e00c07e2b01e90c564fb",
"$argon2i$m=256,t=2,p=2$c29tZXNhbHQ"
"$tsEVYKap1h6scGt5ovl9aLRGOqOth+AMB+KwHpDFZPs", Argon2_i);
hashtest(version, 1, 16, 1, "password", "somesalt",
"81630552b8f3b1f48cdb1992c4c678643d490b2b5eb4ff6c4b3438b5621724b2",
"$argon2i$m=65536,t=1,p=1$c29tZXNhbHQ"
"$gWMFUrjzsfSM2xmSxMZ4ZD1JCytetP9sSzQ4tWIXJLI", Argon2_i);
hashtest(version, 4, 16, 1, "password", "somesalt",
"f212f01615e6eb5d74734dc3ef40ade2d51d052468d8c69440a3a1f2c1c2847b",
"$argon2i$m=65536,t=4,p=1$c29tZXNhbHQ"
"$8hLwFhXm6110c03D70Ct4tUdBSRo2MaUQKOh8sHChHs", Argon2_i);
hashtest(version, 2, 16, 1, "differentpassword", "somesalt",
"e9c902074b6754531a3a0be519e5baf404b30ce69b3f01ac3bf21229960109a3",
"$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
"$6ckCB0tnVFMaOgvlGeW69ASzDOabPwGsO/ISKZYBCaM", Argon2_i);
hashtest(version, 2, 16, 1, "password", "diffsalt",
"79a103b90fe8aef8570cb31fc8b22259778916f8336b7bdac3892569d4f1c497",
"$argon2i$m=65536,t=2,p=1$ZGlmZnNhbHQ"
"$eaEDuQ/orvhXDLMfyLIiWXeJFvgza3vaw4kladTxxJc", Argon2_i);

/* Error state tests */

/* Handle an invalid encoding correctly (it is missing a $) */
ret = argon2_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_DECODING_FAIL);
printf("Recognise an invalid encoding: PASS\n");

/* Handle an invalid encoding correctly (it is missing a $) */
ret = argon2_verify("$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
"9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_DECODING_FAIL);
printf("Recognise an invalid encoding: PASS\n");

/* Handle an invalid encoding correctly (salt is too short) */
ret = argon2_verify("$argon2i$m=65536,t=2,p=1$"
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_SALT_TOO_SHORT);
printf("Recognise an invalid salt in encoding: PASS\n");

/* Handle an mismatching hash (the encoded password is "passwore") */
ret = argon2_verify("$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
"$b2G3seW+uPzerwQQC+/E1K50CLLO7YXy0JRcaTuswRo",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_VERIFY_MISMATCH);
printf("Verify with mismatched password: PASS\n");

msg = argon2_error_message(ARGON2_DECODING_FAIL);
assert(strcmp(msg, "Decoding failed") == 0);
printf("Decode an error message: PASS\n");

printf("\n");

version = ARGON2_VERSION_NUMBER;
printf("Test Argon2i version number: %02x\n", version);

/* Multiple test cases for various input values */
hashtest(version, 2, 16, 1, "password", "somesalt",
"c1628832147d9720c5bd1cfd61367078729f6dfb6f8fea9ff98158e0d7816ed0",
"$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ"
"$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA", Argon2_i);
#ifdef TEST_LARGE_RAM
hashtest(version, 2, 20, 1, "password", "somesalt",
"d1587aca0922c3b5d6a83edab31bee3c4ebaef342ed6127a55d19b2351ad1f41",
"$argon2i$v=19$m=1048576,t=2,p=1$c29tZXNhbHQ"
"$0Vh6ygkiw7XWqD7asxvuPE667zQu1hJ6VdGbI1GtH0E", Argon2_i);
#endif
hashtest(version, 2, 18, 1, "password", "somesalt",
"296dbae80b807cdceaad44ae741b506f14db0959267b183b118f9b24229bc7cb",
"$argon2i$v=19$m=262144,t=2,p=1$c29tZXNhbHQ"
"$KW266AuAfNzqrUSudBtQbxTbCVkmexg7EY+bJCKbx8s", Argon2_i);
hashtest(version, 2, 8, 1, "password", "somesalt",
"89e9029f4637b295beb027056a7336c414fadd43f6b208645281cb214a56452f",
"$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ"
"$iekCn0Y3spW+sCcFanM2xBT63UP2sghkUoHLIUpWRS8", Argon2_i);
hashtest(version, 2, 8, 2, "password", "somesalt",
"4ff5ce2769a1d7f4c8a491df09d41a9fbe90e5eb02155a13e4c01e20cd4eab61",
"$argon2i$v=19$m=256,t=2,p=2$c29tZXNhbHQ"
"$T/XOJ2mh1/TIpJHfCdQan76Q5esCFVoT5MAeIM1Oq2E", Argon2_i);
hashtest(version, 1, 16, 1, "password", "somesalt",
"d168075c4d985e13ebeae560cf8b94c3b5d8a16c51916b6f4ac2da3ac11bbecf",
"$argon2i$v=19$m=65536,t=1,p=1$c29tZXNhbHQ"
"$0WgHXE2YXhPr6uVgz4uUw7XYoWxRkWtvSsLaOsEbvs8", Argon2_i);
hashtest(version, 4, 16, 1, "password", "somesalt",
"aaa953d58af3706ce3df1aefd4a64a84e31d7f54175231f1285259f88174ce5b",
"$argon2i$v=19$m=65536,t=4,p=1$c29tZXNhbHQ"
"$qqlT1YrzcGzj3xrv1KZKhOMdf1QXUjHxKFJZ+IF0zls", Argon2_i);
hashtest(version, 2, 16, 1, "differentpassword", "somesalt",
"14ae8da01afea8700c2358dcef7c5358d9021282bd88663a4562f59fb74d22ee",
"$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ"
"$FK6NoBr+qHAMI1jc73xTWNkCEoK9iGY6RWL1n7dNIu4", Argon2_i);
hashtest(version, 2, 16, 1, "password", "diffsalt",
"b0357cccfbef91f3860b0dba447b2348cbefecadaf990abfe9cc40726c521271",
"$argon2i$v=19$m=65536,t=2,p=1$ZGlmZnNhbHQ"
"$sDV8zPvvkfOGCw26RHsjSMvv7K2vmQq/6cxAcmxSEnE", Argon2_i);


/* Error state tests */

/* Handle an invalid encoding correctly (it is missing a $) */
ret = argon2_verify("$argon2i$v=19$m=65536,t=2,p=1c29tZXNhbHQ"
"$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_DECODING_FAIL);
printf("Recognise an invalid encoding: PASS\n");

/* Handle an invalid encoding correctly (it is missing a $) */
ret = argon2_verify("$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ"
"wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_DECODING_FAIL);
printf("Recognise an invalid encoding: PASS\n");

/* Handle an invalid encoding correctly (salt is too short) */
ret = argon2_verify("$argon2i$v=19$m=65536,t=2,p=1$"
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_SALT_TOO_SHORT);
printf("Recognise an invalid salt in encoding: PASS\n");

/* Handle an mismatching hash (the encoded password is "passwore") */
ret = argon2_verify("$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ"
"$8iIuixkI73Js3G1uMbezQXD0b8LG4SXGsOwoQkdAQIM",
"password", strlen("password"), Argon2_i);
assert(ret == ARGON2_VERIFY_MISMATCH);
printf("Verify with mismatched password: PASS\n");

msg = argon2_error_message(ARGON2_DECODING_FAIL);
assert(strcmp(msg, "Decoding failed") == 0);
printf("Decode an error message: PASS\n\n");

printf("Test Argon2id version number: %02x\n", version);

/* Multiple test cases for various input values */
hashtest(version, 2, 16, 1, "password", "somesalt",
"09316115d5cf24ed5a15a31a3ba326e5cf32edc24702987c02b6566f61913cf7",
"$argon2id$v=19$m=65536,t=2,p=1$c29tZXNhbHQ"
"$CTFhFdXPJO1aFaMaO6Mm5c8y7cJHAph8ArZWb2GRPPc", Argon2_id);
hashtest(version, 2, 18, 1, "password", "somesalt",
"78fe1ec91fb3aa5657d72e710854e4c3d9b9198c742f9616c2f085bed95b2e8c",
"$argon2id$v=19$m=262144,t=2,p=1$c29tZXNhbHQ"
"$eP4eyR+zqlZX1y5xCFTkw9m5GYx0L5YWwvCFvtlbLow", Argon2_id);
hashtest(version, 2, 8, 1, "password", "somesalt",
"9dfeb910e80bad0311fee20f9c0e2b12c17987b4cac90c2ef54d5b3021c68bfe",
"$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ"
"$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4", Argon2_id);
hashtest(version, 2, 8, 2, "password", "somesalt",
"6d093c501fd5999645e0ea3bf620d7b8be7fd2db59c20d9fff9539da2bf57037",
"$argon2id$v=19$m=256,t=2,p=2$c29tZXNhbHQ"
"$bQk8UB/VmZZF4Oo79iDXuL5/0ttZwg2f/5U52iv1cDc", Argon2_id);
hashtest(version, 1, 16, 1, "password", "somesalt",
"f6a5adc1ba723dddef9b5ac1d464e180fcd9dffc9d1cbf76cca2fed795d9ca98",
"$argon2id$v=19$m=65536,t=1,p=1$c29tZXNhbHQ"
"$9qWtwbpyPd3vm1rB1GThgPzZ3/ydHL92zKL+15XZypg", Argon2_id);
hashtest(version, 4, 16, 1, "password", "somesalt",
"9025d48e68ef7395cca9079da4c4ec3affb3c8911fe4f86d1a2520856f63172c",
"$argon2id$v=19$m=65536,t=4,p=1$c29tZXNhbHQ"
"$kCXUjmjvc5XMqQedpMTsOv+zyJEf5PhtGiUghW9jFyw", Argon2_id);
hashtest(version, 2, 16, 1, "differentpassword", "somesalt",
"0b84d652cf6b0c4beaef0dfe278ba6a80df6696281d7e0d2891b817d8c458fde",
"$argon2id$v=19$m=65536,t=2,p=1$c29tZXNhbHQ"
"$C4TWUs9rDEvq7w3+J4umqA32aWKB1+DSiRuBfYxFj94", Argon2_id);
hashtest(version, 2, 16, 1, "password", "diffsalt",
"bdf32b05ccc42eb15d58fd19b1f856b113da1e9a5874fdcc544308565aa8141c",
"$argon2id$v=19$m=65536,t=2,p=1$ZGlmZnNhbHQ"
"$vfMrBczELrFdWP0ZsfhWsRPaHppYdP3MVEMIVlqoFBw", Argon2_id);

/* Common error state tests */

printf("\n");
printf("Common error state tests\n");

ret = argon2_hash(2, 1, 1, "password", strlen("password"),
"diffsalt", strlen("diffsalt"),
out, OUT_LEN, NULL, 0, Argon2_id, version);
assert(ret == ARGON2_MEMORY_TOO_LITTLE);
printf("Fail on invalid memory: PASS\n");

ret = argon2_hash(2, 1 << 12, 1, NULL, strlen("password"),
"diffsalt", strlen("diffsalt"),
out, OUT_LEN, NULL, 0, Argon2_id, version);
assert(ret == ARGON2_PWD_PTR_MISMATCH);
printf("Fail on invalid null pointer: PASS\n");

ret = argon2_hash(2, 1 << 12, 1, "password", strlen("password"), "s", 1,
out, OUT_LEN, NULL, 0, Argon2_id, version);
assert(ret == ARGON2_SALT_TOO_SHORT);
printf("Fail on salt too short: PASS\n");

return 0;
}
57 changes: 57 additions & 0 deletions src/crypto/argon2/thread.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#if !defined(ARGON2_NO_THREADS)

#include "thread.h"
#if defined(_WIN32)
#include <windows.h>
#endif

int argon2_thread_create(argon2_thread_handle_t *handle,
argon2_thread_func_t func, void *args) {
if (NULL == handle || func == NULL) {
return -1;
}
#if defined(_WIN32)
*handle = _beginthreadex(NULL, 0, func, args, 0, NULL);
return *handle != 0 ? 0 : -1;
#else
return pthread_create(handle, NULL, func, args);
#endif
}

int argon2_thread_join(argon2_thread_handle_t handle) {
#if defined(_WIN32)
if (WaitForSingleObject((HANDLE)handle, INFINITE) == WAIT_OBJECT_0) {
return CloseHandle((HANDLE)handle) != 0 ? 0 : -1;
}
return -1;
#else
return pthread_join(handle, NULL);
#endif
}

void argon2_thread_exit(void) {
#if defined(_WIN32)
_endthreadex(0);
#else
pthread_exit(NULL);
#endif
}

#endif /* ARGON2_NO_THREADS */
67 changes: 67 additions & 0 deletions src/crypto/argon2/thread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Argon2 reference source code package - reference C implementations
*
* Copyright 2015
* Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
*
* You may use this work under the terms of a Creative Commons CC0 1.0
* License/Waiver or the Apache Public License 2.0, at your option. The terms of
* these licenses can be found at:
*
* - CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
* - Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of both of these licenses along with this
* software. If not, they may be obtained at the above URLs.
*/

#ifndef ARGON2_THREAD_H
#define ARGON2_THREAD_H

#if !defined(ARGON2_NO_THREADS)

/*
Here we implement an abstraction layer for the simpĺe requirements
of the Argon2 code. We only require 3 primitives---thread creation,
joining, and termination---so full emulation of the pthreads API
is unwarranted. Currently we wrap pthreads and Win32 threads.
The API defines 2 types: the function pointer type,
argon2_thread_func_t,
and the type of the thread handle---argon2_thread_handle_t.
*/
#if defined(_WIN32)
#include <process.h>
typedef unsigned(__stdcall *argon2_thread_func_t)(void *);
typedef uintptr_t argon2_thread_handle_t;
#else
#include <pthread.h>
typedef void *(*argon2_thread_func_t)(void *);
typedef pthread_t argon2_thread_handle_t;
#endif

/* Creates a thread
* @param handle pointer to a thread handle, which is the output of this
* function. Must not be NULL.
* @param func A function pointer for the thread's entry point. Must not be
* NULL.
* @param args Pointer that is passed as an argument to @func. May be NULL.
* @return 0 if @handle and @func are valid pointers and a thread is successfully
* created.
*/
int argon2_thread_create(argon2_thread_handle_t *handle,
argon2_thread_func_t func, void *args);

/* Waits for a thread to terminate
* @param handle Handle to a thread created with argon2_thread_create.
* @return 0 if @handle is a valid handle, and joining completed successfully.
*/
int argon2_thread_join(argon2_thread_handle_t handle);

/* Terminate the current thread. Must be run inside a thread created by
* argon2_thread_create.
*/
void argon2_thread_exit(void);

#endif /* ARGON2_NO_THREADS */
#endif
231 changes: 231 additions & 0 deletions src/crypto/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj
69 changes: 69 additions & 0 deletions src/crypto/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters
231 changes: 231 additions & 0 deletions src/crypto/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj
230 changes: 230 additions & 0 deletions src/crypto/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj
66 changes: 66 additions & 0 deletions src/crypto/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters
244 changes: 244 additions & 0 deletions src/crypto/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj
235 changes: 235 additions & 0 deletions src/crypto/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj
243 changes: 243 additions & 0 deletions src/crypto/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj
69 changes: 69 additions & 0 deletions src/crypto/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters
231 changes: 231 additions & 0 deletions src/crypto/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj
230 changes: 230 additions & 0 deletions src/crypto/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj
66 changes: 66 additions & 0 deletions src/crypto/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters
232 changes: 232 additions & 0 deletions src/crypto/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj
231 changes: 231 additions & 0 deletions src/crypto/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj
51 changes: 51 additions & 0 deletions src/crypto/rinhash.cpp
12 changes: 12 additions & 0 deletions src/crypto/rinhash.h
8 changes: 4 additions & 4 deletions src/init.cpp
2 changes: 1 addition & 1 deletion src/policy/feerate.h
58 changes: 58 additions & 0 deletions src/pow.cpp
8 changes: 3 additions & 5 deletions src/primitives/block.cpp
12 changes: 6 additions & 6 deletions src/qt/README.md
4 changes: 2 additions & 2 deletions src/qt/askpassphrasedialog.cpp
2 changes: 1 addition & 1 deletion src/qt/bitcoin.cpp
18 changes: 9 additions & 9 deletions src/qt/bitcoingui.cpp
12 changes: 6 additions & 6 deletions src/qt/bitcoinunits.cpp
2 changes: 1 addition & 1 deletion src/qt/editaddressdialog.cpp
10 changes: 5 additions & 5 deletions src/qt/forms/addressbookpage.ui
10 changes: 5 additions & 5 deletions src/qt/forms/debugwindow.ui
4 changes: 2 additions & 2 deletions src/qt/forms/helpmessagedialog.ui
4 changes: 2 additions & 2 deletions src/qt/forms/modaloverlay.ui
4 changes: 2 additions & 2 deletions src/qt/forms/openuridialog.ui
6 changes: 3 additions & 3 deletions src/qt/forms/optionsdialog.ui
8 changes: 4 additions & 4 deletions src/qt/forms/overviewpage.ui
12 changes: 6 additions & 6 deletions src/qt/forms/receivecoinsdialog.ui
2 changes: 1 addition & 1 deletion src/qt/forms/receiverequestdialog.ui
24 changes: 12 additions & 12 deletions src/qt/forms/sendcoinsdialog.ui
18 changes: 9 additions & 9 deletions src/qt/forms/sendcoinsentry.ui
28 changes: 14 additions & 14 deletions src/qt/forms/signverifymessagedialog.ui
10 changes: 5 additions & 5 deletions src/qt/guiconstants.h
20 changes: 10 additions & 10 deletions src/qt/guiutil.cpp
4 changes: 2 additions & 2 deletions src/qt/intro.cpp
2 changes: 1 addition & 1 deletion src/qt/macnotificationhandler.mm
2 changes: 1 addition & 1 deletion src/qt/networkstyle.cpp
12 changes: 6 additions & 6 deletions src/qt/paymentserver.cpp
Binary file modified src/qt/res/icons/bitcoin.ico
Binary file not shown.
Binary file removed src/qt/res/icons/bitcoin.png
Binary file not shown.
Binary file modified src/qt/res/icons/bitcoin_testnet.ico
Binary file not shown.
Binary file modified src/qt/res/icons/connect0.png

Unable to render rich display

Invalid image source.

Binary file modified src/qt/res/icons/connect1.png

Unable to render rich display

Invalid image source.

Binary file modified src/qt/res/icons/connect2.png

Unable to render rich display

Invalid image source.

Binary file modified src/qt/res/icons/connect3.png

Unable to render rich display

Invalid image source.

Binary file modified src/qt/res/icons/connect4.png

Unable to render rich display

Invalid image source.

Binary file removed src/qt/res/icons/litecoin_splash.png
Binary file not shown.
Binary file added src/qt/res/icons/rincoin.png

Unable to render rich display

Invalid image source.

Binary file added src/qt/res/icons/rincoin_splash.png

Unable to render rich display

Invalid image source.

8 changes: 4 additions & 4 deletions src/qt/res/bitcoin-qt-res.rc → src/qt/res/rincoin-qt-res.rc
6 changes: 3 additions & 3 deletions src/qt/bitcoin.qrc → src/qt/rincoin.qrc
10 changes: 5 additions & 5 deletions src/qt/sendcoinsdialog.cpp
2 changes: 1 addition & 1 deletion src/qt/utilitydialog.cpp
4 changes: 2 additions & 2 deletions src/rpc/blockchain.cpp
8 changes: 4 additions & 4 deletions src/rpc/mining.cpp
10 changes: 5 additions & 5 deletions src/rpc/misc.cpp
2 changes: 1 addition & 1 deletion src/rpc/net.cpp
16 changes: 8 additions & 8 deletions src/rpc/rawtransaction.cpp
2 changes: 1 addition & 1 deletion src/rpc/rawtransaction_util.cpp
2 changes: 1 addition & 1 deletion src/rpc/util.cpp
2 changes: 1 addition & 1 deletion src/test/pow_tests.cpp
2 changes: 1 addition & 1 deletion src/util/message.cpp
10 changes: 5 additions & 5 deletions src/util/system.cpp
2 changes: 1 addition & 1 deletion src/validation.cpp
14 changes: 7 additions & 7 deletions src/wallet/rpcdump.cpp
80 changes: 40 additions & 40 deletions src/wallet/rpcwallet.cpp
2 changes: 1 addition & 1 deletion src/wallet/test/wallet_tests.cpp
4 changes: 2 additions & 2 deletions src/wallet/txlist.cpp