yescryptR16 algo (#217)

Algo yescryptR16 for Yenten [YTN] https://bitcointalk.org/?topic=2329470.0

stratum changes from https://github.com/bubasik/yiimp
This commit is contained in:
UniMining.net 2018-01-31 08:23:27 +01:00 committed by Tanguy Pruvot
parent a79e21491a
commit d69d3ce3fc
6 changed files with 31 additions and 1 deletions

View file

@ -942,7 +942,12 @@ yescrypt_kdf(const yescrypt_shared_t * shared, yescrypt_local_t * local,
{ {
HMAC_SHA256_CTX_Y ctx; HMAC_SHA256_CTX_Y ctx;
HMAC_SHA256_Init_Y(&ctx, buf, buflen); HMAC_SHA256_Init_Y(&ctx, buf, buflen);
if (r == 16) { // yescryptR16
HMAC_SHA256_Update_Y(&ctx, "Client Key", 10);
}
else { // yescrypt
HMAC_SHA256_Update_Y(&ctx, salt, saltlen); HMAC_SHA256_Update_Y(&ctx, salt, saltlen);
}
HMAC_SHA256_Final_Y((uint8_t *)sha256, &ctx); HMAC_SHA256_Final_Y((uint8_t *)sha256, &ctx);
} }
/* Compute StoredKey */ /* Compute StoredKey */

View file

@ -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); 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);
}

View file

@ -39,6 +39,7 @@ extern "C" {
#include <stdlib.h> /* for size_t */ #include <stdlib.h> /* for size_t */
void yescrypt_hash(const char* input, char* output, uint32_t len); 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): * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen):

View file

@ -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

View file

@ -150,6 +150,7 @@ YAAMP_ALGO g_algos[] =
{"penta", penta_hash, 1, 0, 0}, {"penta", penta_hash, 1, 0, 0},
{"skein2", skein2_hash, 1, 0, 0}, {"skein2", skein2_hash, 1, 0, 0},
{"yescrypt", yescrypt_hash, 0x10000, 0, 0}, {"yescrypt", yescrypt_hash, 0x10000, 0, 0},
{"yescryptR16", yescryptR16_hash, 0x10000, 0, 0 },
{"zr5", zr5_hash, 1, 0, 0}, {"zr5", zr5_hash, 1, 0, 0},
{"hive", hive_hash, 0x10000, 0, 0}, {"hive", hive_hash, 0x10000, 0, 0},

View file

@ -55,6 +55,7 @@ function yaamp_get_algos()
'veltor', 'veltor',
'velvet', 'velvet',
'yescrypt', 'yescrypt',
'yescryptR16',
'whirlpool', 'whirlpool',
'zr5', 'zr5',
); );
@ -109,6 +110,7 @@ function yaamp_get_algo_norm($algo)
'velvet' => 1.0, 'velvet' => 1.0,
'whirlpool' => 1.0, 'whirlpool' => 1.0,
'yescrypt' => 1.0, 'yescrypt' => 1.0,
'yescryptR16' => 1.0,
'zr5' => 1.0, 'zr5' => 1.0,
); );
@ -171,6 +173,7 @@ function getAlgoColors($algo)
'velvet' => '#aac0cc', 'velvet' => '#aac0cc',
'whirlpool' => '#d0e0e0', 'whirlpool' => '#d0e0e0',
'yescrypt' => '#e0d0e0', 'yescrypt' => '#e0d0e0',
'yescryptR16' => '#e2d0e2',
'zr5' => '#d0b0d0', 'zr5' => '#d0b0d0',
'MN' => '#ffffff', // MasterNode Earnings 'MN' => '#ffffff', // MasterNode Earnings
@ -235,6 +238,7 @@ function getAlgoPort($algo)
'veltor' => 5034, 'veltor' => 5034,
'velvet' => 6133, 'velvet' => 6133,
'yescrypt' => 6233, 'yescrypt' => 6233,
'yescryptR16' => 6333,
'bastion' => 6433, 'bastion' => 6433,
'hsr' => 7433, 'hsr' => 7433,
'phi' => 8333, 'phi' => 8333,