Add NetBSD/Solaris compatibility SHA header.
This commit is contained in:
parent
ccaf1e96be
commit
3491b19f5b
|
@ -0,0 +1,20 @@
|
|||
#ifndef _SHA2_H_
|
||||
#define _SHA2_H_
|
||||
|
||||
#include_next <sys/sha2.h>
|
||||
|
||||
#define SHA2_CTX SHA256_CTX
|
||||
#define SHA2Init(a, b) SHA256_Init(b)
|
||||
#define SHA2Update SHA256_Update
|
||||
|
||||
static void
|
||||
SHA2Final(void *digest, SHA2_CTX *ctx)
|
||||
{
|
||||
uint8_t tmp[SHA256_DIGEST_LENGTH];
|
||||
|
||||
SHA256_Final(tmp, ctx);
|
||||
memcpy(digest, &tmp, sizeof(tmp));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue