Skip to content

Commit

Permalink
Add yescryptR32
Browse files Browse the repository at this point in the history
  • Loading branch information
exmac committed Mar 19, 2018
1 parent 77e2624 commit 31f1d4f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stratum/algos/yescrypt-opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,9 @@ yescrypt_kdf(const yescrypt_shared_t * shared, yescrypt_local_t * local,
{
HMAC_SHA256_CTX_Y ctx;
HMAC_SHA256_Init_Y(&ctx, buf, buflen);
if (r == 32) { // yescryptR32
HMAC_SHA256_Update_Y(&ctx, "WaviBanana", 10);
} else
if (r == 16) { // yescryptR16
HMAC_SHA256_Update_Y(&ctx, "Client Key", 10);
}
Expand Down
5 changes: 5 additions & 0 deletions stratum/algos/yescrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,8 @@ 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);
}

void yescryptR32_hash(const char *input, char *output, uint32_t len)
{
yescrypt_bsty((uint8_t*)input, len, (uint8_t*)input, len, 4096, 32, 1, (uint8_t*)output, 32);
}
1 change: 1 addition & 0 deletions stratum/algos/yescrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ extern "C" {

void yescrypt_hash(const char* input, char* output, uint32_t len);
void yescryptR16_hash(const char* input, char* output, uint32_t len);
void yescryptR32_hash(const char* input, char* output, uint32_t len);

/**
* crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen):
Expand Down
15 changes: 15 additions & 0 deletions stratum/config.sample/yescryptR32.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[TCP]
server = yaamp.com
port = 6343
password = tu8tu5

[SQL]
host = yaampdb
database = yaamp
username = root
password = patofpaq

[STRATUM]
algo = yescryptR32
difficulty = 1
max_ttf = 400000000
1 change: 1 addition & 0 deletions stratum/stratum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ YAAMP_ALGO g_algos[] =
{"skein2", skein2_hash, 1, 0, 0},
{"yescrypt", yescrypt_hash, 0x10000, 0, 0},
{"yescryptR16", yescryptR16_hash, 0x10000, 0, 0 },
{"yescryptR32", yescryptR32_hash, 0x10000, 0, 0 },
{"zr5", zr5_hash, 1, 0, 0},

{"a5a", a5a_hash, 0x10000, 0, 0},
Expand Down
4 changes: 4 additions & 0 deletions web/yaamp/core/functions/yaamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function yaamp_get_algos()
'velvet',
'yescrypt',
'yescryptR16',
'yescryptR32',
'whirlpool',
'zr5',
);
Expand Down Expand Up @@ -113,6 +114,7 @@ function yaamp_get_algo_norm($algo)
'whirlpool' => 1.0,
'yescrypt' => 1.0,
'yescryptR16' => 1.0,
'yescryptR32' => 1.0,
'zr5' => 1.0,
);

Expand Down Expand Up @@ -178,6 +180,7 @@ function getAlgoColors($algo)
'whirlpool' => '#d0e0e0',
'yescrypt' => '#e0d0e0',
'yescryptR16' => '#e2d0e2',
'yescryptR32' => '#e2d0d2',
'zr5' => '#d0b0d0',

'MN' => '#ffffff', // MasterNode Earnings
Expand Down Expand Up @@ -244,6 +247,7 @@ function getAlgoPort($algo)
'velvet' => 6133,
'yescrypt' => 6233,
'yescryptR16' => 6333,
'yescryptR32' => 6343,
'bastion' => 6433,
'hsr' => 7433,
'phi' => 8333,
Expand Down

1 comment on commit 31f1d4f

@coolsd
Copy link

@coolsd coolsd commented on 31f1d4f Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./run.sh: line 11: 17156 Segmentation fault (core dumped) ./stratum config/$1

Please sign in to comment.