mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-04 21:05:14 +00:00
add/handle penta(blake), luffa and nist5 algos
This commit is contained in:
parent
945d207c89
commit
d04b4bff97
11 changed files with 140 additions and 2 deletions
3
rc.local
3
rc.local
|
@ -26,7 +26,10 @@ screen -dmS x15 $STRATUM_DIR/run.sh x15
|
||||||
screen -dmS sha $STRATUM_DIR/run.sh sha
|
screen -dmS sha $STRATUM_DIR/run.sh sha
|
||||||
screen -dmS scrypt $STRATUM_DIR/run.sh scrypt
|
screen -dmS scrypt $STRATUM_DIR/run.sh scrypt
|
||||||
screen -dmS scryptn $STRATUM_DIR/run.sh scryptn
|
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 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 quark $STRATUM_DIR/run.sh quark
|
||||||
screen -dmS qubit $STRATUM_DIR/run.sh qubit
|
screen -dmS qubit $STRATUM_DIR/run.sh qubit
|
||||||
#screen -dmS groestl $STRATUM_DIR/run.sh groestl # dmd-gr -m 256
|
#screen -dmS groestl $STRATUM_DIR/run.sh groestl # dmd-gr -m 256
|
||||||
|
|
20
stratum/algos/luffa.c
Normal file
20
stratum/algos/luffa.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#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);
|
||||||
|
}
|
16
stratum/algos/luffa.h
Normal file
16
stratum/algos/luffa.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef LUFFA_H
|
||||||
|
#define LUFFA_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
void luffa_hash(const char* input, char* output, uint32_t len);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -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 \
|
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 \
|
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)
|
OBJECTS=$(SOURCES:.c=.o)
|
||||||
OUTPUT=libalgos.a
|
OUTPUT=libalgos.a
|
||||||
|
|
40
stratum/algos/pentablake.c
Normal file
40
stratum/algos/pentablake.c
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
|
||||||
|
#include "pentablake.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "../sha3/sph_blake.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
16
stratum/algos/pentablake.h
Normal file
16
stratum/algos/pentablake.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef PENTABLAKE_H
|
||||||
|
#define PENTABLAKE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
void penta_hash(const char* input, char* output, uint32_t len);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
16
stratum/config.sample/luffa.conf
Normal file
16
stratum/config.sample/luffa.conf
Normal file
|
@ -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
|
||||||
|
|
16
stratum/config.sample/penta.conf
Normal file
16
stratum/config.sample/penta.conf
Normal file
|
@ -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
|
||||||
|
|
|
@ -105,6 +105,8 @@ YAAMP_ALGO g_algos[] =
|
||||||
{"keccak", keccak_hash, 1, 0, 0},
|
{"keccak", keccak_hash, 1, 0, 0},
|
||||||
|
|
||||||
{"bmw", bmw_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},
|
{"skein2", skein2_hash, 1, 0, 0},
|
||||||
{"zr5", zr5_hash, 1, 0, 0},
|
{"zr5", zr5_hash, 1, 0, 0},
|
||||||
{"drop", drop_hash, 0x10000, 0x10000, 0},
|
{"drop", drop_hash, 0x10000, 0x10000, 0},
|
||||||
|
|
|
@ -139,6 +139,8 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
|
||||||
#include "algos/keccak.h"
|
#include "algos/keccak.h"
|
||||||
|
|
||||||
#include "algos/bmw.h"
|
#include "algos/bmw.h"
|
||||||
|
#include "algos/luffa.h"
|
||||||
|
#include "algos/pentablake.h"
|
||||||
//#include "algos/whirlpoolx.h"
|
//#include "algos/whirlpoolx.h"
|
||||||
#include "algos/skein2.h"
|
#include "algos/skein2.h"
|
||||||
#include "algos/zr5.h"
|
#include "algos/zr5.h"
|
||||||
|
|
|
@ -7,9 +7,12 @@ function yaamp_get_algos()
|
||||||
'sha256',
|
'sha256',
|
||||||
'scrypt',
|
'scrypt',
|
||||||
'scryptn',
|
'scryptn',
|
||||||
|
'luffa',
|
||||||
'lyra2',
|
'lyra2',
|
||||||
'lyra2v2',
|
'lyra2v2',
|
||||||
'neoscrypt',
|
'neoscrypt',
|
||||||
|
'nist5',
|
||||||
|
'penta',
|
||||||
'quark',
|
'quark',
|
||||||
'qubit',
|
'qubit',
|
||||||
'c11',
|
'c11',
|
||||||
|
@ -69,7 +72,9 @@ function getAlgoColors($algo)
|
||||||
'x13' => '#d0f0c0',
|
'x13' => '#d0f0c0',
|
||||||
'x14' => '#a0f0c0',
|
'x14' => '#a0f0c0',
|
||||||
'x15' => '#f0b0a0',
|
'x15' => '#f0b0a0',
|
||||||
'nist5' => '#f0d0f0',
|
'luffa' => '#a0c0c0',
|
||||||
|
'penta' => '#80c0c0',
|
||||||
|
'nist5' => '#e0d0e0',
|
||||||
'quark' => '#c0c0c0',
|
'quark' => '#c0c0c0',
|
||||||
'qubit' => '#d0a0f0',
|
'qubit' => '#d0a0f0',
|
||||||
'lyra2' => '#80a0f0',
|
'lyra2' => '#80a0f0',
|
||||||
|
@ -117,6 +122,8 @@ function getAlgoPort($algo)
|
||||||
'zr5' => 5533,
|
'zr5' => 5533,
|
||||||
// 5555 to 5683 reserved
|
// 5555 to 5683 reserved
|
||||||
'blake' => 5733,
|
'blake' => 5733,
|
||||||
|
'penta' => 5833,
|
||||||
|
'luffa' => 5933,
|
||||||
);
|
);
|
||||||
|
|
||||||
global $configCustomPorts;
|
global $configCustomPorts;
|
||||||
|
|
Loading…
Add table
Reference in a new issue