diff --git a/rc.local b/rc.local index 31f0d7e..73d0c2f 100644 --- a/rc.local +++ b/rc.local @@ -26,7 +26,10 @@ screen -dmS x15 $STRATUM_DIR/run.sh x15 screen -dmS sha $STRATUM_DIR/run.sh sha screen -dmS scrypt $STRATUM_DIR/run.sh scrypt screen -dmS scryptn $STRATUM_DIR/run.sh scryptn +screen -dmS luffa $STRATUM_DIR/run.sh luffa screen -dmS neo $STRATUM_DIR/run.sh neo +screen -dmS nist5 $STRATUM_DIR/run.sh nist5 +screen -dmS penta $STRATUM_DIR/run.sh penta screen -dmS quark $STRATUM_DIR/run.sh quark screen -dmS qubit $STRATUM_DIR/run.sh qubit #screen -dmS groestl $STRATUM_DIR/run.sh groestl # dmd-gr -m 256 diff --git a/stratum/algos/luffa.c b/stratum/algos/luffa.c new file mode 100644 index 0000000..f8a9136 --- /dev/null +++ b/stratum/algos/luffa.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#include "luffa.h" + +#include "../sha3/sph_luffa.h" + +void luffa_hash(const char* input, char* output, uint32_t len) +{ + unsigned char hash[64]; + sph_luffa512_context ctx_luffa; + + sph_luffa512_init(&ctx_luffa); + sph_luffa512 (&ctx_luffa, input, 80); + sph_luffa512_close(&ctx_luffa, (void*) hash); + + memcpy(output, hash, 32); +} diff --git a/stratum/algos/luffa.h b/stratum/algos/luffa.h new file mode 100644 index 0000000..5193fc0 --- /dev/null +++ b/stratum/algos/luffa.h @@ -0,0 +1,16 @@ +#ifndef LUFFA_H +#define LUFFA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void luffa_hash(const char* input, char* output, uint32_t len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/stratum/algos/makefile b/stratum/algos/makefile index 8896af7..bdb2916 100644 --- a/stratum/algos/makefile +++ b/stratum/algos/makefile @@ -9,7 +9,7 @@ LDFLAGS=-O2 SOURCES=lyra2re.c lyra2v2.c Lyra2.c Sponge.c blake.c scrypt.c c11.c x11.c x13.c sha256.c keccak.c \ x14.c x15.c nist5.c fresh.c quark.c neoscrypt.c scryptn.c qubit.c skein.c groestl.c \ - skein2.c zr5.c drop.c bmw.c + skein2.c zr5.c drop.c bmw.c luffa.c pentablake.c OBJECTS=$(SOURCES:.c=.o) OUTPUT=libalgos.a diff --git a/stratum/algos/pentablake.c b/stratum/algos/pentablake.c new file mode 100644 index 0000000..64a6ea9 --- /dev/null +++ b/stratum/algos/pentablake.c @@ -0,0 +1,40 @@ + +#include "pentablake.h" + +#include +#include +#include +#include + +#include "../sha3/sph_blake.h" + +#include + +void penta_hash(const char* input, char* output, uint32_t len) +{ + unsigned char hash[128]; + // same as uint32_t hashA[16], hashB[16]; + + #define hashB hash+64 + + sph_blake512_context ctx_blake; + + sph_blake512_init(&ctx_blake); + sph_blake512(&ctx_blake, input, 80); + sph_blake512_close(&ctx_blake, hash); + + sph_blake512(&ctx_blake, hash, 64); + sph_blake512_close(&ctx_blake, hashB); + + sph_blake512(&ctx_blake, hashB, 64); + sph_blake512_close(&ctx_blake, hash); + + sph_blake512(&ctx_blake, hash, 64); + sph_blake512_close(&ctx_blake, hashB); + + sph_blake512(&ctx_blake, hashB, 64); + sph_blake512_close(&ctx_blake, hash); + + memcpy(output, hash, 32); +} + diff --git a/stratum/algos/pentablake.h b/stratum/algos/pentablake.h new file mode 100644 index 0000000..80fc495 --- /dev/null +++ b/stratum/algos/pentablake.h @@ -0,0 +1,16 @@ +#ifndef PENTABLAKE_H +#define PENTABLAKE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void penta_hash(const char* input, char* output, uint32_t len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/stratum/config.sample/luffa.conf b/stratum/config.sample/luffa.conf new file mode 100644 index 0000000..a0ff65c --- /dev/null +++ b/stratum/config.sample/luffa.conf @@ -0,0 +1,16 @@ +[TCP] +server = yaamp.com +port = 5933 +password = tu8tu5 + +[SQL] +host = yaampdb +database = yaamp +username = root +password = patofpaq + +[STRATUM] +algo = luffa +difficulty = 0.2 +max_ttf = 200000000000000 + diff --git a/stratum/config.sample/penta.conf b/stratum/config.sample/penta.conf new file mode 100644 index 0000000..952d90a --- /dev/null +++ b/stratum/config.sample/penta.conf @@ -0,0 +1,16 @@ +[TCP] +server = yaamp.com +port = 5833 +password = tu8tu5 + +[SQL] +host = yaampdb +database = yaamp +username = root +password = patofpaq + +[STRATUM] +algo = penta +difficulty = 0.1 +max_ttf = 200000000000000 + diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index 8965eb8..e5a5ece 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -105,6 +105,8 @@ YAAMP_ALGO g_algos[] = {"keccak", keccak_hash, 1, 0, 0}, {"bmw", bmw_hash, 1, 0, 0}, + {"luffa", luffa_hash, 1, 0, 0}, + {"penta", penta_hash, 1, 0, 0}, {"skein2", skein2_hash, 1, 0, 0}, {"zr5", zr5_hash, 1, 0, 0}, {"drop", drop_hash, 0x10000, 0x10000, 0}, diff --git a/stratum/stratum.h b/stratum/stratum.h index f7b8d28..114d8e4 100644 --- a/stratum/stratum.h +++ b/stratum/stratum.h @@ -139,6 +139,8 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len); #include "algos/keccak.h" #include "algos/bmw.h" +#include "algos/luffa.h" +#include "algos/pentablake.h" //#include "algos/whirlpoolx.h" #include "algos/skein2.h" #include "algos/zr5.h" diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index af0fb07..11fbae3 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -7,9 +7,12 @@ function yaamp_get_algos() 'sha256', 'scrypt', 'scryptn', + 'luffa', 'lyra2', 'lyra2v2', 'neoscrypt', + 'nist5', + 'penta', 'quark', 'qubit', 'c11', @@ -69,7 +72,9 @@ function getAlgoColors($algo) 'x13' => '#d0f0c0', 'x14' => '#a0f0c0', 'x15' => '#f0b0a0', - 'nist5' => '#f0d0f0', + 'luffa' => '#a0c0c0', + 'penta' => '#80c0c0', + 'nist5' => '#e0d0e0', 'quark' => '#c0c0c0', 'qubit' => '#d0a0f0', 'lyra2' => '#80a0f0', @@ -117,6 +122,8 @@ function getAlgoPort($algo) 'zr5' => 5533, // 5555 to 5683 reserved 'blake' => 5733, + 'penta' => 5833, + 'luffa' => 5933, ); global $configCustomPorts;