hash.c 692 Bytes
Newer Older
lwc-tester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#ifdef REDIRECT_DBG_TO_FILE
#include <stdio.h>
#include <stdarg.h>
#define bytes_utiles_printf append_to_log
static void append_to_log(const char *format, ...){
    static FILE *fp=0;
    if(0==fp) fp=fopen("/tmp/mylog", "w");
    va_list vargs;
    va_start(vargs, format);
    vfprintf(fp,format, vargs);
    va_end(vargs);
}
#endif

lwc-tester committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#include "crypto_hash.h"
#include "drysponge.h"

int crypto_hash(
    unsigned char *out,
    const unsigned char *in,
    unsigned long long inlen
){
    (void) DRYSPONGE_enc; //avoid warning
    (void) DRYSPONGE_dec; //avoid warning
    DRYSPONGE_hash(
        in,     // message,
        inlen,  // mlen,
        out     //digest
    );
    return 0;
}