aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/yarrow/yhash.h
blob: 98c440302428721cab85cd1fba764a24edcd0902 (plain)
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
/* -*- Mode: C; c-file-style: "bsd" -*- */

#ifndef YHASH_H
#define YHASH_H

/* hash function interface */

/* default to SHA1 for yarrow 160 */

#include "shs.h"



#define HASH_CTX SHS_INFO
#define HASH_Init(x) shsInit(x)
#define HASH_Update(x, buf, sz) shsUpdate(x, (const void*)buf, sz)
#define HASH_Final(x, tdigest)  do { \
  shsFinal(x); \
  memcpy((tdigest), (void *) (x)->digest, SHS_DIGESTSIZE); \
  } while(0)


#define HASH_DIGEST_SIZE SHS_DIGESTSIZE

#endif /* YHASH_H */