diff --git a/stratum/algos/lbk3.c b/stratum/algos/lbk3.c new file mode 100644 index 0000000..fbedd75 --- /dev/null +++ b/stratum/algos/lbk3.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include + +#include +#include +#include + +#define _ALIGN(x) __attribute__ ((aligned(x))) + +extern uint64_t lbk3_height; + +void lbk3_hash(const char* input, char* output, uint32_t len) +{ + sph_bmw256_context ctx_bmw; + sph_blake256_context ctx_blake; + sph_keccak256_context ctx_keccak; + + uint8_t _ALIGN(128) hash[96]; + memset(&hash[32], 0, 64); + + sph_bmw256_init(&ctx_bmw); + sph_bmw256 (&ctx_bmw, input, 80); + sph_bmw256_close(&ctx_bmw, &hash[0]); + + sph_blake256_init(&ctx_blake); + sph_blake256 (&ctx_blake, &hash[0], 64); + sph_blake256_close(&ctx_blake, &hash[32]); + + sph_keccak256_init(&ctx_keccak); + sph_keccak256 (&ctx_keccak, &hash[32], 64); + sph_keccak256_close(&ctx_keccak, &hash[64]); + + memcpy(output, &hash[64], 32); +} diff --git a/stratum/algos/lbk3.h b/stratum/algos/lbk3.h new file mode 100644 index 0000000..7d42722 --- /dev/null +++ b/stratum/algos/lbk3.h @@ -0,0 +1,16 @@ +#ifndef LBK3_H +#define LBK3_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void lbk3_hash(const char* input, char* output, uint32_t len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/stratum/algos/makefile b/stratum/algos/makefile index 2059191..b02f7c2 100644 --- a/stratum/algos/makefile +++ b/stratum/algos/makefile @@ -19,7 +19,7 @@ SOURCES=lyra2re.c lyra2v2.c Lyra2.c lyra2z.c Lyra2-z.c Sponge.c allium.c \ a5a.c a5amath.c m7m.c magimath.cpp velvet.c \ argon2a.c blake2/blake2b.c ar2/argon2.c ar2/core.c ar2/encoding.c ar2/opt.c ar2/thread.c ar2/ar2-scrypt-jane.c \ hive.c pomelo.c hex.c argon2d-dyn.c \ - phi.c phi2.c polytimos.c rainforest.c skunk.c sib.c veltor.c gost.c aergo.c + phi.c phi2.c polytimos.c rainforest.c skunk.c sib.c veltor.c gost.c aergo.c lbk3.c OBJECTS=$(SOURCES:%.c=%.o) $(SOURCES:%.cpp=%.o) OUTPUT=libalgos.a @@ -41,4 +41,4 @@ $(OUTPUT): $(OBJECTS) clean: rm -f *.o rm -f ar2/*.o - rm -f blake2/*.o + rm -f blake2/*.o diff --git a/stratum/config.sample/lbk3.conf b/stratum/config.sample/lbk3.conf new file mode 100644 index 0000000..4e82314 --- /dev/null +++ b/stratum/config.sample/lbk3.conf @@ -0,0 +1,15 @@ +[TCP] +server = yaamp.com +port = 5522 +password = tu8tu5 + +[SQL] +host = yaampdb +database = yaamp +username = root +password = patofpaq + +[STRATUM] +algo = lbk3 +difficulty = 8 +max_ttf = 40000 diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index ecfa7e5..ce9c868 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -167,6 +167,7 @@ YAAMP_ALGO g_algos[] = {"skunk", skunk_hash, 1, 0, 0}, {"bmw", bmw_hash, 1, 0, 0}, + {"lbk3", lbk3_hash, 0x100, 0, 0}, {"lbry", lbry_hash, 0x100, 0, 0}, {"luffa", luffa_hash, 1, 0, 0}, {"penta", penta_hash, 1, 0, 0}, diff --git a/stratum/stratum.h b/stratum/stratum.h index 5f11fad..3aeaf21 100644 --- a/stratum/stratum.h +++ b/stratum/stratum.h @@ -1,4 +1,3 @@ - #include #include #include @@ -184,6 +183,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len); #include "algos/bastion.h" #include "algos/bmw.h" #include "algos/deep.h" +#include "algos/lbk3.h" #include "algos/lbry.h" #include "algos/luffa.h" #include "algos/pentablake.h" diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index 32dc69c..7212501 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -26,6 +26,7 @@ function yaamp_get_algos() 'hex', 'hsr', 'lbry', + 'lbk3', 'luffa', 'lyra2', 'lyra2v2', @@ -179,6 +180,7 @@ function getAlgoColors($algo) 'quark' => '#c0c0c0', 'qubit' => '#d0a0f0', 'rainforest' => '#d0f0a0', + 'lbk3' => '#809aef', 'lyra2' => '#80a0f0', 'lyra2v2' => '#80c0f0', 'lyra2z' => '#80b0f0', @@ -243,6 +245,7 @@ function getAlgoPort($algo) 'argon2d-dyn' => 4239, 'scryptn' => 4333, 'allium' => 4443, + 'lbk3' => 5522, 'lyra2' => 4433, 'lyra2v2' => 4533, 'lyra2z' => 4553,