1 /* $OpenBSD: hash.c,v 1.6 2019/11/29 00:11:21 djm Exp $ */
3 * Public domain. Author: Christian Weisgerber <naddy@openbsd.org>
4 * API compatible reimplementation of function from nacl
9 #include "crypto_api.h"
14 #include <openssl/evp.h>
17 crypto_hash_sha512(unsigned char *out
, const unsigned char *in
,
18 unsigned long long inlen
)
21 if (!EVP_Digest(in
, inlen
, out
, NULL
, EVP_sha512(), NULL
))
32 crypto_hash_sha512(unsigned char *out
, const unsigned char *in
,
33 unsigned long long inlen
)
39 SHA512Update(&ctx
, in
, inlen
);
40 SHA512Final(out
, &ctx
);
43 #endif /* WITH_OPENSSL */