mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
Signatum skunk algo
Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
This commit is contained in:
parent
646ea022eb
commit
c53ff49a63
6 changed files with 62 additions and 1 deletions
|
@ -18,7 +18,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 \
|
||||
sib.c veltor.c gost.c x11evo.c
|
||||
skunk.c sib.c veltor.c gost.c x11evo.c
|
||||
|
||||
OBJECTS=$(SOURCES:%.c=%.o) $(SOURCES:%.cpp=%.o)
|
||||
OUTPUT=libalgos.a
|
||||
|
|
40
stratum/algos/skunk.c
Normal file
40
stratum/algos/skunk.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sha3/sph_skein.h>
|
||||
#include <sha3/sph_cubehash.h>
|
||||
#include <sha3/sph_fugue.h>
|
||||
#include "gost.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void skunk_hash(const char *input, char* output, uint32_t len)
|
||||
{
|
||||
uint32_t _ALIGN(64) hash[16];
|
||||
|
||||
sph_skein512_context ctx_skein;
|
||||
sph_cubehash512_context ctx_cube;
|
||||
sph_fugue512_context ctx_fugue;
|
||||
sph_gost512_context ctx_gost;
|
||||
|
||||
sph_skein512_init(&ctx_skein);
|
||||
sph_skein512(&ctx_skein, input, 80);
|
||||
sph_skein512_close(&ctx_skein, (void*) hash);
|
||||
|
||||
sph_cubehash512_init(&ctx_cube);
|
||||
sph_cubehash512(&ctx_cube, hash, 64);
|
||||
sph_cubehash512_close(&ctx_cube, hash);
|
||||
|
||||
sph_fugue512_init (&ctx_fugue);
|
||||
sph_fugue512(&ctx_fugue, hash, 64);
|
||||
sph_fugue512_close(&ctx_fugue, hash);
|
||||
|
||||
sph_gost512_init(&ctx_gost);
|
||||
sph_gost512(&ctx_gost, (const void*) hash, 64);
|
||||
sph_gost512_close(&ctx_gost, (void*) hash);
|
||||
|
||||
memcpy(output, hash, 32);
|
||||
}
|
||||
|
16
stratum/algos/skunk.h
Normal file
16
stratum/algos/skunk.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef SKUNK_H
|
||||
#define SKUNK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void skunk_hash(const char* input, char* output, uint32_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -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 },
|
||||
{"skunk", skunk_hash, 1, 0, 0},
|
||||
|
||||
{"bmw", bmw_hash, 1, 0, 0},
|
||||
{"lbry", lbry_hash, 0x100, 0, 0},
|
||||
|
|
|
@ -154,6 +154,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/skunk.h"
|
||||
#include "algos/timetravel.h"
|
||||
#include "algos/bitcore.h"
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ function yaamp_get_algos()
|
|||
'sib',
|
||||
'skein',
|
||||
'skein2',
|
||||
'skunk',
|
||||
'timetravel',
|
||||
'tribus',
|
||||
'vanilla',
|
||||
|
@ -153,6 +154,7 @@ function getAlgoColors($algo)
|
|||
'skein2' => '#c8a060',
|
||||
'timetravel' => '#f0b0d0',
|
||||
'bitcore' => '#f790c0',
|
||||
'skunk' => '#051313',
|
||||
'tribus' => '#c0d0d0',
|
||||
'vanilla' => '#f0f0f0',
|
||||
'velvet' => '#aac0cc',
|
||||
|
@ -222,6 +224,7 @@ function getAlgoPort($algo)
|
|||
'velvet' => 6133,
|
||||
'yescrypt' => 6233,
|
||||
'bastion' => 6433,
|
||||
'skunk' => 8433,
|
||||
'tribus' => 8533,
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue