forked from zone117x/node-multi-hashing
-
Notifications
You must be signed in to change notification settings - Fork 43
/
skein.c
26 lines (20 loc) · 600 Bytes
/
skein.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "skein.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "sha3/sph_skein.h"
#include "sha256.h"
#include <stdlib.h>
void skein_hash(const char* input, char* output, uint32_t len)
{
char temp[64];
sph_skein512_context ctx_skien;
sph_skein512_init(&ctx_skien);
sph_skein512(&ctx_skien, input, len);
sph_skein512_close(&ctx_skien, &temp);
SHA256_CTX ctx_sha256;
SHA256_Init(&ctx_sha256);
SHA256_Update(&ctx_sha256, &temp, 64);
SHA256_Final((unsigned char*) output, &ctx_sha256);
}