mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-20 01:09:48 +00:00
add skein2 stratum support and change some algo colors
This commit is contained in:
parent
79968acad0
commit
7a0112c6a9
7 changed files with 71 additions and 5 deletions
3
rc.local
3
rc.local
|
@ -26,6 +26,9 @@ screen -dmS neo /var/stratum/run.sh neo
|
||||||
screen -dmS quark /var/stratum/run.sh quark
|
screen -dmS quark /var/stratum/run.sh quark
|
||||||
#screen -dmS qubit /var/stratum/run.sh qubit
|
#screen -dmS qubit /var/stratum/run.sh qubit
|
||||||
screen -dmS lyra2 /var/stratum/run.sh lyra2
|
screen -dmS lyra2 /var/stratum/run.sh lyra2
|
||||||
|
|
||||||
|
screen -dmS skein /var/stratum/run.sh skein
|
||||||
|
#screen -dmS skein2 /var/stratum/run.sh skein2
|
||||||
screen -dmS zr5 /var/stratum/run.sh zr5
|
screen -dmS zr5 /var/stratum/run.sh zr5
|
||||||
screen -dmS drop /var/stratum/run.sh drop
|
screen -dmS drop /var/stratum/run.sh drop
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ LDFLAGS=-O2
|
||||||
|
|
||||||
SOURCES=Lyra2RE.c Lyra2.c Sponge.c blake.c scrypt.c c11.c x11.c x13.c sha256.c keccak.c \
|
SOURCES=Lyra2RE.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 \
|
||||||
zr5.c drop.c
|
skein2.c zr5.c drop.c
|
||||||
|
|
||||||
OBJECTS=$(SOURCES:.c=.o)
|
OBJECTS=$(SOURCES:.c=.o)
|
||||||
OUTPUT=libalgos.a
|
OUTPUT=libalgos.a
|
||||||
|
|
27
stratum/algos/skein2.c
Normal file
27
stratum/algos/skein2.c
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
#include "skein2.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "../sha3/sph_skein.h"
|
||||||
|
#include "sha256.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void skein2_hash(const char* input, char* output, uint32_t len)
|
||||||
|
{
|
||||||
|
char temp[64];
|
||||||
|
|
||||||
|
sph_skein512_context ctx_skien;
|
||||||
|
sph_skein512_init(&ctx_skien);
|
||||||
|
sph_skein512(&ctx_skien, input, len);
|
||||||
|
sph_skein512_close(&ctx_skien, &temp);
|
||||||
|
|
||||||
|
sph_skein512_init(&ctx_skien);
|
||||||
|
sph_skein512(&ctx_skien, &temp, 64);
|
||||||
|
sph_skein512_close(&ctx_skien, &output[0]);
|
||||||
|
}
|
||||||
|
|
16
stratum/algos/skein2.h
Normal file
16
stratum/algos/skein2.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef SKEIN2_H
|
||||||
|
#define SKEIN2_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
void skein2_hash(const char* input, char* output, uint32_t len);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -107,6 +107,7 @@ YAAMP_ALGO g_algos[] =
|
||||||
{"skein", skein_hash, 1, 0, 0},
|
{"skein", skein_hash, 1, 0, 0},
|
||||||
{"keccak", keccak_hash, 1, 0, 0},
|
{"keccak", keccak_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},
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
|
||||||
#include "algos/keccak.h"
|
#include "algos/keccak.h"
|
||||||
|
|
||||||
//#include "algos/whirlpoolx.h"
|
//#include "algos/whirlpoolx.h"
|
||||||
|
#include "algos/skein2.h"
|
||||||
#include "algos/zr5.h"
|
#include "algos/zr5.h"
|
||||||
#include "algos/drop.h"
|
#include "algos/drop.h"
|
||||||
//#include "jha.h"
|
//#include "jha.h"
|
||||||
|
|
|
@ -2,7 +2,21 @@
|
||||||
|
|
||||||
function yaamp_get_algos()
|
function yaamp_get_algos()
|
||||||
{
|
{
|
||||||
return array('sha256', /*'scrypt', 'scryptn',*/ 'neoscrypt', 'quark', 'lyra2', 'qubit', 'c11', 'x11', 'x13', 'x15', 'zr5', 'drop');
|
return array(
|
||||||
|
'sha256',
|
||||||
|
'scrypt',// 'scryptn',
|
||||||
|
'neoscrypt','lyra2',
|
||||||
|
'quark',
|
||||||
|
'qubit',
|
||||||
|
'c11',
|
||||||
|
'x11',
|
||||||
|
//'x13','x15',
|
||||||
|
//'groestl', << dmd-gr -m 256
|
||||||
|
'skein',
|
||||||
|
//'skein2',
|
||||||
|
'drop',
|
||||||
|
'zr5',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function yaamp_get_algo_norm($algo)
|
function yaamp_get_algo_norm($algo)
|
||||||
|
@ -27,6 +41,7 @@ function yaamp_get_algo_norm($algo)
|
||||||
'groestl' => 5,
|
'groestl' => 5,
|
||||||
'blake' => 300,
|
'blake' => 300,
|
||||||
'keccak' => 160,
|
'keccak' => 160,
|
||||||
|
'skein2' => 300,
|
||||||
'zr5' => 5.5,
|
'zr5' => 5.5,
|
||||||
'drop' => 1.5,
|
'drop' => 1.5,
|
||||||
);
|
);
|
||||||
|
@ -44,7 +59,7 @@ function getAlgoColors($algo)
|
||||||
'scrypt' => '#c0c0e0',
|
'scrypt' => '#c0c0e0',
|
||||||
'neoscrypt' => '#a0d0f0',
|
'neoscrypt' => '#a0d0f0',
|
||||||
'scryptn' => '#d0d0d0',
|
'scryptn' => '#d0d0d0',
|
||||||
'c11' => '#e0f0b0',
|
'c11' => '#a0a0d0',
|
||||||
'x11' => '#f0f0a0',
|
'x11' => '#f0f0a0',
|
||||||
'x13' => '#d0f0c0',
|
'x13' => '#d0f0c0',
|
||||||
'x14' => '#a0f0c0',
|
'x14' => '#a0f0c0',
|
||||||
|
@ -53,6 +68,8 @@ function getAlgoColors($algo)
|
||||||
'quark' => '#c0c0c0',
|
'quark' => '#c0c0c0',
|
||||||
'qubit' => '#d0a0f0',
|
'qubit' => '#d0a0f0',
|
||||||
'lyra2' => '#80a0f0',
|
'lyra2' => '#80a0f0',
|
||||||
|
'skein' => '#80a0a0',
|
||||||
|
'skein2' => '#a0a0a0',
|
||||||
'zr5' => '#d0b0d0',
|
'zr5' => '#d0b0d0',
|
||||||
'drop' => '#d0b0d0',
|
'drop' => '#d0b0d0',
|
||||||
);
|
);
|
||||||
|
@ -84,9 +101,10 @@ function getAlgoPort($algo)
|
||||||
'qubit' => 4733,
|
'qubit' => 4733,
|
||||||
'zr5' => 4833,
|
'zr5' => 4833,
|
||||||
'skein' => 4933,
|
'skein' => 4933,
|
||||||
'groestl' => 5033,
|
|
||||||
'keccak' => 5133,
|
|
||||||
'drop' => 5033,
|
'drop' => 5033,
|
||||||
|
'keccak' => 5133,
|
||||||
|
'skein2' => 5233,
|
||||||
|
'groestl' => 5333,
|
||||||
'zr5' => 5533,
|
'zr5' => 5533,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue