mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
sha256q algo (#332)
This commit is contained in:
parent
31124f7743
commit
94d3ba1624
7 changed files with 73 additions and 1 deletions
|
@ -15,7 +15,7 @@ SOURCES=lyra2re.c lyra2v2.c Lyra2.c lyra2z.c Lyra2-z.c Sponge.c allium.c \
|
|||
deep.c fresh.c groestl.c neoscrypt.c nist5.c quark.c qubit.c skein.c skein2.c \
|
||||
bitcore.c timetravel.c x11evo.c x16r.c x16s.c xevan.c bastion.c hmq17.c sonoa.c \
|
||||
bmw.c luffa.c pentablake.c vitalium.c whirlpool.c whirlpoolx.c zr5.c \
|
||||
scrypt.c scryptn.c sha256.c sha256t.c \
|
||||
scrypt.c scryptn.c sha256.c sha256t.c sha256q.c \
|
||||
yescrypt.c yescrypt-opt.c sha256_Y.c \
|
||||
a5a.c a5amath.c m7m.c magimath.cpp velvet.c \
|
||||
argon2a.c blake2/blake2b.c ar2/argon2.c ar2/core.c ar2/encoding.c ar2/opt.c ar2/thread.c ar2/ar2-scrypt-jane.c \
|
||||
|
|
32
stratum/algos/sha256q.c
Normal file
32
stratum/algos/sha256q.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "sha256.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void sha256q_hash(const char* input, char* output, uint32_t len)
|
||||
{
|
||||
unsigned char hash[64];
|
||||
|
||||
SHA256_CTX ctx_sha256;
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, input, len);
|
||||
SHA256_Final(hash, &ctx_sha256);
|
||||
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, hash, 32);
|
||||
SHA256_Final(hash, &ctx_sha256);
|
||||
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, hash, 32);
|
||||
SHA256_Final(hash, &ctx_sha256);
|
||||
|
||||
SHA256_Init(&ctx_sha256);
|
||||
SHA256_Update(&ctx_sha256, hash, 32);
|
||||
SHA256_Final((unsigned char*)output, &ctx_sha256);
|
||||
}
|
||||
|
16
stratum/algos/sha256q.h
Normal file
16
stratum/algos/sha256q.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef SHA256Q_H
|
||||
#define SHA256Q_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void sha256q_hash(const char* input, char* output, uint32_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
17
stratum/config.sample/sha256q.conf
Normal file
17
stratum/config.sample/sha256q.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
[TCP]
|
||||
server = yaamp.com
|
||||
port = 3337
|
||||
password = tu8tu5
|
||||
|
||||
[SQL]
|
||||
host = yaampdb
|
||||
database = yaamp
|
||||
username = root
|
||||
password = patofpaq
|
||||
|
||||
[STRATUM]
|
||||
algo = sha256q
|
||||
difficulty = 1
|
||||
max_ttf = 40000
|
||||
reconnect = 1
|
||||
|
|
@ -195,6 +195,8 @@ YAAMP_ALGO g_algos[] =
|
|||
|
||||
{"sha256t", sha256t_hash, 1, 0, 0}, // sha256 3x
|
||||
|
||||
{"sha256q", sha256q_hash, 1, 0, 0}, // sha256 4x
|
||||
|
||||
{"sib", sib_hash, 1, 0, 0},
|
||||
|
||||
{"whirlcoin", whirlpool_hash, 1, 0, sha256_hash_hex }, /* old sha merkleroot */
|
||||
|
|
|
@ -180,6 +180,7 @@ void sha256_double_hash_hex(const char *input, char *output, unsigned int len);
|
|||
#include "algos/skein.h"
|
||||
#include "algos/keccak.h"
|
||||
#include "algos/sha256t.h"
|
||||
#include "algos/sha256q.h"
|
||||
#include "algos/skunk.h"
|
||||
#include "algos/timetravel.h"
|
||||
#include "algos/bitcore.h"
|
||||
|
|
|
@ -6,6 +6,7 @@ function yaamp_get_algos()
|
|||
return array(
|
||||
'sha256',
|
||||
'sha256t',
|
||||
'sha256q',
|
||||
'scrypt',
|
||||
'scryptn',
|
||||
'allium',
|
||||
|
@ -84,6 +85,7 @@ function yaamp_algo_mBTC_factor($algo)
|
|||
switch($algo) {
|
||||
case 'sha256':
|
||||
case 'sha256t':
|
||||
case 'sha256q':
|
||||
case 'blake':
|
||||
case 'blakecoin':
|
||||
case 'blake2s':
|
||||
|
@ -144,6 +146,7 @@ function getAlgoColors($algo)
|
|||
$a = array(
|
||||
'sha256' => '#d0d0a0',
|
||||
'sha256t' => '#d0d0f0',
|
||||
'sha256q' => '#9696dd',
|
||||
'scrypt' => '#c0c0e0',
|
||||
'neoscrypt' => '#a0d0f0',
|
||||
'scryptn' => '#d0d0d0',
|
||||
|
@ -226,6 +229,7 @@ function getAlgoPort($algo)
|
|||
$a = array(
|
||||
'sha256' => 3333,
|
||||
'sha256t' => 3339,
|
||||
'sha256q' => 3337,
|
||||
'lbry' => 3334,
|
||||
'scrypt' => 3433,
|
||||
'timetravel' => 3555,
|
||||
|
|
Loading…
Add table
Reference in a new issue