@leocuvee/wrkzcoin-multi-hashing 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.travis.yml +5 -0
  2. package/LICENSE +674 -0
  3. package/README.md +87 -0
  4. package/appveyor.yml +12 -0
  5. package/argon2/.gitattributes +10 -0
  6. package/argon2/.travis.yml +25 -0
  7. package/argon2/Argon2.sln +160 -0
  8. package/argon2/CHANGELOG.md +32 -0
  9. package/argon2/CMakeLists.txt +87 -0
  10. package/argon2/LICENSE +314 -0
  11. package/argon2/Makefile +196 -0
  12. package/argon2/README.md +297 -0
  13. package/argon2/appveyor.yml +40 -0
  14. package/argon2/argon2-specs.pdf +0 -0
  15. package/argon2/export.sh +7 -0
  16. package/argon2/include/argon2.h +427 -0
  17. package/argon2/latex/CMakeLists.txt +34 -0
  18. package/argon2/latex/IEEEtran.cls +6347 -0
  19. package/argon2/latex/Makefile +18 -0
  20. package/argon2/latex/argon2-specs.tex +920 -0
  21. package/argon2/latex/pics/argon2-par.pdf +0 -0
  22. package/argon2/latex/pics/compression.pdf +0 -0
  23. package/argon2/latex/pics/generic.pdf +0 -0
  24. package/argon2/latex/pics/power-distribution.jpg +0 -0
  25. package/argon2/latex/tradeoff.bib +822 -0
  26. package/argon2/libargon2.pc +16 -0
  27. package/argon2/man/CMakeLists.txt +8 -0
  28. package/argon2/man/argon2.1 +57 -0
  29. package/argon2/meson.build +16 -0
  30. package/argon2/meson_options.txt +1 -0
  31. package/argon2/src/CMakeLists.txt +147 -0
  32. package/argon2/src/argon2.c +452 -0
  33. package/argon2/src/argon2.pc.in +11 -0
  34. package/argon2/src/blake2/blake2-impl.h +156 -0
  35. package/argon2/src/blake2/blake2.h +89 -0
  36. package/argon2/src/blake2/blake2b.c +390 -0
  37. package/argon2/src/blake2/blamka-round-opt.h +471 -0
  38. package/argon2/src/blake2/blamka-round-ref.h +56 -0
  39. package/argon2/src/core.c +634 -0
  40. package/argon2/src/core.h +228 -0
  41. package/argon2/src/encoding.c +467 -0
  42. package/argon2/src/encoding.h +57 -0
  43. package/argon2/src/genkat.h +51 -0
  44. package/argon2/src/meson.build +68 -0
  45. package/argon2/src/opt.c +283 -0
  46. package/argon2/src/optimization/CMakeLists.txt +10 -0
  47. package/argon2/src/ref.c +194 -0
  48. package/argon2/src/thread.c +57 -0
  49. package/argon2/src/thread.h +67 -0
  50. package/argon2/tests/CMakeLists.txt +43 -0
  51. package/argon2/tests/bench.c +111 -0
  52. package/argon2/tests/genkat.c +207 -0
  53. package/argon2/tests/kats/argon2d +12304 -0
  54. package/argon2/tests/kats/argon2d.shasum +1 -0
  55. package/argon2/tests/kats/argon2d_v16 +12304 -0
  56. package/argon2/tests/kats/argon2d_v16.shasum +1 -0
  57. package/argon2/tests/kats/argon2i +12304 -0
  58. package/argon2/tests/kats/argon2i.shasum +1 -0
  59. package/argon2/tests/kats/argon2i_v16 +12304 -0
  60. package/argon2/tests/kats/argon2i_v16.shasum +1 -0
  61. package/argon2/tests/kats/argon2id +12304 -0
  62. package/argon2/tests/kats/argon2id.shasum +1 -0
  63. package/argon2/tests/kats/argon2id_v16 +12304 -0
  64. package/argon2/tests/kats/argon2id_v16.shasum +1 -0
  65. package/argon2/tests/kats/check-sums.ps1 +48 -0
  66. package/argon2/tests/kats/check-sums.sh +16 -0
  67. package/argon2/tests/kats/test.ps1 +132 -0
  68. package/argon2/tests/kats/test.sh +117 -0
  69. package/argon2/tests/meson.build +34 -0
  70. package/argon2/tests/test.c +289 -0
  71. package/argon2/tool/CMakeLists.txt +7 -0
  72. package/argon2/tool/main.c +339 -0
  73. package/argon2/tool/meson.build +8 -0
  74. package/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +226 -0
  75. package/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +69 -0
  76. package/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +226 -0
  77. package/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +69 -0
  78. package/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +225 -0
  79. package/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +66 -0
  80. package/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +239 -0
  81. package/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +72 -0
  82. package/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +227 -0
  83. package/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +69 -0
  84. package/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +226 -0
  85. package/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +69 -0
  86. package/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +226 -0
  87. package/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +69 -0
  88. package/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +225 -0
  89. package/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +66 -0
  90. package/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +227 -0
  91. package/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +72 -0
  92. package/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +226 -0
  93. package/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +69 -0
  94. package/bcrypt.c +566 -0
  95. package/bcrypt.h +14 -0
  96. package/binding.gyp +93 -0
  97. package/blake.c +17 -0
  98. package/blake.h +16 -0
  99. package/boolberry.cc +11 -0
  100. package/boolberry.h +6 -0
  101. package/build/Makefile +354 -0
  102. package/build/Release/.deps/Release/multihashing.node.d +1 -0
  103. package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/argon2.o.d +8 -0
  104. package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/blake2/blake2b.o.d +8 -0
  105. package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/core.o.d +10 -0
  106. package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/encoding.o.d +8 -0
  107. package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/ref.o.d +14 -0
  108. package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/thread.o.d +5 -0
  109. package/build/Release/.deps/Release/obj.target/multihashing/bcrypt.o.d +4 -0
  110. package/build/Release/.deps/Release/obj.target/multihashing/blake.o.d +7 -0
  111. package/build/Release/.deps/Release/obj.target/multihashing/boolberry.o.d +12 -0
  112. package/build/Release/.deps/Release/obj.target/multihashing/c11.o.d +20 -0
  113. package/build/Release/.deps/Release/obj.target/multihashing/crypto/aesb.o.d +3 -0
  114. package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_blake256.o.d +5 -0
  115. package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_groestl.o.d +10 -0
  116. package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_jh.o.d +9 -0
  117. package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_keccak.o.d +7 -0
  118. package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_skein.o.d +10 -0
  119. package/build/Release/.deps/Release/obj.target/multihashing/crypto/hash.o.d +7 -0
  120. package/build/Release/.deps/Release/obj.target/multihashing/crypto/oaes_lib.o.d +6 -0
  121. package/build/Release/.deps/Release/obj.target/multihashing/crypto/wild_keccak.o.d +8 -0
  122. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight.o.d +18 -0
  123. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_dark.o.d +18 -0
  124. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_dark_lite.o.d +18 -0
  125. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_fast.o.d +18 -0
  126. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_lite.o.d +18 -0
  127. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_soft_shell.o.d +18 -0
  128. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_turtle.o.d +18 -0
  129. package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_turtle_lite.o.d +18 -0
  130. package/build/Release/.deps/Release/obj.target/multihashing/fresh.o.d +10 -0
  131. package/build/Release/.deps/Release/obj.target/multihashing/fugue.o.d +7 -0
  132. package/build/Release/.deps/Release/obj.target/multihashing/groestl.o.d +8 -0
  133. package/build/Release/.deps/Release/obj.target/multihashing/hefty1.o.d +12 -0
  134. package/build/Release/.deps/Release/obj.target/multihashing/keccak.o.d +8 -0
  135. package/build/Release/.deps/Release/obj.target/multihashing/multihashing.o.d +155 -0
  136. package/build/Release/.deps/Release/obj.target/multihashing/nist5.o.d +12 -0
  137. package/build/Release/.deps/Release/obj.target/multihashing/quark.o.d +14 -0
  138. package/build/Release/.deps/Release/obj.target/multihashing/qubit.o.d +12 -0
  139. package/build/Release/.deps/Release/obj.target/multihashing/scryptjane.o.d +30 -0
  140. package/build/Release/.deps/Release/obj.target/multihashing/scryptn.o.d +6 -0
  141. package/build/Release/.deps/Release/obj.target/multihashing/sha1.o.d +24 -0
  142. package/build/Release/.deps/Release/obj.target/multihashing/sha3/aes_helper.o.d +5 -0
  143. package/build/Release/.deps/Release/obj.target/multihashing/sha3/hamsi.o.d +7 -0
  144. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_blake.o.d +6 -0
  145. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_bmw.o.d +6 -0
  146. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_cubehash.o.d +6 -0
  147. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_echo.o.d +7 -0
  148. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_fugue.o.d +6 -0
  149. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_groestl.o.d +6 -0
  150. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_hefty1.o.d +5 -0
  151. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_jh.o.d +6 -0
  152. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_keccak.o.d +6 -0
  153. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_luffa.o.d +6 -0
  154. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_shabal.o.d +6 -0
  155. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_shavite.o.d +7 -0
  156. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_simd.o.d +6 -0
  157. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_skein.o.d +6 -0
  158. package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_whirlpool.o.d +8 -0
  159. package/build/Release/.deps/Release/obj.target/multihashing/shavite3.o.d +7 -0
  160. package/build/Release/.deps/Release/obj.target/multihashing/skein.o.d +8 -0
  161. package/build/Release/.deps/Release/obj.target/multihashing/x11.o.d +20 -0
  162. package/build/Release/.deps/Release/obj.target/multihashing/x13.o.d +23 -0
  163. package/build/Release/.deps/Release/obj.target/multihashing/x15.o.d +26 -0
  164. package/build/Release/.deps/Release/obj.target/multihashing.node.d +1 -0
  165. package/build/Release/multihashing.node +0 -0
  166. package/build/binding.Makefile +6 -0
  167. package/build/multihashing.target.mk +255 -0
  168. package/c11.c +85 -0
  169. package/c11.h +17 -0
  170. package/crypto/aesb.c +177 -0
  171. package/crypto/c_blake256.c +326 -0
  172. package/crypto/c_blake256.h +43 -0
  173. package/crypto/c_groestl.c +360 -0
  174. package/crypto/c_groestl.h +56 -0
  175. package/crypto/c_jh.c +367 -0
  176. package/crypto/c_jh.h +20 -0
  177. package/crypto/c_keccak.c +112 -0
  178. package/crypto/c_keccak.h +26 -0
  179. package/crypto/c_skein.c +2036 -0
  180. package/crypto/c_skein.h +45 -0
  181. package/crypto/crypto.h +186 -0
  182. package/crypto/cryptonote_core/account.cpp +50 -0
  183. package/crypto/cryptonote_core/account.h +61 -0
  184. package/crypto/cryptonote_core/cryptonote_basic_impl.cpp +186 -0
  185. package/crypto/cryptonote_core/cryptonote_basic_impl.h +65 -0
  186. package/crypto/cryptonote_core/cryptonote_format_utils.cpp +766 -0
  187. package/crypto/cryptonote_core/cryptonote_format_utils.h +30 -0
  188. package/crypto/cryptonote_protocol/cryptonote_protocol_defs.h +152 -0
  189. package/crypto/groestl_tables.h +38 -0
  190. package/crypto/hash-ops.h +57 -0
  191. package/crypto/hash.c +24 -0
  192. package/crypto/hash.h +22 -0
  193. package/crypto/int-util.h +230 -0
  194. package/crypto/oaes_config.h +50 -0
  195. package/crypto/oaes_lib.c +1468 -0
  196. package/crypto/oaes_lib.h +215 -0
  197. package/crypto/skein_port.h +190 -0
  198. package/crypto/variant2_int_sqrt.h +168 -0
  199. package/crypto/wild_keccak.cpp +119 -0
  200. package/crypto/wild_keccak.h +168 -0
  201. package/cryptonight.c +300 -0
  202. package/cryptonight.h +17 -0
  203. package/cryptonight_dark.c +300 -0
  204. package/cryptonight_dark.h +17 -0
  205. package/cryptonight_dark_lite.c +300 -0
  206. package/cryptonight_dark_lite.h +17 -0
  207. package/cryptonight_fast.c +300 -0
  208. package/cryptonight_fast.h +17 -0
  209. package/cryptonight_lite.c +300 -0
  210. package/cryptonight_lite.h +17 -0
  211. package/cryptonight_soft_shell.c +298 -0
  212. package/cryptonight_soft_shell.h +17 -0
  213. package/cryptonight_turtle.c +300 -0
  214. package/cryptonight_turtle.h +17 -0
  215. package/cryptonight_turtle_lite.c +300 -0
  216. package/cryptonight_turtle_lite.h +17 -0
  217. package/fresh.c +42 -0
  218. package/fresh.h +16 -0
  219. package/fugue.c +12 -0
  220. package/fugue.h +16 -0
  221. package/groestl.c +40 -0
  222. package/groestl.h +17 -0
  223. package/hefty1.c +63 -0
  224. package/hefty1.h +16 -0
  225. package/index.js +1 -0
  226. package/keccak.c +14 -0
  227. package/keccak.h +16 -0
  228. package/leocuvee-wrkzcoin-multi-hashing-0.0.20.tgz +0 -0
  229. package/multihashing.cc +699 -0
  230. package/nist5.c +46 -0
  231. package/nist5.h +16 -0
  232. package/package.json +56 -0
  233. package/quark.c +210 -0
  234. package/quark.h +16 -0
  235. package/qubit.c +45 -0
  236. package/qubit.h +16 -0
  237. package/scryptjane/scrypt-jane-chacha.h +132 -0
  238. package/scryptjane/scrypt-jane-hash.h +48 -0
  239. package/scryptjane/scrypt-jane-hash_keccak.h +168 -0
  240. package/scryptjane/scrypt-jane-hash_sha256.h +135 -0
  241. package/scryptjane/scrypt-jane-mix_chacha-avx.h +340 -0
  242. package/scryptjane/scrypt-jane-mix_chacha-sse2.h +371 -0
  243. package/scryptjane/scrypt-jane-mix_chacha-ssse3.h +348 -0
  244. package/scryptjane/scrypt-jane-mix_chacha.h +69 -0
  245. package/scryptjane/scrypt-jane-mix_salsa-avx.h +381 -0
  246. package/scryptjane/scrypt-jane-mix_salsa-sse2.h +443 -0
  247. package/scryptjane/scrypt-jane-mix_salsa.h +70 -0
  248. package/scryptjane/scrypt-jane-pbkdf2.h +112 -0
  249. package/scryptjane/scrypt-jane-portable-x86.h +364 -0
  250. package/scryptjane/scrypt-jane-portable.h +281 -0
  251. package/scryptjane/scrypt-jane-romix-basic.h +67 -0
  252. package/scryptjane/scrypt-jane-romix-template.h +118 -0
  253. package/scryptjane/scrypt-jane-romix.h +27 -0
  254. package/scryptjane/scrypt-jane-salsa.h +106 -0
  255. package/scryptjane/scrypt-jane-test-vectors.h +261 -0
  256. package/scryptjane.c +223 -0
  257. package/scryptjane.h +36 -0
  258. package/scryptn.c +258 -0
  259. package/scryptn.h +16 -0
  260. package/sha1.c +65 -0
  261. package/sha1.h +16 -0
  262. package/sha256.h +440 -0
  263. package/sha3/aes_helper.c +392 -0
  264. package/sha3/hamsi.c +867 -0
  265. package/sha3/hamsi_helper.c +39648 -0
  266. package/sha3/md_helper.c +347 -0
  267. package/sha3/sph_blake.c +1114 -0
  268. package/sha3/sph_blake.h +327 -0
  269. package/sha3/sph_bmw.c +965 -0
  270. package/sha3/sph_bmw.h +328 -0
  271. package/sha3/sph_cubehash.c +723 -0
  272. package/sha3/sph_cubehash.h +292 -0
  273. package/sha3/sph_echo.c +1031 -0
  274. package/sha3/sph_echo.h +320 -0
  275. package/sha3/sph_fugue.c +1208 -0
  276. package/sha3/sph_fugue.h +81 -0
  277. package/sha3/sph_groestl.c +3119 -0
  278. package/sha3/sph_groestl.h +329 -0
  279. package/sha3/sph_hamsi.h +321 -0
  280. package/sha3/sph_hefty1.c +378 -0
  281. package/sha3/sph_hefty1.h +66 -0
  282. package/sha3/sph_jh.c +1116 -0
  283. package/sha3/sph_jh.h +298 -0
  284. package/sha3/sph_keccak.c +1824 -0
  285. package/sha3/sph_keccak.h +293 -0
  286. package/sha3/sph_luffa.c +1426 -0
  287. package/sha3/sph_luffa.h +296 -0
  288. package/sha3/sph_shabal.c +806 -0
  289. package/sha3/sph_shabal.h +344 -0
  290. package/sha3/sph_shavite.c +1764 -0
  291. package/sha3/sph_shavite.h +314 -0
  292. package/sha3/sph_simd.c +1799 -0
  293. package/sha3/sph_simd.h +309 -0
  294. package/sha3/sph_skein.c +1254 -0
  295. package/sha3/sph_skein.h +298 -0
  296. package/sha3/sph_types.h +1976 -0
  297. package/sha3/sph_whirlpool.c +3480 -0
  298. package/sha3/sph_whirlpool.h +209 -0
  299. package/shavite3.c +24 -0
  300. package/shavite3.h +16 -0
  301. package/skein.c +26 -0
  302. package/skein.h +16 -0
  303. package/stdint.h +259 -0
  304. package/tests/argon2-tests.js +16 -0
  305. package/tests/benchmark.js +36 -0
  306. package/tests/cryptonight-tests.js +189 -0
  307. package/tests/cryptonight_monero.js +53 -0
  308. package/tests/test.js +16 -0
  309. package/x11.c +85 -0
  310. package/x11.h +16 -0
  311. package/x13.c +97 -0
  312. package/x13.h +5 -0
  313. package/x15.c +106 -0
  314. package/x15.h +16 -0
