@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.
- package/.travis.yml +5 -0
- package/LICENSE +674 -0
- package/README.md +87 -0
- package/appveyor.yml +12 -0
- package/argon2/.gitattributes +10 -0
- package/argon2/.travis.yml +25 -0
- package/argon2/Argon2.sln +160 -0
- package/argon2/CHANGELOG.md +32 -0
- package/argon2/CMakeLists.txt +87 -0
- package/argon2/LICENSE +314 -0
- package/argon2/Makefile +196 -0
- package/argon2/README.md +297 -0
- package/argon2/appveyor.yml +40 -0
- package/argon2/argon2-specs.pdf +0 -0
- package/argon2/export.sh +7 -0
- package/argon2/include/argon2.h +427 -0
- package/argon2/latex/CMakeLists.txt +34 -0
- package/argon2/latex/IEEEtran.cls +6347 -0
- package/argon2/latex/Makefile +18 -0
- package/argon2/latex/argon2-specs.tex +920 -0
- package/argon2/latex/pics/argon2-par.pdf +0 -0
- package/argon2/latex/pics/compression.pdf +0 -0
- package/argon2/latex/pics/generic.pdf +0 -0
- package/argon2/latex/pics/power-distribution.jpg +0 -0
- package/argon2/latex/tradeoff.bib +822 -0
- package/argon2/libargon2.pc +16 -0
- package/argon2/man/CMakeLists.txt +8 -0
- package/argon2/man/argon2.1 +57 -0
- package/argon2/meson.build +16 -0
- package/argon2/meson_options.txt +1 -0
- package/argon2/src/CMakeLists.txt +147 -0
- package/argon2/src/argon2.c +452 -0
- package/argon2/src/argon2.pc.in +11 -0
- package/argon2/src/blake2/blake2-impl.h +156 -0
- package/argon2/src/blake2/blake2.h +89 -0
- package/argon2/src/blake2/blake2b.c +390 -0
- package/argon2/src/blake2/blamka-round-opt.h +471 -0
- package/argon2/src/blake2/blamka-round-ref.h +56 -0
- package/argon2/src/core.c +634 -0
- package/argon2/src/core.h +228 -0
- package/argon2/src/encoding.c +467 -0
- package/argon2/src/encoding.h +57 -0
- package/argon2/src/genkat.h +51 -0
- package/argon2/src/meson.build +68 -0
- package/argon2/src/opt.c +283 -0
- package/argon2/src/optimization/CMakeLists.txt +10 -0
- package/argon2/src/ref.c +194 -0
- package/argon2/src/thread.c +57 -0
- package/argon2/src/thread.h +67 -0
- package/argon2/tests/CMakeLists.txt +43 -0
- package/argon2/tests/bench.c +111 -0
- package/argon2/tests/genkat.c +207 -0
- package/argon2/tests/kats/argon2d +12304 -0
- package/argon2/tests/kats/argon2d.shasum +1 -0
- package/argon2/tests/kats/argon2d_v16 +12304 -0
- package/argon2/tests/kats/argon2d_v16.shasum +1 -0
- package/argon2/tests/kats/argon2i +12304 -0
- package/argon2/tests/kats/argon2i.shasum +1 -0
- package/argon2/tests/kats/argon2i_v16 +12304 -0
- package/argon2/tests/kats/argon2i_v16.shasum +1 -0
- package/argon2/tests/kats/argon2id +12304 -0
- package/argon2/tests/kats/argon2id.shasum +1 -0
- package/argon2/tests/kats/argon2id_v16 +12304 -0
- package/argon2/tests/kats/argon2id_v16.shasum +1 -0
- package/argon2/tests/kats/check-sums.ps1 +48 -0
- package/argon2/tests/kats/check-sums.sh +16 -0
- package/argon2/tests/kats/test.ps1 +132 -0
- package/argon2/tests/kats/test.sh +117 -0
- package/argon2/tests/meson.build +34 -0
- package/argon2/tests/test.c +289 -0
- package/argon2/tool/CMakeLists.txt +7 -0
- package/argon2/tool/main.c +339 -0
- package/argon2/tool/meson.build +8 -0
- package/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +226 -0
- package/argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +69 -0
- package/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +226 -0
- package/argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +69 -0
- package/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +225 -0
- package/argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +66 -0
- package/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +239 -0
- package/argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +72 -0
- package/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +227 -0
- package/argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +69 -0
- package/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +226 -0
- package/argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +69 -0
- package/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +226 -0
- package/argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +69 -0
- package/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +225 -0
- package/argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +66 -0
- package/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +227 -0
- package/argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +72 -0
- package/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +226 -0
- package/argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +69 -0
- package/bcrypt.c +566 -0
- package/bcrypt.h +14 -0
- package/binding.gyp +93 -0
- package/blake.c +17 -0
- package/blake.h +16 -0
- package/boolberry.cc +11 -0
- package/boolberry.h +6 -0
- package/build/Makefile +354 -0
- package/build/Release/.deps/Release/multihashing.node.d +1 -0
- package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/argon2.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/blake2/blake2b.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/core.o.d +10 -0
- package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/encoding.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/ref.o.d +14 -0
- package/build/Release/.deps/Release/obj.target/multihashing/argon2/src/thread.o.d +5 -0
- package/build/Release/.deps/Release/obj.target/multihashing/bcrypt.o.d +4 -0
- package/build/Release/.deps/Release/obj.target/multihashing/blake.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/boolberry.o.d +12 -0
- package/build/Release/.deps/Release/obj.target/multihashing/c11.o.d +20 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/aesb.o.d +3 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_blake256.o.d +5 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_groestl.o.d +10 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_jh.o.d +9 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_keccak.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/c_skein.o.d +10 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/hash.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/oaes_lib.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/crypto/wild_keccak.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_dark.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_dark_lite.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_fast.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_lite.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_soft_shell.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_turtle.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/cryptonight_turtle_lite.o.d +18 -0
- package/build/Release/.deps/Release/obj.target/multihashing/fresh.o.d +10 -0
- package/build/Release/.deps/Release/obj.target/multihashing/fugue.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/groestl.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/hefty1.o.d +12 -0
- package/build/Release/.deps/Release/obj.target/multihashing/keccak.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/multihashing.o.d +155 -0
- package/build/Release/.deps/Release/obj.target/multihashing/nist5.o.d +12 -0
- package/build/Release/.deps/Release/obj.target/multihashing/quark.o.d +14 -0
- package/build/Release/.deps/Release/obj.target/multihashing/qubit.o.d +12 -0
- package/build/Release/.deps/Release/obj.target/multihashing/scryptjane.o.d +30 -0
- package/build/Release/.deps/Release/obj.target/multihashing/scryptn.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha1.o.d +24 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/aes_helper.o.d +5 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/hamsi.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_blake.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_bmw.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_cubehash.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_echo.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_fugue.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_groestl.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_hefty1.o.d +5 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_jh.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_keccak.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_luffa.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_shabal.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_shavite.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_simd.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_skein.o.d +6 -0
- package/build/Release/.deps/Release/obj.target/multihashing/sha3/sph_whirlpool.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/shavite3.o.d +7 -0
- package/build/Release/.deps/Release/obj.target/multihashing/skein.o.d +8 -0
- package/build/Release/.deps/Release/obj.target/multihashing/x11.o.d +20 -0
- package/build/Release/.deps/Release/obj.target/multihashing/x13.o.d +23 -0
- package/build/Release/.deps/Release/obj.target/multihashing/x15.o.d +26 -0
- package/build/Release/.deps/Release/obj.target/multihashing.node.d +1 -0
- package/build/Release/multihashing.node +0 -0
- package/build/binding.Makefile +6 -0
- package/build/multihashing.target.mk +255 -0
- package/c11.c +85 -0
- package/c11.h +17 -0
- package/crypto/aesb.c +177 -0
- package/crypto/c_blake256.c +326 -0
- package/crypto/c_blake256.h +43 -0
- package/crypto/c_groestl.c +360 -0
- package/crypto/c_groestl.h +56 -0
- package/crypto/c_jh.c +367 -0
- package/crypto/c_jh.h +20 -0
- package/crypto/c_keccak.c +112 -0
- package/crypto/c_keccak.h +26 -0
- package/crypto/c_skein.c +2036 -0
- package/crypto/c_skein.h +45 -0
- package/crypto/crypto.h +186 -0
- package/crypto/cryptonote_core/account.cpp +50 -0
- package/crypto/cryptonote_core/account.h +61 -0
- package/crypto/cryptonote_core/cryptonote_basic_impl.cpp +186 -0
- package/crypto/cryptonote_core/cryptonote_basic_impl.h +65 -0
- package/crypto/cryptonote_core/cryptonote_format_utils.cpp +766 -0
- package/crypto/cryptonote_core/cryptonote_format_utils.h +30 -0
- package/crypto/cryptonote_protocol/cryptonote_protocol_defs.h +152 -0
- package/crypto/groestl_tables.h +38 -0
- package/crypto/hash-ops.h +57 -0
- package/crypto/hash.c +24 -0
- package/crypto/hash.h +22 -0
- package/crypto/int-util.h +230 -0
- package/crypto/oaes_config.h +50 -0
- package/crypto/oaes_lib.c +1468 -0
- package/crypto/oaes_lib.h +215 -0
- package/crypto/skein_port.h +190 -0
- package/crypto/variant2_int_sqrt.h +168 -0
- package/crypto/wild_keccak.cpp +119 -0
- package/crypto/wild_keccak.h +168 -0
- package/cryptonight.c +300 -0
- package/cryptonight.h +17 -0
- package/cryptonight_dark.c +300 -0
- package/cryptonight_dark.h +17 -0
- package/cryptonight_dark_lite.c +300 -0
- package/cryptonight_dark_lite.h +17 -0
- package/cryptonight_fast.c +300 -0
- package/cryptonight_fast.h +17 -0
- package/cryptonight_lite.c +300 -0
- package/cryptonight_lite.h +17 -0
- package/cryptonight_soft_shell.c +298 -0
- package/cryptonight_soft_shell.h +17 -0
- package/cryptonight_turtle.c +300 -0
- package/cryptonight_turtle.h +17 -0
- package/cryptonight_turtle_lite.c +300 -0
- package/cryptonight_turtle_lite.h +17 -0
- package/fresh.c +42 -0
- package/fresh.h +16 -0
- package/fugue.c +12 -0
- package/fugue.h +16 -0
- package/groestl.c +40 -0
- package/groestl.h +17 -0
- package/hefty1.c +63 -0
- package/hefty1.h +16 -0
- package/index.js +1 -0
- package/keccak.c +14 -0
- package/keccak.h +16 -0
- package/leocuvee-wrkzcoin-multi-hashing-0.0.20.tgz +0 -0
- package/multihashing.cc +699 -0
- package/nist5.c +46 -0
- package/nist5.h +16 -0
- package/package.json +56 -0
- package/quark.c +210 -0
- package/quark.h +16 -0
- package/qubit.c +45 -0
- package/qubit.h +16 -0
- package/scryptjane/scrypt-jane-chacha.h +132 -0
- package/scryptjane/scrypt-jane-hash.h +48 -0
- package/scryptjane/scrypt-jane-hash_keccak.h +168 -0
- package/scryptjane/scrypt-jane-hash_sha256.h +135 -0
- package/scryptjane/scrypt-jane-mix_chacha-avx.h +340 -0
- package/scryptjane/scrypt-jane-mix_chacha-sse2.h +371 -0
- package/scryptjane/scrypt-jane-mix_chacha-ssse3.h +348 -0
- package/scryptjane/scrypt-jane-mix_chacha.h +69 -0
- package/scryptjane/scrypt-jane-mix_salsa-avx.h +381 -0
- package/scryptjane/scrypt-jane-mix_salsa-sse2.h +443 -0
- package/scryptjane/scrypt-jane-mix_salsa.h +70 -0
- package/scryptjane/scrypt-jane-pbkdf2.h +112 -0
- package/scryptjane/scrypt-jane-portable-x86.h +364 -0
- package/scryptjane/scrypt-jane-portable.h +281 -0
- package/scryptjane/scrypt-jane-romix-basic.h +67 -0
- package/scryptjane/scrypt-jane-romix-template.h +118 -0
- package/scryptjane/scrypt-jane-romix.h +27 -0
- package/scryptjane/scrypt-jane-salsa.h +106 -0
- package/scryptjane/scrypt-jane-test-vectors.h +261 -0
- package/scryptjane.c +223 -0
- package/scryptjane.h +36 -0
- package/scryptn.c +258 -0
- package/scryptn.h +16 -0
- package/sha1.c +65 -0
- package/sha1.h +16 -0
- package/sha256.h +440 -0
- package/sha3/aes_helper.c +392 -0
- package/sha3/hamsi.c +867 -0
- package/sha3/hamsi_helper.c +39648 -0
- package/sha3/md_helper.c +347 -0
- package/sha3/sph_blake.c +1114 -0
- package/sha3/sph_blake.h +327 -0
- package/sha3/sph_bmw.c +965 -0
- package/sha3/sph_bmw.h +328 -0
- package/sha3/sph_cubehash.c +723 -0
- package/sha3/sph_cubehash.h +292 -0
- package/sha3/sph_echo.c +1031 -0
- package/sha3/sph_echo.h +320 -0
- package/sha3/sph_fugue.c +1208 -0
- package/sha3/sph_fugue.h +81 -0
- package/sha3/sph_groestl.c +3119 -0
- package/sha3/sph_groestl.h +329 -0
- package/sha3/sph_hamsi.h +321 -0
- package/sha3/sph_hefty1.c +378 -0
- package/sha3/sph_hefty1.h +66 -0
- package/sha3/sph_jh.c +1116 -0
- package/sha3/sph_jh.h +298 -0
- package/sha3/sph_keccak.c +1824 -0
- package/sha3/sph_keccak.h +293 -0
- package/sha3/sph_luffa.c +1426 -0
- package/sha3/sph_luffa.h +296 -0
- package/sha3/sph_shabal.c +806 -0
- package/sha3/sph_shabal.h +344 -0
- package/sha3/sph_shavite.c +1764 -0
- package/sha3/sph_shavite.h +314 -0
- package/sha3/sph_simd.c +1799 -0
- package/sha3/sph_simd.h +309 -0
- package/sha3/sph_skein.c +1254 -0
- package/sha3/sph_skein.h +298 -0
- package/sha3/sph_types.h +1976 -0
- package/sha3/sph_whirlpool.c +3480 -0
- package/sha3/sph_whirlpool.h +209 -0
- package/shavite3.c +24 -0
- package/shavite3.h +16 -0
- package/skein.c +26 -0
- package/skein.h +16 -0
- package/stdint.h +259 -0
- package/tests/argon2-tests.js +16 -0
- package/tests/benchmark.js +36 -0
- package/tests/cryptonight-tests.js +189 -0
- package/tests/cryptonight_monero.js +53 -0
- package/tests/test.js +16 -0
- package/x11.c +85 -0
- package/x11.h +16 -0
- package/x13.c +97 -0
- package/x13.h +5 -0
- package/x15.c +106 -0
- package/x15.h +16 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/* $Id: sph_shabal.h 175 2010-05-07 16:03:20Z tp $ */
|
|
2
|
+
/**
|
|
3
|
+
* Shabal interface. Shabal is a family of functions which differ by
|
|
4
|
+
* their output size; this implementation defines Shabal for output
|
|
5
|
+
* sizes 192, 224, 256, 384 and 512 bits.
|
|
6
|
+
*
|
|
7
|
+
* ==========================(LICENSE BEGIN)============================
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
|
|
10
|
+
*
|
|
11
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
12
|
+
* a copy of this software and associated documentation files (the
|
|
13
|
+
* "Software"), to deal in the Software without restriction, including
|
|
14
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
15
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
16
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
17
|
+
* the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be
|
|
20
|
+
* included in all copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
23
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
24
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
25
|
+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
26
|
+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
27
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
28
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
29
|
+
*
|
|
30
|
+
* ===========================(LICENSE END)=============================
|
|
31
|
+
*
|
|
32
|
+
* @file sph_shabal.h
|
|
33
|
+
* @author Thomas Pornin <thomas.pornin@cryptolog.com>
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
#ifndef SPH_SHABAL_H__
|
|
37
|
+
#define SPH_SHABAL_H__
|
|
38
|
+
|
|
39
|
+
#include <stddef.h>
|
|
40
|
+
#include "sph_types.h"
|
|
41
|
+
|
|
42
|
+
#ifdef __cplusplus
|
|
43
|
+
extern "C"{
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Output size (in bits) for Shabal-192.
|
|
48
|
+
*/
|
|
49
|
+
#define SPH_SIZE_shabal192 192
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Output size (in bits) for Shabal-224.
|
|
53
|
+
*/
|
|
54
|
+
#define SPH_SIZE_shabal224 224
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Output size (in bits) for Shabal-256.
|
|
58
|
+
*/
|
|
59
|
+
#define SPH_SIZE_shabal256 256
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Output size (in bits) for Shabal-384.
|
|
63
|
+
*/
|
|
64
|
+
#define SPH_SIZE_shabal384 384
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Output size (in bits) for Shabal-512.
|
|
68
|
+
*/
|
|
69
|
+
#define SPH_SIZE_shabal512 512
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* This structure is a context for Shabal computations: it contains the
|
|
73
|
+
* intermediate values and some data from the last entered block. Once
|
|
74
|
+
* a Shabal computation has been performed, the context can be reused for
|
|
75
|
+
* another computation.
|
|
76
|
+
*
|
|
77
|
+
* The contents of this structure are private. A running Shabal 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
|
+
size_t ptr;
|
|
85
|
+
sph_u32 A[12], B[16], C[16];
|
|
86
|
+
sph_u32 Whigh, Wlow;
|
|
87
|
+
#endif
|
|
88
|
+
} sph_shabal_context;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Type for a Shabal-192 context (identical to the common context).
|
|
92
|
+
*/
|
|
93
|
+
typedef sph_shabal_context sph_shabal192_context;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Type for a Shabal-224 context (identical to the common context).
|
|
97
|
+
*/
|
|
98
|
+
typedef sph_shabal_context sph_shabal224_context;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Type for a Shabal-256 context (identical to the common context).
|
|
102
|
+
*/
|
|
103
|
+
typedef sph_shabal_context sph_shabal256_context;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Type for a Shabal-384 context (identical to the common context).
|
|
107
|
+
*/
|
|
108
|
+
typedef sph_shabal_context sph_shabal384_context;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Type for a Shabal-512 context (identical to the common context).
|
|
112
|
+
*/
|
|
113
|
+
typedef sph_shabal_context sph_shabal512_context;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Initialize a Shabal-192 context. This process performs no memory allocation.
|
|
117
|
+
*
|
|
118
|
+
* @param cc the Shabal-192 context (pointer to a
|
|
119
|
+
* <code>sph_shabal192_context</code>)
|
|
120
|
+
*/
|
|
121
|
+
void sph_shabal192_init(void *cc);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Process some data bytes. It is acceptable that <code>len</code> is zero
|
|
125
|
+
* (in which case this function does nothing).
|
|
126
|
+
*
|
|
127
|
+
* @param cc the Shabal-192 context
|
|
128
|
+
* @param data the input data
|
|
129
|
+
* @param len the input data length (in bytes)
|
|
130
|
+
*/
|
|
131
|
+
void sph_shabal192(void *cc, const void *data, size_t len);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Terminate the current Shabal-192 computation and output the result into
|
|
135
|
+
* the provided buffer. The destination buffer must be wide enough to
|
|
136
|
+
* accomodate the result (24 bytes). The context is automatically
|
|
137
|
+
* reinitialized.
|
|
138
|
+
*
|
|
139
|
+
* @param cc the Shabal-192 context
|
|
140
|
+
* @param dst the destination buffer
|
|
141
|
+
*/
|
|
142
|
+
void sph_shabal192_close(void *cc, void *dst);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Add a few additional bits (0 to 7) to the current computation, then
|
|
146
|
+
* terminate it and output the result in the provided buffer, which must
|
|
147
|
+
* be wide enough to accomodate the result (24 bytes). If bit number i
|
|
148
|
+
* in <code>ub</code> has value 2^i, then the extra bits are those
|
|
149
|
+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
|
|
150
|
+
* level). The context is automatically reinitialized.
|
|
151
|
+
*
|
|
152
|
+
* @param cc the Shabal-192 context
|
|
153
|
+
* @param ub the extra bits
|
|
154
|
+
* @param n the number of extra bits (0 to 7)
|
|
155
|
+
* @param dst the destination buffer
|
|
156
|
+
*/
|
|
157
|
+
void sph_shabal192_addbits_and_close(
|
|
158
|
+
void *cc, unsigned ub, unsigned n, void *dst);
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Initialize a Shabal-224 context. This process performs no memory allocation.
|
|
162
|
+
*
|
|
163
|
+
* @param cc the Shabal-224 context (pointer to a
|
|
164
|
+
* <code>sph_shabal224_context</code>)
|
|
165
|
+
*/
|
|
166
|
+
void sph_shabal224_init(void *cc);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Process some data bytes. It is acceptable that <code>len</code> is zero
|
|
170
|
+
* (in which case this function does nothing).
|
|
171
|
+
*
|
|
172
|
+
* @param cc the Shabal-224 context
|
|
173
|
+
* @param data the input data
|
|
174
|
+
* @param len the input data length (in bytes)
|
|
175
|
+
*/
|
|
176
|
+
void sph_shabal224(void *cc, const void *data, size_t len);
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Terminate the current Shabal-224 computation and output the result into
|
|
180
|
+
* the provided buffer. The destination buffer must be wide enough to
|
|
181
|
+
* accomodate the result (28 bytes). The context is automatically
|
|
182
|
+
* reinitialized.
|
|
183
|
+
*
|
|
184
|
+
* @param cc the Shabal-224 context
|
|
185
|
+
* @param dst the destination buffer
|
|
186
|
+
*/
|
|
187
|
+
void sph_shabal224_close(void *cc, void *dst);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Add a few additional bits (0 to 7) to the current computation, then
|
|
191
|
+
* terminate it and output the result in the provided buffer, which must
|
|
192
|
+
* be wide enough to accomodate the result (28 bytes). If bit number i
|
|
193
|
+
* in <code>ub</code> has value 2^i, then the extra bits are those
|
|
194
|
+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
|
|
195
|
+
* level). The context is automatically reinitialized.
|
|
196
|
+
*
|
|
197
|
+
* @param cc the Shabal-224 context
|
|
198
|
+
* @param ub the extra bits
|
|
199
|
+
* @param n the number of extra bits (0 to 7)
|
|
200
|
+
* @param dst the destination buffer
|
|
201
|
+
*/
|
|
202
|
+
void sph_shabal224_addbits_and_close(
|
|
203
|
+
void *cc, unsigned ub, unsigned n, void *dst);
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Initialize a Shabal-256 context. This process performs no memory allocation.
|
|
207
|
+
*
|
|
208
|
+
* @param cc the Shabal-256 context (pointer to a
|
|
209
|
+
* <code>sph_shabal256_context</code>)
|
|
210
|
+
*/
|
|
211
|
+
void sph_shabal256_init(void *cc);
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Process some data bytes. It is acceptable that <code>len</code> is zero
|
|
215
|
+
* (in which case this function does nothing).
|
|
216
|
+
*
|
|
217
|
+
* @param cc the Shabal-256 context
|
|
218
|
+
* @param data the input data
|
|
219
|
+
* @param len the input data length (in bytes)
|
|
220
|
+
*/
|
|
221
|
+
void sph_shabal256(void *cc, const void *data, size_t len);
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Terminate the current Shabal-256 computation and output the result into
|
|
225
|
+
* the provided buffer. The destination buffer must be wide enough to
|
|
226
|
+
* accomodate the result (32 bytes). The context is automatically
|
|
227
|
+
* reinitialized.
|
|
228
|
+
*
|
|
229
|
+
* @param cc the Shabal-256 context
|
|
230
|
+
* @param dst the destination buffer
|
|
231
|
+
*/
|
|
232
|
+
void sph_shabal256_close(void *cc, void *dst);
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Add a few additional bits (0 to 7) to the current computation, then
|
|
236
|
+
* terminate it and output the result in the provided buffer, which must
|
|
237
|
+
* be wide enough to accomodate the result (32 bytes). If bit number i
|
|
238
|
+
* in <code>ub</code> has value 2^i, then the extra bits are those
|
|
239
|
+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
|
|
240
|
+
* level). The context is automatically reinitialized.
|
|
241
|
+
*
|
|
242
|
+
* @param cc the Shabal-256 context
|
|
243
|
+
* @param ub the extra bits
|
|
244
|
+
* @param n the number of extra bits (0 to 7)
|
|
245
|
+
* @param dst the destination buffer
|
|
246
|
+
*/
|
|
247
|
+
void sph_shabal256_addbits_and_close(
|
|
248
|
+
void *cc, unsigned ub, unsigned n, void *dst);
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Initialize a Shabal-384 context. This process performs no memory allocation.
|
|
252
|
+
*
|
|
253
|
+
* @param cc the Shabal-384 context (pointer to a
|
|
254
|
+
* <code>sph_shabal384_context</code>)
|
|
255
|
+
*/
|
|
256
|
+
void sph_shabal384_init(void *cc);
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Process some data bytes. It is acceptable that <code>len</code> is zero
|
|
260
|
+
* (in which case this function does nothing).
|
|
261
|
+
*
|
|
262
|
+
* @param cc the Shabal-384 context
|
|
263
|
+
* @param data the input data
|
|
264
|
+
* @param len the input data length (in bytes)
|
|
265
|
+
*/
|
|
266
|
+
void sph_shabal384(void *cc, const void *data, size_t len);
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Terminate the current Shabal-384 computation and output the result into
|
|
270
|
+
* the provided buffer. The destination buffer must be wide enough to
|
|
271
|
+
* accomodate the result (48 bytes). The context is automatically
|
|
272
|
+
* reinitialized.
|
|
273
|
+
*
|
|
274
|
+
* @param cc the Shabal-384 context
|
|
275
|
+
* @param dst the destination buffer
|
|
276
|
+
*/
|
|
277
|
+
void sph_shabal384_close(void *cc, void *dst);
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Add a few additional bits (0 to 7) to the current computation, then
|
|
281
|
+
* terminate it and output the result in the provided buffer, which must
|
|
282
|
+
* be wide enough to accomodate the result (48 bytes). If bit number i
|
|
283
|
+
* in <code>ub</code> has value 2^i, then the extra bits are those
|
|
284
|
+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
|
|
285
|
+
* level). The context is automatically reinitialized.
|
|
286
|
+
*
|
|
287
|
+
* @param cc the Shabal-384 context
|
|
288
|
+
* @param ub the extra bits
|
|
289
|
+
* @param n the number of extra bits (0 to 7)
|
|
290
|
+
* @param dst the destination buffer
|
|
291
|
+
*/
|
|
292
|
+
void sph_shabal384_addbits_and_close(
|
|
293
|
+
void *cc, unsigned ub, unsigned n, void *dst);
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Initialize a Shabal-512 context. This process performs no memory allocation.
|
|
297
|
+
*
|
|
298
|
+
* @param cc the Shabal-512 context (pointer to a
|
|
299
|
+
* <code>sph_shabal512_context</code>)
|
|
300
|
+
*/
|
|
301
|
+
void sph_shabal512_init(void *cc);
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Process some data bytes. It is acceptable that <code>len</code> is zero
|
|
305
|
+
* (in which case this function does nothing).
|
|
306
|
+
*
|
|
307
|
+
* @param cc the Shabal-512 context
|
|
308
|
+
* @param data the input data
|
|
309
|
+
* @param len the input data length (in bytes)
|
|
310
|
+
*/
|
|
311
|
+
void sph_shabal512(void *cc, const void *data, size_t len);
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Terminate the current Shabal-512 computation and output the result into
|
|
315
|
+
* the provided buffer. The destination buffer must be wide enough to
|
|
316
|
+
* accomodate the result (64 bytes). The context is automatically
|
|
317
|
+
* reinitialized.
|
|
318
|
+
*
|
|
319
|
+
* @param cc the Shabal-512 context
|
|
320
|
+
* @param dst the destination buffer
|
|
321
|
+
*/
|
|
322
|
+
void sph_shabal512_close(void *cc, void *dst);
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Add a few additional bits (0 to 7) to the current computation, then
|
|
326
|
+
* terminate it and output the result in the provided buffer, which must
|
|
327
|
+
* be wide enough to accomodate the result (64 bytes). If bit number i
|
|
328
|
+
* in <code>ub</code> has value 2^i, then the extra bits are those
|
|
329
|
+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
|
|
330
|
+
* level). The context is automatically reinitialized.
|
|
331
|
+
*
|
|
332
|
+
* @param cc the Shabal-512 context
|
|
333
|
+
* @param ub the extra bits
|
|
334
|
+
* @param n the number of extra bits (0 to 7)
|
|
335
|
+
* @param dst the destination buffer
|
|
336
|
+
*/
|
|
337
|
+
void sph_shabal512_addbits_and_close(
|
|
338
|
+
void *cc, unsigned ub, unsigned n, void *dst);
|
|
339
|
+
|
|
340
|
+
#ifdef __cplusplus
|
|
341
|
+
}
|
|
342
|
+
#endif
|
|
343
|
+
|
|
344
|
+
#endif
|