mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
40 lines
997 B
C
40 lines
997 B
C
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
|
|
#include <sha3/sph_skein.h>
|
|
#include <sha3/sph_shavite.h>
|
|
#include <sha3/sph_shabal.h>
|
|
//#include <sha3/sph_streebog.h>
|
|
|
|
#include "gost.h"
|
|
|
|
void veltor_hash(const char *input, char* output, uint32_t len)
|
|
{
|
|
uint32_t hash[16];
|
|
|
|
sph_skein512_context ctx_skein;
|
|
sph_shavite512_context ctx_shavite;
|
|
sph_shabal512_context ctx_shabal;
|
|
sph_gost512_context ctx_gost;
|
|
|
|
sph_skein512_init(&ctx_skein);
|
|
sph_skein512(&ctx_skein, input, 80);
|
|
sph_skein512_close(&ctx_skein, (void*) hash);
|
|
|
|
sph_shavite512_init(&ctx_shavite);
|
|
sph_shavite512(&ctx_shavite, (const void*) hash, 64);
|
|
sph_shavite512_close(&ctx_shavite, (void*) hash);
|
|
|
|
sph_shabal512_init(&ctx_shabal);
|
|
sph_shabal512(&ctx_shabal, (const void*) hash, 64);
|
|
sph_shabal512_close(&ctx_shabal, (void*) 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);
|
|
}
|
|
|