xref: /netbsd-src/external/cddl/osnet/include/sha2.h (revision 32fa36ddd0de97269177c11e199e23c3960aab68)
1 #ifndef _SHA256_H_
2 #define _SHA256_H_
3 
4 #include <string.h>
5 
6 #include_next <sha2.h>
7 
8 #define SHA256Init(b)	SHA256_Init(b)
9 #define SHA256Update	SHA256_Update
10 
11 static void
SHA256Final(void * digest,SHA256_CTX * ctx)12 SHA256Final(void *digest, SHA256_CTX *ctx)
13 {
14 	uint8_t tmp[SHA256_DIGEST_LENGTH];
15 
16 	SHA256_Final(tmp, ctx);
17 	memcpy(digest, &tmp, sizeof(tmp));
18 }
19 
20 
21 #endif
22