diff --git a/stratum/algos/yescrypt-opt.c b/stratum/algos/yescrypt-opt.c index 4b42e85..b65cdd2 100644 --- a/stratum/algos/yescrypt-opt.c +++ b/stratum/algos/yescrypt-opt.c @@ -942,7 +942,12 @@ yescrypt_kdf(const yescrypt_shared_t * shared, yescrypt_local_t * local, { HMAC_SHA256_CTX_Y ctx; HMAC_SHA256_Init_Y(&ctx, buf, buflen); - HMAC_SHA256_Update_Y(&ctx, salt, saltlen); + if (r == 16) { // yescryptR16 + HMAC_SHA256_Update_Y(&ctx, "Client Key", 10); + } + else { // yescrypt + HMAC_SHA256_Update_Y(&ctx, salt, saltlen); + } HMAC_SHA256_Final_Y((uint8_t *)sha256, &ctx); } /* Compute StoredKey */ diff --git a/stratum/algos/yescrypt.c b/stratum/algos/yescrypt.c index da070d6..9fac019 100644 --- a/stratum/algos/yescrypt.c +++ b/stratum/algos/yescrypt.c @@ -364,3 +364,7 @@ void yescrypt_hash(const char *input, char *output, uint32_t len) { yescrypt_bsty((uint8_t*)input, len, (uint8_t*)input, len, 2048, 8, 1, (uint8_t*)output, 32); } +void yescryptR16_hash(const char *input, char *output, uint32_t len) +{ + yescrypt_bsty((uint8_t*)input, len, (uint8_t*)input, len, 4096, 16, 1, (uint8_t*)output, 32); +} diff --git a/stratum/algos/yescrypt.h b/stratum/algos/yescrypt.h index db72217..f7dac48 100644 --- a/stratum/algos/yescrypt.h +++ b/stratum/algos/yescrypt.h @@ -39,6 +39,7 @@ extern "C" { #include /* for size_t */ void yescrypt_hash(const char* input, char* output, uint32_t len); +void yescryptR16_hash(const char* input, char* output, uint32_t len); /** * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): diff --git a/stratum/config.sample/yescryptR16.conf b/stratum/config.sample/yescryptR16.conf new file mode 100644 index 0000000..7c24aed --- /dev/null +++ b/stratum/config.sample/yescryptR16.conf @@ -0,0 +1,15 @@ +[TCP] +server = yaamp.com +port = 6333 +password = tu8tu5 + +[SQL] +host = yaampdb +database = yaamp +username = root +password = patofpaq + +[STRATUM] +algo = yescryptR16 +difficulty = 2 +max_ttf = 400000000 diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index fe74772..c2177a4 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -150,6 +150,7 @@ YAAMP_ALGO g_algos[] = {"penta", penta_hash, 1, 0, 0}, {"skein2", skein2_hash, 1, 0, 0}, {"yescrypt", yescrypt_hash, 0x10000, 0, 0}, + {"yescryptR16", yescryptR16_hash, 0x10000, 0, 0 }, {"zr5", zr5_hash, 1, 0, 0}, {"hive", hive_hash, 0x10000, 0, 0}, diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index c19af3f..0a05a19 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -55,6 +55,7 @@ function yaamp_get_algos() 'veltor', 'velvet', 'yescrypt', + 'yescryptR16', 'whirlpool', 'zr5', ); @@ -109,6 +110,7 @@ function yaamp_get_algo_norm($algo) 'velvet' => 1.0, 'whirlpool' => 1.0, 'yescrypt' => 1.0, + 'yescryptR16' => 1.0, 'zr5' => 1.0, ); @@ -171,6 +173,7 @@ function getAlgoColors($algo) 'velvet' => '#aac0cc', 'whirlpool' => '#d0e0e0', 'yescrypt' => '#e0d0e0', + 'yescryptR16' => '#e2d0e2', 'zr5' => '#d0b0d0', 'MN' => '#ffffff', // MasterNode Earnings @@ -235,6 +238,7 @@ function getAlgoPort($algo) 'veltor' => 5034, 'velvet' => 6133, 'yescrypt' => 6233, + 'yescryptR16' => 6333, 'bastion' => 6433, 'hsr' => 7433, 'phi' => 8333,