c-libp2p/crypto/sha512.c

14 lines
383 B
C
Raw Normal View History

2017-01-23 16:31:24 +00:00
#include "mbedtls/sha512.h"
/***
* hash a string using SHA512
* @param input the input string
* @param input_length the length of the input string
* @param output where to place the results
* @returns 1
*/
2017-03-07 00:03:04 +00:00
int libp2p_crypto_hashing_sha512(const unsigned char* input, size_t input_length, unsigned char* output) {
2017-01-23 16:31:24 +00:00
mbedtls_sha512(input, input_length, output, 0);
2017-02-08 16:08:05 +00:00
return 64;
2017-01-23 16:31:24 +00:00
}