mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
crypto_hash compat
This commit is contained in:
@@ -16,6 +16,8 @@ SODIUM_EXPORT
|
||||
int crypto_hash(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
#define crypto_hash_sha512 crypto_hash
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "crypto_auth_hmacsha256.h"
|
||||
#include "crypto_auth_hmacsha512256.h"
|
||||
#include "crypto_box_curve25519xsalsa20poly1305.h"
|
||||
#include "crypto_hash_sha256.h"
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "crypto_scalarmult_curve25519.h"
|
||||
#include "crypto_secretbox_xsalsa20poly1305.h"
|
||||
#include "export.h"
|
||||
@@ -10,6 +12,22 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#undef crypto_hash_sha256_ref
|
||||
SODIUM_EXPORT int
|
||||
crypto_hash_sha256_ref(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen)
|
||||
{
|
||||
return crypto_hash_sha256(out, in, inlen);
|
||||
}
|
||||
|
||||
#undef crypto_hash_sha512_ref
|
||||
SODIUM_EXPORT int
|
||||
crypto_hash_sha512_ref(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen)
|
||||
{
|
||||
return crypto_hash_sha512(out, in, inlen);
|
||||
}
|
||||
|
||||
#undef crypto_auth_hmacsha256_ref
|
||||
SODIUM_EXPORT int
|
||||
crypto_auth_hmacsha256_ref(unsigned char *out, const unsigned char *in,
|
||||
|
||||
Reference in New Issue
Block a user