@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,329 @@
1
+ /* $Id: sph_groestl.h 216 2010-06-08 09:46:57Z tp $ */
2
+ /**
3
+ * Groestl interface. This code implements Groestl with the recommended
4
+ * parameters for SHA-3, with outputs of 224, 256, 384 and 512 bits.
5
+ *
6
+ * ==========================(LICENSE BEGIN)============================
7
+ *
8
+ * Copyright (c) 2007-2010 Projet RNRT SAPHIR
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining
11
+ * a copy of this software and associated documentation files (the
12
+ * "Software"), to deal in the Software without restriction, including
13
+ * without limitation the rights to use, copy, modify, merge, publish,
14
+ * distribute, sublicense, and/or sell copies of the Software, and to
15
+ * permit persons to whom the Software is furnished to do so, subject to
16
+ * the following conditions:
17
+ *
18
+ * The above copyright notice and this permission notice shall be
19
+ * included in all copies or substantial portions of the Software.
20
+ *
21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ *
29
+ * ===========================(LICENSE END)=============================
30
+ *
31
+ * @file sph_groestl.h
32
+ * @author Thomas Pornin <thomas.pornin@cryptolog.com>
33
+ */
34
+
35
+ #ifndef SPH_GROESTL_H__
36
+ #define SPH_GROESTL_H__
37
+
38
+ #ifdef __cplusplus
39
+ extern "C"{
40
+ #endif
41
+
42
+ #include <stddef.h>
43
+ #include "sph_types.h"
44
+
45
+ /**
46
+ * Output size (in bits) for Groestl-224.
47
+ */
48
+ #define SPH_SIZE_groestl224 224
49
+
50
+ /**
51
+ * Output size (in bits) for Groestl-256.
52
+ */
53
+ #define SPH_SIZE_groestl256 256
54
+
55
+ /**
56
+ * Output size (in bits) for Groestl-384.
57
+ */
58
+ #define SPH_SIZE_groestl384 384
59
+
60
+ /**
61
+ * Output size (in bits) for Groestl-512.
62
+ */
63
+ #define SPH_SIZE_groestl512 512
64
+
65
+ /**
66
+ * This structure is a context for Groestl-224 and Groestl-256 computations:
67
+ * it contains the intermediate values and some data from the last
68
+ * entered block. Once a Groestl computation has been performed, the
69
+ * context can be reused for another computation.
70
+ *
71
+ * The contents of this structure are private. A running Groestl
72
+ * computation can be cloned by copying the context (e.g. with a simple
73
+ * <code>memcpy()</code>).
74
+ */
75
+ typedef struct {
76
+ #ifndef DOXYGEN_IGNORE
77
+ unsigned char buf[64]; /* first field, for alignment */
78
+ size_t ptr;
79
+ union {
80
+ #if SPH_64
81
+ sph_u64 wide[8];
82
+ #endif
83
+ sph_u32 narrow[16];
84
+ } state;
85
+ #if SPH_64
86
+ sph_u64 count;
87
+ #else
88
+ sph_u32 count_high, count_low;
89
+ #endif
90
+ #endif
91
+ } sph_groestl_small_context;
92
+
93
+ /**
94
+ * This structure is a context for Groestl-224 computations. It is
95
+ * identical to the common <code>sph_groestl_small_context</code>.
96
+ */
97
+ typedef sph_groestl_small_context sph_groestl224_context;
98
+
99
+ /**
100
+ * This structure is a context for Groestl-256 computations. It is
101
+ * identical to the common <code>sph_groestl_small_context</code>.
102
+ */
103
+ typedef sph_groestl_small_context sph_groestl256_context;
104
+
105
+ /**
106
+ * This structure is a context for Groestl-384 and Groestl-512 computations:
107
+ * it contains the intermediate values and some data from the last
108
+ * entered block. Once a Groestl computation has been performed, the
109
+ * context can be reused for another computation.
110
+ *
111
+ * The contents of this structure are private. A running Groestl
112
+ * computation can be cloned by copying the context (e.g. with a simple
113
+ * <code>memcpy()</code>).
114
+ */
115
+ typedef struct {
116
+ #ifndef DOXYGEN_IGNORE
117
+ unsigned char buf[128]; /* first field, for alignment */
118
+ size_t ptr;
119
+ union {
120
+ #if SPH_64
121
+ sph_u64 wide[16];
122
+ #endif
123
+ sph_u32 narrow[32];
124
+ } state;
125
+ #if SPH_64
126
+ sph_u64 count;
127
+ #else
128
+ sph_u32 count_high, count_low;
129
+ #endif
130
+ #endif
131
+ } sph_groestl_big_context;
132
+
133
+ /**
134
+ * This structure is a context for Groestl-384 computations. It is
135
+ * identical to the common <code>sph_groestl_small_context</code>.
136
+ */
137
+ typedef sph_groestl_big_context sph_groestl384_context;
138
+
139
+ /**
140
+ * This structure is a context for Groestl-512 computations. It is
141
+ * identical to the common <code>sph_groestl_small_context</code>.
142
+ */
143
+ typedef sph_groestl_big_context sph_groestl512_context;
144
+
145
+ /**
146
+ * Initialize a Groestl-224 context. This process performs no memory allocation.
147
+ *
148
+ * @param cc the Groestl-224 context (pointer to a
149
+ * <code>sph_groestl224_context</code>)
150
+ */
151
+ void sph_groestl224_init(void *cc);
152
+
153
+ /**
154
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
155
+ * (in which case this function does nothing).
156
+ *
157
+ * @param cc the Groestl-224 context
158
+ * @param data the input data
159
+ * @param len the input data length (in bytes)
160
+ */
161
+ void sph_groestl224(void *cc, const void *data, size_t len);
162
+
163
+ /**
164
+ * Terminate the current Groestl-224 computation and output the result into
165
+ * the provided buffer. The destination buffer must be wide enough to
166
+ * accomodate the result (28 bytes). The context is automatically
167
+ * reinitialized.
168
+ *
169
+ * @param cc the Groestl-224 context
170
+ * @param dst the destination buffer
171
+ */
172
+ void sph_groestl224_close(void *cc, void *dst);
173
+
174
+ /**
175
+ * Add a few additional bits (0 to 7) to the current computation, then
176
+ * terminate it and output the result in the provided buffer, which must
177
+ * be wide enough to accomodate the result (28 bytes). If bit number i
178
+ * in <code>ub</code> has value 2^i, then the extra bits are those
179
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
180
+ * level). The context is automatically reinitialized.
181
+ *
182
+ * @param cc the Groestl-224 context
183
+ * @param ub the extra bits
184
+ * @param n the number of extra bits (0 to 7)
185
+ * @param dst the destination buffer
186
+ */
187
+ void sph_groestl224_addbits_and_close(
188
+ void *cc, unsigned ub, unsigned n, void *dst);
189
+
190
+ /**
191
+ * Initialize a Groestl-256 context. This process performs no memory allocation.
192
+ *
193
+ * @param cc the Groestl-256 context (pointer to a
194
+ * <code>sph_groestl256_context</code>)
195
+ */
196
+ void sph_groestl256_init(void *cc);
197
+
198
+ /**
199
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
200
+ * (in which case this function does nothing).
201
+ *
202
+ * @param cc the Groestl-256 context
203
+ * @param data the input data
204
+ * @param len the input data length (in bytes)
205
+ */
206
+ void sph_groestl256(void *cc, const void *data, size_t len);
207
+
208
+ /**
209
+ * Terminate the current Groestl-256 computation and output the result into
210
+ * the provided buffer. The destination buffer must be wide enough to
211
+ * accomodate the result (32 bytes). The context is automatically
212
+ * reinitialized.
213
+ *
214
+ * @param cc the Groestl-256 context
215
+ * @param dst the destination buffer
216
+ */
217
+ void sph_groestl256_close(void *cc, void *dst);
218
+
219
+ /**
220
+ * Add a few additional bits (0 to 7) to the current computation, then
221
+ * terminate it and output the result in the provided buffer, which must
222
+ * be wide enough to accomodate the result (32 bytes). If bit number i
223
+ * in <code>ub</code> has value 2^i, then the extra bits are those
224
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
225
+ * level). The context is automatically reinitialized.
226
+ *
227
+ * @param cc the Groestl-256 context
228
+ * @param ub the extra bits
229
+ * @param n the number of extra bits (0 to 7)
230
+ * @param dst the destination buffer
231
+ */
232
+ void sph_groestl256_addbits_and_close(
233
+ void *cc, unsigned ub, unsigned n, void *dst);
234
+
235
+ /**
236
+ * Initialize a Groestl-384 context. This process performs no memory allocation.
237
+ *
238
+ * @param cc the Groestl-384 context (pointer to a
239
+ * <code>sph_groestl384_context</code>)
240
+ */
241
+ void sph_groestl384_init(void *cc);
242
+
243
+ /**
244
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
245
+ * (in which case this function does nothing).
246
+ *
247
+ * @param cc the Groestl-384 context
248
+ * @param data the input data
249
+ * @param len the input data length (in bytes)
250
+ */
251
+ void sph_groestl384(void *cc, const void *data, size_t len);
252
+
253
+ /**
254
+ * Terminate the current Groestl-384 computation and output the result into
255
+ * the provided buffer. The destination buffer must be wide enough to
256
+ * accomodate the result (48 bytes). The context is automatically
257
+ * reinitialized.
258
+ *
259
+ * @param cc the Groestl-384 context
260
+ * @param dst the destination buffer
261
+ */
262
+ void sph_groestl384_close(void *cc, void *dst);
263
+
264
+ /**
265
+ * Add a few additional bits (0 to 7) to the current computation, then
266
+ * terminate it and output the result in the provided buffer, which must
267
+ * be wide enough to accomodate the result (48 bytes). If bit number i
268
+ * in <code>ub</code> has value 2^i, then the extra bits are those
269
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
270
+ * level). The context is automatically reinitialized.
271
+ *
272
+ * @param cc the Groestl-384 context
273
+ * @param ub the extra bits
274
+ * @param n the number of extra bits (0 to 7)
275
+ * @param dst the destination buffer
276
+ */
277
+ void sph_groestl384_addbits_and_close(
278
+ void *cc, unsigned ub, unsigned n, void *dst);
279
+
280
+ /**
281
+ * Initialize a Groestl-512 context. This process performs no memory allocation.
282
+ *
283
+ * @param cc the Groestl-512 context (pointer to a
284
+ * <code>sph_groestl512_context</code>)
285
+ */
286
+ void sph_groestl512_init(void *cc);
287
+
288
+ /**
289
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
290
+ * (in which case this function does nothing).
291
+ *
292
+ * @param cc the Groestl-512 context
293
+ * @param data the input data
294
+ * @param len the input data length (in bytes)
295
+ */
296
+ void sph_groestl512(void *cc, const void *data, size_t len);
297
+
298
+ /**
299
+ * Terminate the current Groestl-512 computation and output the result into
300
+ * the provided buffer. The destination buffer must be wide enough to
301
+ * accomodate the result (64 bytes). The context is automatically
302
+ * reinitialized.
303
+ *
304
+ * @param cc the Groestl-512 context
305
+ * @param dst the destination buffer
306
+ */
307
+ void sph_groestl512_close(void *cc, void *dst);
308
+
309
+ /**
310
+ * Add a few additional bits (0 to 7) to the current computation, then
311
+ * terminate it and output the result in the provided buffer, which must
312
+ * be wide enough to accomodate the result (64 bytes). If bit number i
313
+ * in <code>ub</code> has value 2^i, then the extra bits are those
314
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
315
+ * level). The context is automatically reinitialized.
316
+ *
317
+ * @param cc the Groestl-512 context
318
+ * @param ub the extra bits
319
+ * @param n the number of extra bits (0 to 7)
320
+ * @param dst the destination buffer
321
+ */
322
+ void sph_groestl512_addbits_and_close(
323
+ void *cc, unsigned ub, unsigned n, void *dst);
324
+
325
+ #ifdef __cplusplus
326
+ }
327
+ #endif
328
+
329
+ #endif
@@ -0,0 +1,321 @@
1
+ /* $Id: sph_hamsi.h 216 2010-06-08 09:46:57Z tp $ */
2
+ /**
3
+ * Hamsi interface. This code implements Hamsi with the recommended
4
+ * parameters for SHA-3, with outputs of 224, 256, 384 and 512 bits.
5
+ *
6
+ * ==========================(LICENSE BEGIN)============================
7
+ *
8
+ * Copyright (c) 2007-2010 Projet RNRT SAPHIR
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining
11
+ * a copy of this software and associated documentation files (the
12
+ * "Software"), to deal in the Software without restriction, including
13
+ * without limitation the rights to use, copy, modify, merge, publish,
14
+ * distribute, sublicense, and/or sell copies of the Software, and to
15
+ * permit persons to whom the Software is furnished to do so, subject to
16
+ * the following conditions:
17
+ *
18
+ * The above copyright notice and this permission notice shall be
19
+ * included in all copies or substantial portions of the Software.
20
+ *
21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ *
29
+ * ===========================(LICENSE END)=============================
30
+ *
31
+ * @file sph_hamsi.h
32
+ * @author Thomas Pornin <thomas.pornin@cryptolog.com>
33
+ */
34
+
35
+ #ifndef SPH_HAMSI_H__
36
+ #define SPH_HAMSI_H__
37
+
38
+ #include <stddef.h>
39
+ #include "sph_types.h"
40
+
41
+ #ifdef __cplusplus
42
+ extern "C"{
43
+ #endif
44
+
45
+ /**
46
+ * Output size (in bits) for Hamsi-224.
47
+ */
48
+ #define SPH_SIZE_hamsi224 224
49
+
50
+ /**
51
+ * Output size (in bits) for Hamsi-256.
52
+ */
53
+ #define SPH_SIZE_hamsi256 256
54
+
55
+ /**
56
+ * Output size (in bits) for Hamsi-384.
57
+ */
58
+ #define SPH_SIZE_hamsi384 384
59
+
60
+ /**
61
+ * Output size (in bits) for Hamsi-512.
62
+ */
63
+ #define SPH_SIZE_hamsi512 512
64
+
65
+ /**
66
+ * This structure is a context for Hamsi-224 and Hamsi-256 computations:
67
+ * it contains the intermediate values and some data from the last
68
+ * entered block. Once a Hamsi computation has been performed, the
69
+ * context can be reused for another computation.
70
+ *
71
+ * The contents of this structure are private. A running Hamsi
72
+ * computation can be cloned by copying the context (e.g. with a simple
73
+ * <code>memcpy()</code>).
74
+ */
75
+ typedef struct {
76
+ #ifndef DOXYGEN_IGNORE
77
+ unsigned char partial[4];
78
+ size_t partial_len;
79
+ sph_u32 h[8];
80
+ #if SPH_64
81
+ sph_u64 count;
82
+ #else
83
+ sph_u32 count_high, count_low;
84
+ #endif
85
+ #endif
86
+ } sph_hamsi_small_context;
87
+
88
+ /**
89
+ * This structure is a context for Hamsi-224 computations. It is
90
+ * identical to the common <code>sph_hamsi_small_context</code>.
91
+ */
92
+ typedef sph_hamsi_small_context sph_hamsi224_context;
93
+
94
+ /**
95
+ * This structure is a context for Hamsi-256 computations. It is
96
+ * identical to the common <code>sph_hamsi_small_context</code>.
97
+ */
98
+ typedef sph_hamsi_small_context sph_hamsi256_context;
99
+
100
+ /**
101
+ * This structure is a context for Hamsi-384 and Hamsi-512 computations:
102
+ * it contains the intermediate values and some data from the last
103
+ * entered block. Once a Hamsi computation has been performed, the
104
+ * context can be reused for another computation.
105
+ *
106
+ * The contents of this structure are private. A running Hamsi
107
+ * computation can be cloned by copying the context (e.g. with a simple
108
+ * <code>memcpy()</code>).
109
+ */
110
+ typedef struct {
111
+ #ifndef DOXYGEN_IGNORE
112
+ unsigned char partial[8];
113
+ size_t partial_len;
114
+ sph_u32 h[16];
115
+ #if SPH_64
116
+ sph_u64 count;
117
+ #else
118
+ sph_u32 count_high, count_low;
119
+ #endif
120
+ #endif
121
+ } sph_hamsi_big_context;
122
+
123
+ /**
124
+ * This structure is a context for Hamsi-384 computations. It is
125
+ * identical to the common <code>sph_hamsi_small_context</code>.
126
+ */
127
+ typedef sph_hamsi_big_context sph_hamsi384_context;
128
+
129
+ /**
130
+ * This structure is a context for Hamsi-512 computations. It is
131
+ * identical to the common <code>sph_hamsi_small_context</code>.
132
+ */
133
+ typedef sph_hamsi_big_context sph_hamsi512_context;
134
+
135
+ /**
136
+ * Initialize a Hamsi-224 context. This process performs no memory allocation.
137
+ *
138
+ * @param cc the Hamsi-224 context (pointer to a
139
+ * <code>sph_hamsi224_context</code>)
140
+ */
141
+ void sph_hamsi224_init(void *cc);
142
+
143
+ /**
144
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
145
+ * (in which case this function does nothing).
146
+ *
147
+ * @param cc the Hamsi-224 context
148
+ * @param data the input data
149
+ * @param len the input data length (in bytes)
150
+ */
151
+ void sph_hamsi224(void *cc, const void *data, size_t len);
152
+
153
+ /**
154
+ * Terminate the current Hamsi-224 computation and output the result into
155
+ * the provided buffer. The destination buffer must be wide enough to
156
+ * accomodate the result (28 bytes). The context is automatically
157
+ * reinitialized.
158
+ *
159
+ * @param cc the Hamsi-224 context
160
+ * @param dst the destination buffer
161
+ */
162
+ void sph_hamsi224_close(void *cc, void *dst);
163
+
164
+ /**
165
+ * Add a few additional bits (0 to 7) to the current computation, then
166
+ * terminate it and output the result in the provided buffer, which must
167
+ * be wide enough to accomodate the result (28 bytes). If bit number i
168
+ * in <code>ub</code> has value 2^i, then the extra bits are those
169
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
170
+ * level). The context is automatically reinitialized.
171
+ *
172
+ * @param cc the Hamsi-224 context
173
+ * @param ub the extra bits
174
+ * @param n the number of extra bits (0 to 7)
175
+ * @param dst the destination buffer
176
+ */
177
+ void sph_hamsi224_addbits_and_close(
178
+ void *cc, unsigned ub, unsigned n, void *dst);
179
+
180
+ /**
181
+ * Initialize a Hamsi-256 context. This process performs no memory allocation.
182
+ *
183
+ * @param cc the Hamsi-256 context (pointer to a
184
+ * <code>sph_hamsi256_context</code>)
185
+ */
186
+ void sph_hamsi256_init(void *cc);
187
+
188
+ /**
189
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
190
+ * (in which case this function does nothing).
191
+ *
192
+ * @param cc the Hamsi-256 context
193
+ * @param data the input data
194
+ * @param len the input data length (in bytes)
195
+ */
196
+ void sph_hamsi256(void *cc, const void *data, size_t len);
197
+
198
+ /**
199
+ * Terminate the current Hamsi-256 computation and output the result into
200
+ * the provided buffer. The destination buffer must be wide enough to
201
+ * accomodate the result (32 bytes). The context is automatically
202
+ * reinitialized.
203
+ *
204
+ * @param cc the Hamsi-256 context
205
+ * @param dst the destination buffer
206
+ */
207
+ void sph_hamsi256_close(void *cc, void *dst);
208
+
209
+ /**
210
+ * Add a few additional bits (0 to 7) to the current computation, then
211
+ * terminate it and output the result in the provided buffer, which must
212
+ * be wide enough to accomodate the result (32 bytes). If bit number i
213
+ * in <code>ub</code> has value 2^i, then the extra bits are those
214
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
215
+ * level). The context is automatically reinitialized.
216
+ *
217
+ * @param cc the Hamsi-256 context
218
+ * @param ub the extra bits
219
+ * @param n the number of extra bits (0 to 7)
220
+ * @param dst the destination buffer
221
+ */
222
+ void sph_hamsi256_addbits_and_close(
223
+ void *cc, unsigned ub, unsigned n, void *dst);
224
+
225
+ /**
226
+ * Initialize a Hamsi-384 context. This process performs no memory allocation.
227
+ *
228
+ * @param cc the Hamsi-384 context (pointer to a
229
+ * <code>sph_hamsi384_context</code>)
230
+ */
231
+ void sph_hamsi384_init(void *cc);
232
+
233
+ /**
234
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
235
+ * (in which case this function does nothing).
236
+ *
237
+ * @param cc the Hamsi-384 context
238
+ * @param data the input data
239
+ * @param len the input data length (in bytes)
240
+ */
241
+ void sph_hamsi384(void *cc, const void *data, size_t len);
242
+
243
+ /**
244
+ * Terminate the current Hamsi-384 computation and output the result into
245
+ * the provided buffer. The destination buffer must be wide enough to
246
+ * accomodate the result (48 bytes). The context is automatically
247
+ * reinitialized.
248
+ *
249
+ * @param cc the Hamsi-384 context
250
+ * @param dst the destination buffer
251
+ */
252
+ void sph_hamsi384_close(void *cc, void *dst);
253
+
254
+ /**
255
+ * Add a few additional bits (0 to 7) to the current computation, then
256
+ * terminate it and output the result in the provided buffer, which must
257
+ * be wide enough to accomodate the result (48 bytes). If bit number i
258
+ * in <code>ub</code> has value 2^i, then the extra bits are those
259
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
260
+ * level). The context is automatically reinitialized.
261
+ *
262
+ * @param cc the Hamsi-384 context
263
+ * @param ub the extra bits
264
+ * @param n the number of extra bits (0 to 7)
265
+ * @param dst the destination buffer
266
+ */
267
+ void sph_hamsi384_addbits_and_close(
268
+ void *cc, unsigned ub, unsigned n, void *dst);
269
+
270
+ /**
271
+ * Initialize a Hamsi-512 context. This process performs no memory allocation.
272
+ *
273
+ * @param cc the Hamsi-512 context (pointer to a
274
+ * <code>sph_hamsi512_context</code>)
275
+ */
276
+ void sph_hamsi512_init(void *cc);
277
+
278
+ /**
279
+ * Process some data bytes. It is acceptable that <code>len</code> is zero
280
+ * (in which case this function does nothing).
281
+ *
282
+ * @param cc the Hamsi-512 context
283
+ * @param data the input data
284
+ * @param len the input data length (in bytes)
285
+ */
286
+ void sph_hamsi512(void *cc, const void *data, size_t len);
287
+
288
+ /**
289
+ * Terminate the current Hamsi-512 computation and output the result into
290
+ * the provided buffer. The destination buffer must be wide enough to
291
+ * accomodate the result (64 bytes). The context is automatically
292
+ * reinitialized.
293
+ *
294
+ * @param cc the Hamsi-512 context
295
+ * @param dst the destination buffer
296
+ */
297
+ void sph_hamsi512_close(void *cc, void *dst);
298
+
299
+ /**
300
+ * Add a few additional bits (0 to 7) to the current computation, then
301
+ * terminate it and output the result in the provided buffer, which must
302
+ * be wide enough to accomodate the result (64 bytes). If bit number i
303
+ * in <code>ub</code> has value 2^i, then the extra bits are those
304
+ * numbered 7 downto 8-n (this is the big-endian convention at the byte
305
+ * level). The context is automatically reinitialized.
306
+ *
307
+ * @param cc the Hamsi-512 context
308
+ * @param ub the extra bits
309
+ * @param n the number of extra bits (0 to 7)
310
+ * @param dst the destination buffer
311
+ */
312
+ void sph_hamsi512_addbits_and_close(
313
+ void *cc, unsigned ub, unsigned n, void *dst);
314
+
315
+
316
+
317
+ #ifdef __cplusplus
318
+ }
319
+ #endif
320
+
321
+ #endif