diff --git a/stratum/algos/makefile b/stratum/algos/makefile index 815c7eb..c6e5200 100644 --- a/stratum/algos/makefile +++ b/stratum/algos/makefile @@ -20,7 +20,7 @@ SOURCES=lyra2re.c lyra2v2.c Lyra2.c lyra2z.c Lyra2z.c Sponge.c \ argon2a.c ar2/blake2b.c ar2/argon2.c ar2/ref.c ar2/cores.c ar2/ar2-scrypt-jane.c \ a5a.c a5amath.c \ hive.c pomelo.c \ - phi.c polytimos.c skunk.c sib.c veltor.c gost.c x11evo.c + phi.c polytimos.c skunk.c sib.c veltor.c gost.c x11evo.c vitalium.c OBJECTS=$(SOURCES:%.c=%.o) $(SOURCES:%.cpp=%.o) OUTPUT=libalgos.a diff --git a/stratum/algos/vitalium.c b/stratum/algos/vitalium.c new file mode 100644 index 0000000..2a3b27c --- /dev/null +++ b/stratum/algos/vitalium.c @@ -0,0 +1,87 @@ +#include "vitalium.h" +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "gost.h" + +#include "common.h" + +void vitalium_hash(const char* input, char* output, uint32_t len) +{ + sph_skein512_context ctx_skein; + sph_cubehash512_context ctx_cubehash; + sph_fugue512_context ctx_fugue; + sph_gost512_context ctx_gost; + sph_echo512_context ctx_echo; + sph_shavite512_context ctx_shavite; + sph_luffa512_context ctx_luffa; + + //these uint512 in the c++ source of the client are backed by an array of uint32 + uint32_t hashA[16], hashB[16]; + + sph_skein512_init(&ctx_skein); + sph_skein512 (&ctx_skein, input, len); + sph_skein512_close (&ctx_skein, hashA); + + sph_cubehash512_init(&ctx_cubehash); + sph_cubehash512 (&ctx_cubehash, hashA, 64); + sph_cubehash512_close(&ctx_cubehash, hashB); + + sph_fugue512_init(&ctx_fugue); + sph_fugue512 (&ctx_fugue, hashB, 64); + sph_fugue512_close(&ctx_fugue, hashA); + + sph_gost512_init(&ctx_gost); + sph_gost512 (&ctx_gost, hashA, 64); + sph_gost512_close (&ctx_gost, hashB); + + sph_echo512_init(&ctx_echo); + sph_echo512 (&ctx_echo, hashB, 64); + sph_echo512_close(&ctx_echo, hashA); + + sph_shavite512_init(&ctx_shavite); + sph_shavite512 (&ctx_shavite, hashA, 64); + sph_shavite512_close(&ctx_shavite, hashB); + + sph_luffa512_init (&ctx_luffa); + sph_luffa512 (&ctx_luffa, hashB, 64); + sph_luffa512_close (&ctx_luffa, hashA); + + sph_gost512_init(&ctx_gost); + sph_gost512 (&ctx_gost, hashA, 64); + sph_gost512_close (&ctx_gost, hashB); + + sph_cubehash512_init(&ctx_cubehash); + sph_cubehash512 (&ctx_cubehash, hashB, 64); + sph_cubehash512_close(&ctx_cubehash, hashA); + + sph_fugue512_init(&ctx_fugue); + sph_fugue512 (&ctx_fugue, hashA, 64); + sph_fugue512_close(&ctx_fugue, hashB); + + sph_gost512_init(&ctx_gost); + sph_gost512 (&ctx_gost, hashB, 64); + sph_gost512_close (&ctx_gost, hashA); + + sph_echo512_init(&ctx_echo); + sph_echo512 (&ctx_echo, hashA, 64); + sph_echo512_close(&ctx_echo, hashB); + + sph_shavite512_init(&ctx_shavite); + sph_shavite512 (&ctx_shavite, hashB, 64); + sph_shavite512_close(&ctx_shavite, hashA); + + sph_luffa512_init (&ctx_luffa); + sph_luffa512 (&ctx_luffa, hashA, 64); + sph_luffa512_close (&ctx_luffa, hashB); + + memcpy(output, hashB, 32); +} diff --git a/stratum/algos/vitalium.h b/stratum/algos/vitalium.h new file mode 100644 index 0000000..e29b3bc --- /dev/null +++ b/stratum/algos/vitalium.h @@ -0,0 +1,16 @@ +#ifndef VITALITY_H +#define VITALITY_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void vitalium_hash(const char* input, char* output, uint32_t len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/stratum/config.sample/vitalium.conf b/stratum/config.sample/vitalium.conf new file mode 100644 index 0000000..ff522cb --- /dev/null +++ b/stratum/config.sample/vitalium.conf @@ -0,0 +1,16 @@ +[TCP] +server = yaamp.com +port = 3233 +password = tu8tu5 + +[SQL] +host = yaampdb +database = yaamp +username = root +password = patofpaq + +[STRATUM] +algo = vitalium +difficulty = 0.001 +max_ttf = 400000000 + diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index 65a14de..8f6f09e 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -176,6 +176,7 @@ YAAMP_ALGO g_algos[] = {"veltor", veltor_hash, 1, 0, 0}, {"velvet", velvet_hash, 0x10000, 0, 0}, {"argon2", argon2_hash, 0x10000, 0, sha256_hash_hex }, + {"vitalium", vitalium_hash, 1, 0, 0}, {"sha256t", sha256t_hash, 1, 0, 0}, // sha256 3x diff --git a/stratum/stratum.h b/stratum/stratum.h index d8638fb..6604d1a 100644 --- a/stratum/stratum.h +++ b/stratum/stratum.h @@ -200,4 +200,5 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len); #include "algos/veltor.h" #include "algos/velvet.h" #include "algos/argon2a.h" +#include "algos/vitalium.h" diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index 0a9d691..0167c94 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -58,6 +58,7 @@ function yaamp_get_algos() 'vanilla', 'veltor', 'velvet', + 'vitalium', 'yescrypt', 'yescryptR16', 'yescryptR32', @@ -178,9 +179,10 @@ function getAlgoColors($algo) 'bitcore' => '#f790c0', 'skunk' => '#dedefe', 'tribus' => '#c0d0d0', - 'a5a' => '#f0f0f0', + 'a5a' => '#f0f0f0', 'vanilla' => '#f0f0f0', 'velvet' => '#aac0cc', + 'vitalium' => '#f0b0a0', 'whirlpool' => '#d0e0e0', 'yescrypt' => '#e0d0e0', 'yescryptR16' => '#e2d0e2', @@ -251,6 +253,7 @@ function getAlgoPort($algo) 'm7m' => 6033, 'veltor' => 5034, 'velvet' => 6133, + 'vitalium' => 3233, 'yescrypt' => 6233, 'yescryptR16' => 6333, 'yescryptR32' => 6343,