reftable/reader: inline `reader_close()`
[git/gitster.git] / sha256 / nettle.h
blobb63e1c81903c61cb212686658fa6a56fd469db62
1 #ifndef SHA256_NETTLE_H
2 #define SHA256_NETTLE_H
4 #include <nettle/sha2.h>
6 typedef struct sha256_ctx nettle_SHA256_CTX;
8 static inline void nettle_SHA256_Init(nettle_SHA256_CTX *ctx)
10 sha256_init(ctx);
13 static inline void nettle_SHA256_Update(nettle_SHA256_CTX *ctx,
14 const void *data,
15 size_t len)
17 sha256_update(ctx, len, data);
20 static inline void nettle_SHA256_Final(unsigned char *digest,
21 nettle_SHA256_CTX *ctx)
23 sha256_digest(ctx, SHA256_DIGEST_SIZE, digest);
26 #define platform_SHA256_CTX nettle_SHA256_CTX
27 #define platform_SHA256_Init nettle_SHA256_Init
28 #define platform_SHA256_Update nettle_SHA256_Update
29 #define platform_SHA256_Final nettle_SHA256_Final
31 #endif