mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
handle phi algo too
This commit is contained in:
parent
b97c52f14d
commit
c6e140ef7c
7 changed files with 89 additions and 1 deletions
|
@ -19,7 +19,7 @@ SOURCES=lyra2re.c lyra2v2.c Lyra2.c lyra2z.c Lyra2z.c Sponge.c \
|
|||
m7m.c magimath.cpp velvet.c \
|
||||
argon2a.c ar2/blake2b.c ar2/argon2.c ar2/ref.c ar2/cores.c ar2/ar2-scrypt-jane.c \
|
||||
hive.c pomelo.c \
|
||||
skunk.c sib.c veltor.c gost.c x11evo.c
|
||||
phi.c skunk.c sib.c veltor.c gost.c x11evo.c
|
||||
|
||||
OBJECTS=$(SOURCES:%.c=%.o) $(SOURCES:%.cpp=%.o)
|
||||
OUTPUT=libalgos.a
|
||||
|
|
51
stratum/algos/phi.c
Normal file
51
stratum/algos/phi.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sha3/sph_skein.h>
|
||||
#include <sha3/sph_jh.h>
|
||||
#include <sha3/sph_cubehash.h>
|
||||
#include <sha3/sph_fugue.h>
|
||||
#include <sha3/sph_echo.h>
|
||||
#include "gost.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void phi_hash(const char* input, char* output, uint32_t len)
|
||||
{
|
||||
sph_skein512_context ctx_skein;
|
||||
sph_jh512_context ctx_jh;
|
||||
sph_cubehash512_context ctx_cubehash;
|
||||
sph_fugue512_context ctx_fugue;
|
||||
sph_gost512_context ctx_gost;
|
||||
sph_echo512_context ctx_echo;
|
||||
|
||||
uint8_t _ALIGN(128) hash[64];
|
||||
|
||||
sph_skein512_init(&ctx_skein);
|
||||
sph_skein512(&ctx_skein, input, len);
|
||||
sph_skein512_close(&ctx_skein, (void*) hash);
|
||||
|
||||
sph_jh512_init(&ctx_jh);
|
||||
sph_jh512(&ctx_jh, (const void*) hash, 64);
|
||||
sph_jh512_close(&ctx_jh, (void*) hash);
|
||||
|
||||
sph_cubehash512_init(&ctx_cubehash);
|
||||
sph_cubehash512(&ctx_cubehash, (const void*) hash, 64);
|
||||
sph_cubehash512_close(&ctx_cubehash, (void*) hash);
|
||||
|
||||
sph_fugue512_init(&ctx_fugue);
|
||||
sph_fugue512(&ctx_fugue, (const void*) hash, 64);
|
||||
sph_fugue512_close(&ctx_fugue, (void*) hash);
|
||||
|
||||
sph_gost512_init(&ctx_gost);
|
||||
sph_gost512(&ctx_gost, (const void*) hash, 64);
|
||||
sph_gost512_close(&ctx_gost, (void*) hash);
|
||||
|
||||
sph_echo512_init(&ctx_echo);
|
||||
sph_echo512(&ctx_echo, (const void*) hash, 64);
|
||||
sph_echo512_close(&ctx_echo, (void*) hash);
|
||||
|
||||
memcpy(output, hash, 32);
|
||||
}
|
16
stratum/algos/phi.h
Normal file
16
stratum/algos/phi.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef PHI_H
|
||||
#define PHI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void phi_hash(const char* input, char* output, uint32_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
16
stratum/config.sample/phi.conf
Normal file
16
stratum/config.sample/phi.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
[TCP]
|
||||
server = yaamp.com
|
||||
port = 8333
|
||||
password = tu8tu5
|
||||
|
||||
[SQL]
|
||||
host = yaampdb
|
||||
database = yaamp
|
||||
username = root
|
||||
password = patofpaq
|
||||
|
||||
[STRATUM]
|
||||
algo = phi
|
||||
difficulty = 0.016
|
||||
max_ttf = 40000
|
||||
|
|
@ -134,6 +134,7 @@ YAAMP_ALGO g_algos[] =
|
|||
{"skein", skein_hash, 1, 0, 0},
|
||||
{"tribus", tribus_hash, 1, 0, 0},
|
||||
{"keccak", keccak256_hash, 0x80, 0, sha256_hash_hex },
|
||||
{"phi", phi_hash, 1, 0, 0},
|
||||
{"skunk", skunk_hash, 1, 0, 0},
|
||||
|
||||
{"bmw", bmw_hash, 1, 0, 0},
|
||||
|
|
|
@ -173,6 +173,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
|
|||
#include "algos/hive.h"
|
||||
#include "algos/sib.h"
|
||||
#include "algos/m7m.h"
|
||||
#include "algos/phi.h"
|
||||
#include "algos/tribus.h"
|
||||
#include "algos/veltor.h"
|
||||
#include "algos/velvet.h"
|
||||
|
|
|
@ -42,6 +42,7 @@ function yaamp_get_algos()
|
|||
'dmd-gr',
|
||||
'myr-gr',
|
||||
'm7m',
|
||||
'phi',
|
||||
'sib',
|
||||
'skein',
|
||||
'skein2',
|
||||
|
@ -151,6 +152,7 @@ function getAlgoColors($algo)
|
|||
'lyra2' => '#80a0f0',
|
||||
'lyra2v2' => '#80c0f0',
|
||||
'lyra2z' => '#80b0f0',
|
||||
'phi' => '#a0a0e0',
|
||||
'sib' => '#a0a0c0',
|
||||
'skein' => '#80a0a0',
|
||||
'skein2' => '#c8a060',
|
||||
|
@ -227,6 +229,7 @@ function getAlgoPort($algo)
|
|||
'yescrypt' => 6233,
|
||||
'bastion' => 6433,
|
||||
'hsr' => 7433,
|
||||
'phi' => 8333,
|
||||
'skunk' => 8433,
|
||||
'tribus' => 8533,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue