summaryrefslogtreecommitdiff
path: root/src/include/skalibs/sha512.h
blob: 9d098be0b4856c06b8eb3cc35fa4301a2fd6a2c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ISC license. */

#ifndef SHA512_H
#define SHA512_H

#include <sys/types.h>
#include <skalibs/uint64.h>

typedef struct SHA512Schedule_s SHA512Schedule, *SHA512Schedule_ref ;
struct SHA512Schedule_s
{
  uint64 len ;
  uint64 h[8] ;
  unsigned char buf[128] ;
} ;

#define SHA512_INIT() { .len = 0, .h = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL } }
extern void sha512_init (SHA512Schedule *) ;
extern void sha512_update (SHA512Schedule *, char const *, size_t) ;
extern void sha512_final (SHA512Schedule *, char *digest) ;

#endif