xref: /netbsd-src/crypto/external/bsd/openssh/dist/hash.c (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1 /* $OpenBSD: hash.c,v 1.5 2018/01/13 00:24:09 naddy Exp $ */
2 /*
3  * Public domain. Author: Christian Weisgerber <naddy@openbsd.org>
4  * API compatible reimplementation of function from nacl
5  */
6 #include "includes.h"
7 __RCSID("$NetBSD: hash.c,v 1.6 2018/04/06 18:59:00 christos Exp $");
8 
9 #include "crypto_api.h"
10 
11 #include <stdarg.h>
12 
13 #include "digest.h"
14 #include "log.h"
15 #include "ssherr.h"
16 
17 int
18 crypto_hash_sha512(unsigned char *out, const unsigned char *in,
19     unsigned long long inlen)
20 {
21 	int r;
22 
23 	if ((r = ssh_digest_memory(SSH_DIGEST_SHA512, in, inlen, out,
24 	    crypto_hash_sha512_BYTES)) != 0)
25 		fatal("%s: %s", __func__, ssh_err(r));
26 	return 0;
27 }
28