29 lines
622 B
C
29 lines
622 B
C
#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 = (char*) malloc(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(output, &ctx_sha256);
|
|
|
|
free(temp);
|
|
}
|
|
|