@@ -0,0 +1,209 @@
1
+ /* $Id: sph_whirlpool.h 216 2010-06-08 09:46:57Z tp $ */
2
+ /**
3
+ * WHIRLPOOL interface.
4
+ *
5
+ * WHIRLPOOL knows three variants, dubbed "WHIRLPOOL-0" (original
6
+ * version, published in 2000, studied by NESSIE), "WHIRLPOOL-1"
7
+ * (first revision, 2001, with a new S-box) and "WHIRLPOOL" (current
8
+ * version, 2003, with a new diffusion matrix, also described as "plain
9
+ * WHIRLPOOL"). All three variants are implemented here.
10
+ *
11
+ * The original WHIRLPOOL (i.e. WHIRLPOOL-0) was published in: P. S. L.
12
+ * M. Barreto, V. Rijmen, "The Whirlpool Hashing Function", First open
13
+ * NESSIE Workshop, Leuven, Belgium, November 13--14, 2000.
14
+ *
15
+ * The current WHIRLPOOL specification and a reference implementation
16
+ * can be found on the WHIRLPOOL web page:
17
+ * http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html
18
+ *
19
+ * ==========================(LICENSE BEGIN)============================
20
+ *
21
+ * Copyright (c) 2007-2010 Projet RNRT SAPHIR
22
+ *
23
+ * Permission is hereby granted, free of charge, to any person obtaining
24
+ * a copy of this software and associated documentation files (the
25
+ * "Software"), to deal in the Software without restriction, including
26
+ * without limitation the rights to use, copy, modify, merge, publish,
27
+ * distribute, sublicense, and/or sell copies of the Software, and to
28
+ * permit persons to whom the Software is furnished to do so, subject to
29
+ * the following conditions:
30
+ *
31
+ * The above copyright notice and this permission notice shall be
32
+ * included in all copies or substantial portions of the Software.
33
+ *
34
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
38
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
39
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
+ *
42
+ * ===========================(LICENSE END)=============================
43
+ *
44
+ * @file sph_whirlpool.h
45
+ * @author Thomas Pornin <thomas.pornin@cryptolog.com>
46
+ */
47
+
48
+ #ifndef SPH_WHIRLPOOL_H__
49
+ #define SPH_WHIRLPOOL_H__
50
+
51
+ #include <stddef.h>
52
+ #include "sph_types.h"
53
+
54
+ #if SPH_64
55
+
56
+ /**
57
+ * Output size (in bits) for WHIRLPOOL.
58
+ */
59
+ #define SPH_SIZE_whirlpool 512
60
+
61
+ /**
62
+ * Output size (in bits) for WHIRLPOOL-0.
63
+ */
64
+ #define SPH_SIZE_whirlpool0 512
65
+
66
+ /**
67
+ * Output size (in bits) for WHIRLPOOL-1.
68
+ */
69
+ #define SPH_SIZE_whirlpool1 512
70
+
71
+ /**
72
+ * This structure is a context for WHIRLPOOL computations: it contains the
73
+ * intermediate values and some data from the last entered block. Once
74
+ * a WHIRLPOOL computation has been performed, the context can be reused for
75
+ * another computation.
76
+ *
77
+ * The contents of this structure are private. A running WHIRLPOOL computation
78
+ * can be cloned by copying the context (e.g. with a simple
79
+ * <code>memcpy()</code>).
80
+ */
81
+ typedef struct {
82
+ #ifndef DOXYGEN_IGNORE
83
+ unsigned char buf[64]; /* first field, for alignment */
84
+ sph_u64 state[8];
85
+ #if SPH_64
86
+ sph_u64 count;
87
+ #else
88
+ sph_u32 count_high, count_low;
89
+ #endif
90
+ #endif
91
+ } sph_whirlpool_context;
92
+
93
+ /**
94
+ * Initialize a WHIRLPOOL context. This process performs no memory allocation.
95
+ *
96
+ * @param cc the WHIRLPOOL context (pointer to a
97
+ * <code>sph_whirlpool_context</code>)
98
+ */
99
+ void sph_whirlpool_init(void *cc);
100
+
101
+ /**
102
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
103
+ * (in which case this function does nothing). This function applies the
104
+ * plain WHIRLPOOL algorithm.
105
+ *
106
+ * @param cc the WHIRLPOOL context
107
+ * @param data the input data
108
+ * @param len the input data length (in bytes)
109
+ */
110
+ void sph_whirlpool(void *cc, const void *data, size_t len);
111
+
112
+ /**
113
+ * Terminate the current WHIRLPOOL computation and output the result into the
114
+ * provided buffer. The destination buffer must be wide enough to
115
+ * accomodate the result (64 bytes). The context is automatically
116
+ * reinitialized.
117
+ *
118
+ * @param cc the WHIRLPOOL context
119
+ * @param dst the destination buffer
120
+ */
121
+ void sph_whirlpool_close(void *cc, void *dst);
122
+
123
+ /**
124
+ * WHIRLPOOL-0 uses the same structure than plain WHIRLPOOL.
125
+ */
126
+ typedef sph_whirlpool_context sph_whirlpool0_context;
127
+
128
+ #ifdef DOXYGEN_IGNORE
129
+ /**
130
+ * Initialize a WHIRLPOOL-0 context. This function is identical to
131
+ * <code>sph_whirlpool_init()</code>.
132
+ *
133
+ * @param cc the WHIRLPOOL context (pointer to a
134
+ * <code>sph_whirlpool0_context</code>)
135
+ */
136
+ void sph_whirlpool0_init(void *cc);
137
+ #endif
138
+
139
+ #ifndef DOXYGEN_IGNORE
140
+ #define sph_whirlpool0_init sph_whirlpool_init
141
+ #endif
142
+
143
+ /**
144
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
145
+ * (in which case this function does nothing). This function applies the
146
+ * WHIRLPOOL-0 algorithm.
147
+ *
148
+ * @param cc the WHIRLPOOL context
149
+ * @param data the input data
150
+ * @param len the input data length (in bytes)
151
+ */
152
+ void sph_whirlpool0(void *cc, const void *data, size_t len);
153
+
154
+ /**
155
+ * Terminate the current WHIRLPOOL-0 computation and output the result into the
156
+ * provided buffer. The destination buffer must be wide enough to
157
+ * accomodate the result (64 bytes). The context is automatically
158
+ * reinitialized.
159
+ *
160
+ * @param cc the WHIRLPOOL-0 context
161
+ * @param dst the destination buffer
162
+ */
163
+ void sph_whirlpool0_close(void *cc, void *dst);
164
+
165
+ /**
166
+ * WHIRLPOOL-1 uses the same structure than plain WHIRLPOOL.
167
+ */
168
+ typedef sph_whirlpool_context sph_whirlpool1_context;
169
+
170
+ #ifdef DOXYGEN_IGNORE
171
+ /**
172
+ * Initialize a WHIRLPOOL-1 context. This function is identical to
173
+ * <code>sph_whirlpool_init()</code>.
174
+ *
175
+ * @param cc the WHIRLPOOL context (pointer to a
176
+ * <code>sph_whirlpool1_context</code>)
177
+ */
178
+ void sph_whirlpool1_init(void *cc);
179
+ #endif
180
+
181
+ #ifndef DOXYGEN_IGNORE
182
+ #define sph_whirlpool1_init sph_whirlpool_init
183
+ #endif
184
+
185
+ /**
186
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
187
+ * (in which case this function does nothing). This function applies the
188
+ * WHIRLPOOL-1 algorithm.
189
+ *
190
+ * @param cc the WHIRLPOOL context
191
+ * @param data the input data
192
+ * @param len the input data length (in bytes)
193
+ */
194
+ void sph_whirlpool1(void *cc, const void *data, size_t len);
195
+
196
+ /**
197
+ * Terminate the current WHIRLPOOL-1 computation and output the result into the
198
+ * provided buffer. The destination buffer must be wide enough to
199
+ * accomodate the result (64 bytes). The context is automatically
200
+ * reinitialized.
201
+ *
202
+ * @param cc the WHIRLPOOL-1 context
203
+ * @param dst the destination buffer
204
+ */
205
+ void sph_whirlpool1_close(void *cc, void *dst);
206
+
207
+ #endif
208
+
209
+ #endif
package/shavite3.c ADDED
@@ -0,0 +1,24 @@
1
+ #include "shavite3.h"
2
+
3
+ #include <string.h>
4
+ #include <stdlib.h>
5
+
6
+ #include "sha3/sph_shavite.h"
7
+
8
+ void shavite3_hash(const char* input, char* output, uint32_t len)
9
+ {
10
+ char hash1[64];
11
+ char hash2[64];
12
+
13
+ sph_shavite512_context ctx_shavite;
14
+
15
+ sph_shavite512_init(&ctx_shavite);
16
+ sph_shavite512(&ctx_shavite, (const void*) input, len);
17
+ sph_shavite512_close(&ctx_shavite, (void*) &hash1);
18
+
19
+ sph_shavite512(&ctx_shavite, (const void*) &hash1, 64);
20
+ sph_shavite512_close(&ctx_shavite, (void*) &hash2);
21
+
22
+ memcpy(output, &hash2, 32);
23
+ }
24
+
package/shavite3.h ADDED
@@ -0,0 +1,16 @@
1
+ #ifndef SHAVITE_H
2
+ #define SHAVITE_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #include <stdint.h>
9
+
10
+ void shavite3_hash(const char* input, char* output, uint32_t len);
11
+
12
+ #ifdef __cplusplus
13
+ }
14
+ #endif
15
+
16
+ #endif
package/skein.c ADDED
@@ -0,0 +1,26 @@
1
+ #include "skein.h"
2
+ #include <stdlib.h>
3
+ #include <stdint.h>
4
+ #include <string.h>
5
+ #include <stdio.h>
6
+
7
+ #include "sha3/sph_skein.h"
8
+ #include "sha256.h"
9
+
10
+ #include <stdlib.h>
11
+
12
+ void skein_hash(const char* input, char* output, uint32_t len)
13
+ {
14
+ char temp[64];
15
+
16
+ sph_skein512_context ctx_skien;
17
+ sph_skein512_init(&ctx_skien);
18
+ sph_skein512(&ctx_skien, input, len);
19
+ sph_skein512_close(&ctx_skien, &temp);
20
+
21
+ SHA256_CTX ctx_sha256;
22
+ SHA256_Init(&ctx_sha256);
23
+ SHA256_Update(&ctx_sha256, &temp, 64);
24
+ SHA256_Final((unsigned char*) output, &ctx_sha256);
25
+ }
26
+
package/skein.h ADDED
@@ -0,0 +1,16 @@
1
+ #ifndef SKEIN_H
2
+ #define SKEIN_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #include <stdint.h>
9
+
10
+ void skein_hash(const char* input, char* output, uint32_t len);
11
+
12
+ #ifdef __cplusplus
13
+ }
14
+ #endif
15
+
16
+ #endif
package/stdint.h ADDED
@@ -0,0 +1,259 @@
1
+ // ISO C9x compliant stdint.h for Microsoft Visual Studio
2
+ // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
3
+ //
4
+ // Copyright (c) 2006-2013 Alexander Chemeris
5
+ //
6
+ // Redistribution and use in source and binary forms, with or without
7
+ // modification, are permitted provided that the following conditions are met:
8
+ //
9
+ // 1. Redistributions of source code must retain the above copyright notice,
10
+ // this list of conditions and the following disclaimer.
11
+ //
12
+ // 2. Redistributions in binary form must reproduce the above copyright
13
+ // notice, this list of conditions and the following disclaimer in the
14
+ // documentation and/or other materials provided with the distribution.
15
+ //
16
+ // 3. Neither the name of the product nor the names of its contributors may
17
+ // be used to endorse or promote products derived from this software
18
+ // without specific prior written permission.
19
+ //
20
+ // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
21
+ // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22
+ // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
23
+ // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
+ // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26
+ // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27
+ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28
+ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29
+ // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ //
31
+ ///////////////////////////////////////////////////////////////////////////////
32
+
33
+ #ifndef _MSC_VER // [
34
+ #error "Use this header only with Microsoft Visual C++ compilers!"
35
+ #endif // _MSC_VER ]
36
+
37
+ #ifndef _MSC_STDINT_H_ // [
38
+ #define _MSC_STDINT_H_
39
+
40
+ #if _MSC_VER > 1000
41
+ #pragma once
42
+ #endif
43
+
44
+ #if _MSC_VER >= 1600 // [
45
+ #include <stdint.h>
46
+ #else // ] _MSC_VER >= 1600 [
47
+
48
+ #include <limits.h>
49
+
50
+ // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
51
+ // compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
52
+ // or compiler give many errors like this:
53
+ // error C2733: second C linkage of overloaded function 'wmemchr' not allowed
54
+ #ifdef __cplusplus
55
+ extern "C" {
56
+ #endif
57
+ # include <wchar.h>
58
+ #ifdef __cplusplus
59
+ }
60
+ #endif
61
+
62
+ // Define _W64 macros to mark types changing their size, like intptr_t.
63
+ #ifndef _W64
64
+ # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
65
+ # define _W64 __w64
66
+ # else
67
+ # define _W64
68
+ # endif
69
+ #endif
70
+
71
+
72
+ // 7.18.1 Integer types
73
+
74
+ // 7.18.1.1 Exact-width integer types
75
+
76
+ // Visual Studio 6 and Embedded Visual C++ 4 doesn't
77
+ // realize that, e.g. char has the same size as __int8
78
+ // so we give up on __intX for them.
79
+ #if (_MSC_VER < 1300)
80
+ typedef signed char int8_t;
81
+ typedef signed short int16_t;
82
+ typedef signed int int32_t;
83
+ typedef unsigned char uint8_t;
84
+ typedef unsigned short uint16_t;
85
+ typedef unsigned int uint32_t;
86
+ #else
87
+ typedef signed __int8 int8_t;
88
+ typedef signed __int16 int16_t;
89
+ typedef signed __int32 int32_t;
90
+ typedef unsigned __int8 uint8_t;
91
+ typedef unsigned __int16 uint16_t;
92
+ typedef unsigned __int32 uint32_t;
93
+ #endif
94
+ typedef signed __int64 int64_t;
95
+ typedef unsigned __int64 uint64_t;
96
+
97
+
98
+ // 7.18.1.2 Minimum-width integer types
99
+ typedef int8_t int_least8_t;
100
+ typedef int16_t int_least16_t;
101
+ typedef int32_t int_least32_t;
102
+ typedef int64_t int_least64_t;
103
+ typedef uint8_t uint_least8_t;
104
+ typedef uint16_t uint_least16_t;
105
+ typedef uint32_t uint_least32_t;
106
+ typedef uint64_t uint_least64_t;
107
+
108
+ // 7.18.1.3 Fastest minimum-width integer types
109
+ typedef int8_t int_fast8_t;
110
+ typedef int16_t int_fast16_t;
111
+ typedef int32_t int_fast32_t;
112
+ typedef int64_t int_fast64_t;
113
+ typedef uint8_t uint_fast8_t;
114
+ typedef uint16_t uint_fast16_t;
115
+ typedef uint32_t uint_fast32_t;
116
+ typedef uint64_t uint_fast64_t;
117
+
118
+ // 7.18.1.4 Integer types capable of holding object pointers
119
+ #ifdef _WIN64 // [
120
+ typedef signed __int64 intptr_t;
121
+ typedef unsigned __int64 uintptr_t;
122
+ #else // _WIN64 ][
123
+ typedef _W64 signed int intptr_t;
124
+ typedef _W64 unsigned int uintptr_t;
125
+ #endif // _WIN64 ]
126
+
127
+ // 7.18.1.5 Greatest-width integer types
128
+ typedef int64_t intmax_t;
129
+ typedef uint64_t uintmax_t;
130
+
131
+
132
+ // 7.18.2 Limits of specified-width integer types
133
+
134
+ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
135
+
136
+ // 7.18.2.1 Limits of exact-width integer types
137
+ #define INT8_MIN ((int8_t)_I8_MIN)
138
+ #define INT8_MAX _I8_MAX
139
+ #define INT16_MIN ((int16_t)_I16_MIN)
140
+ #define INT16_MAX _I16_MAX
141
+ #define INT32_MIN ((int32_t)_I32_MIN)
142
+ #define INT32_MAX _I32_MAX
143
+ #define INT64_MIN ((int64_t)_I64_MIN)
144
+ #define INT64_MAX _I64_MAX
145
+ #define UINT8_MAX _UI8_MAX
146
+ #define UINT16_MAX _UI16_MAX
147
+ #define UINT32_MAX _UI32_MAX
148
+ #define UINT64_MAX _UI64_MAX
149
+
150
+ // 7.18.2.2 Limits of minimum-width integer types
151
+ #define INT_LEAST8_MIN INT8_MIN
152
+ #define INT_LEAST8_MAX INT8_MAX
153
+ #define INT_LEAST16_MIN INT16_MIN
154
+ #define INT_LEAST16_MAX INT16_MAX
155
+ #define INT_LEAST32_MIN INT32_MIN
156
+ #define INT_LEAST32_MAX INT32_MAX
157
+ #define INT_LEAST64_MIN INT64_MIN
158
+ #define INT_LEAST64_MAX INT64_MAX
159
+ #define UINT_LEAST8_MAX UINT8_MAX
160
+ #define UINT_LEAST16_MAX UINT16_MAX
161
+ #define UINT_LEAST32_MAX UINT32_MAX
162
+ #define UINT_LEAST64_MAX UINT64_MAX
163
+
164
+ // 7.18.2.3 Limits of fastest minimum-width integer types
165
+ #define INT_FAST8_MIN INT8_MIN
166
+ #define INT_FAST8_MAX INT8_MAX
167
+ #define INT_FAST16_MIN INT16_MIN
168
+ #define INT_FAST16_MAX INT16_MAX
169
+ #define INT_FAST32_MIN INT32_MIN
170
+ #define INT_FAST32_MAX INT32_MAX
171
+ #define INT_FAST64_MIN INT64_MIN
172
+ #define INT_FAST64_MAX INT64_MAX
173
+ #define UINT_FAST8_MAX UINT8_MAX
174
+ #define UINT_FAST16_MAX UINT16_MAX
175
+ #define UINT_FAST32_MAX UINT32_MAX
176
+ #define UINT_FAST64_MAX UINT64_MAX
177
+
178
+ // 7.18.2.4 Limits of integer types capable of holding object pointers
179
+ #ifdef _WIN64 // [
180
+ # define INTPTR_MIN INT64_MIN
181
+ # define INTPTR_MAX INT64_MAX
182
+ # define UINTPTR_MAX UINT64_MAX
183
+ #else // _WIN64 ][
184
+ # define INTPTR_MIN INT32_MIN
185
+ # define INTPTR_MAX INT32_MAX
186
+ # define UINTPTR_MAX UINT32_MAX
187
+ #endif // _WIN64 ]
188
+
189
+ // 7.18.2.5 Limits of greatest-width integer types
190
+ #define INTMAX_MIN INT64_MIN
191
+ #define INTMAX_MAX INT64_MAX
192
+ #define UINTMAX_MAX UINT64_MAX
193
+
194
+ // 7.18.3 Limits of other integer types
195
+
196
+ #ifdef _WIN64 // [
197
+ # define PTRDIFF_MIN _I64_MIN
198
+ # define PTRDIFF_MAX _I64_MAX
199
+ #else // _WIN64 ][
200
+ # define PTRDIFF_MIN _I32_MIN
201
+ # define PTRDIFF_MAX _I32_MAX
202
+ #endif // _WIN64 ]
203
+
204
+ #define SIG_ATOMIC_MIN INT_MIN
205
+ #define SIG_ATOMIC_MAX INT_MAX
206
+
207
+ #ifndef SIZE_MAX // [
208
+ # ifdef _WIN64 // [
209
+ # define SIZE_MAX _UI64_MAX
210
+ # else // _WIN64 ][
211
+ # define SIZE_MAX _UI32_MAX
212
+ # endif // _WIN64 ]
213
+ #endif // SIZE_MAX ]
214
+
215
+ // WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
216
+ #ifndef WCHAR_MIN // [
217
+ # define WCHAR_MIN 0
218
+ #endif // WCHAR_MIN ]
219
+ #ifndef WCHAR_MAX // [
220
+ # define WCHAR_MAX _UI16_MAX
221
+ #endif // WCHAR_MAX ]
222
+
223
+ #define WINT_MIN 0
224
+ #define WINT_MAX _UI16_MAX
225
+
226
+ #endif // __STDC_LIMIT_MACROS ]
227
+
228
+
229
+ // 7.18.4 Limits of other integer types
230
+
231
+ #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
232
+
233
+ // 7.18.4.1 Macros for minimum-width integer constants
234
+
235
+ #define INT8_C(val) val##i8
236
+ #define INT16_C(val) val##i16
237
+ #define INT32_C(val) val##i32
238
+ #define INT64_C(val) val##i64
239
+
240
+ #define UINT8_C(val) val##ui8
241
+ #define UINT16_C(val) val##ui16
242
+ #define UINT32_C(val) val##ui32
243
+ #define UINT64_C(val) val##ui64
244
+
245
+ // 7.18.4.2 Macros for greatest-width integer constants
246
+ // These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
247
+ // Check out Issue 9 for the details.
248
+ #ifndef INTMAX_C // [
249
+ # define INTMAX_C INT64_C
250
+ #endif // INTMAX_C ]
251
+ #ifndef UINTMAX_C // [
252
+ # define UINTMAX_C UINT64_C
253
+ #endif // UINTMAX_C ]
254
+
255
+ #endif // __STDC_CONSTANT_MACROS ]
256
+
257
+ #endif // _MSC_VER >= 1600 ]
258
+
259
+ #endif // _MSC_STDINT_H_ ]
@@ -0,0 +1,16 @@
1
+ const Buffer = require('safe-buffer').Buffer
2
+ const multiHashing = require('../')
3
+ const assert = require('assert')
4
+
5
+ console.log('')
6
+ console.log('Argon2 Tests')
7
+
8
+ const xmrigdata = new Buffer('0100fb8e8ac805899323371bb790db19218afd8db8e3755d8b90f39b3d5506a9abce4fa912244500000000ee8146d49fa93ee724deb57d12cbc6c6f3b924d946127c7a97418f9348828f0f02', 'hex')
9
+
10
+ const chukwa = new Buffer('c0dad0eeb9c52e92a1c3aa5b76a3cb90bd7376c28dce191ceeb1096e3a390d2e', 'hex')
11
+
12
+ const chukwaData = multiHashing['chukwa'](xmrigdata)
13
+
14
+ console.log('')
15
+ console.log('[#1] Chukwa: ', chukwaData.toString('hex'))
16
+ assert.deepEqual(chukwaData, chukwa)
@@ -0,0 +1,36 @@
1
+ const Buffer = require('safe-buffer').Buffer
2
+ const multiHashing = require('../build/Release/multihashing')
3
+
4
+ const algoTests = [
5
+ 'cryptonight',
6
+ 'cryptonight-lite',
7
+ 'cryptonight-turtle-lite'
8
+ ]
9
+
10
+ const variants = [
11
+ 0,
12
+ 1,
13
+ 2
14
+ ]
15
+
16
+ const testdata = new Buffer('0100fb8e8ac805899323371bb790db19218afd8db8e3755d8b90f39b3d5506a9abce4fa912244500000000ee8146d49fa93ee724deb57d12cbc6c6f3b924d946127c7a97418f9348828f0f02', 'hex')
17
+
18
+ function runBenchmark (algo, variant, iterations) {
19
+ iterations = iterations || 1000
20
+ var time = Date.now()
21
+ for (var i = 0; i < iterations; i++) {
22
+ multiHashing[algo](testdata, variant)
23
+ }
24
+ time = (Date.now() - time) / 1000
25
+ return Math.floor(iterations / time)
26
+ }
27
+
28
+ for (var i = 0; i < algoTests.length; i++) {
29
+ for (var j = 0; j < variants.length; j++) {
30
+ var hashrate = runBenchmark(algoTests[i], variants[j])
31
+ console.log(algoTests[i] + ' v' + variants[j] + ': ' + hashrate + ' H/s')
32
+ }
33
+ }
34
+
35
+ const chukwaHashrate = runBenchmark('chukwa')
36
+ console.log('chukwa: %s H/s', chukwaHashrate)