add/handle penta(blake), luffa and nist5 algos

This commit is contained in:
Tanguy Pruvot 2015-09-17 04:56:02 +02:00
parent 945d207c89
commit d04b4bff97
11 changed files with 140 additions and 2 deletions

View file

@ -26,7 +26,10 @@ screen -dmS x15 $STRATUM_DIR/run.sh x15
screen -dmS sha $STRATUM_DIR/run.sh sha
screen -dmS scrypt $STRATUM_DIR/run.sh scrypt
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 nist5 $STRATUM_DIR/run.sh nist5
screen -dmS penta $STRATUM_DIR/run.sh penta
screen -dmS quark $STRATUM_DIR/run.sh quark
screen -dmS qubit $STRATUM_DIR/run.sh qubit
#screen -dmS groestl $STRATUM_DIR/run.sh groestl # dmd-gr -m 256

20
stratum/algos/luffa.c Normal file
View 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
View 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

View file

@ -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 \
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)
OUTPUT=libalgos.a

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

View 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

View 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

View 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

View file

@ -105,6 +105,8 @@ YAAMP_ALGO g_algos[] =
{"keccak", keccak_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},
{"zr5", zr5_hash, 1, 0, 0},
{"drop", drop_hash, 0x10000, 0x10000, 0},

View file

@ -139,6 +139,8 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
#include "algos/keccak.h"
#include "algos/bmw.h"
#include "algos/luffa.h"
#include "algos/pentablake.h"
//#include "algos/whirlpoolx.h"
#include "algos/skein2.h"
#include "algos/zr5.h"

View file

@ -7,9 +7,12 @@ function yaamp_get_algos()
'sha256',
'scrypt',
'scryptn',
'luffa',
'lyra2',
'lyra2v2',
'neoscrypt',
'nist5',
'penta',
'quark',
'qubit',
'c11',
@ -69,7 +72,9 @@ function getAlgoColors($algo)
'x13' => '#d0f0c0',
'x14' => '#a0f0c0',
'x15' => '#f0b0a0',
'nist5' => '#f0d0f0',
'luffa' => '#a0c0c0',
'penta' => '#80c0c0',
'nist5' => '#e0d0e0',
'quark' => '#c0c0c0',
'qubit' => '#d0a0f0',
'lyra2' => '#80a0f0',
@ -117,6 +122,8 @@ function getAlgoPort($algo)
'zr5' => 5533,
// 5555 to 5683 reserved
'blake' => 5733,
'penta' => 5833,
'luffa' => 5933,
);
global $configCustomPorts;