Wrap crypto_secretbox

This commit is contained in:
Frank Denis
2013-04-21 17:32:08 -07:00
parent fade3b640c
commit c46e08585b
3 changed files with 27 additions and 2 deletions
+1
View File
@@ -48,6 +48,7 @@ libsodium_la_SOURCES = \
crypto_onetimeauth/poly1305/ref/auth_poly1305_ref.c \
crypto_onetimeauth/poly1305/ref/verify_poly1305_ref.c \
crypto_scalarmult/crypto_scalarmult.c \
crypto_secretbox/crypto_secretbox.c \
crypto_secretbox/xsalsa20poly1305/ref/api.h \
crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c \
crypto_shorthash/siphash24/ref/api.h \
@@ -0,0 +1,18 @@
#include "crypto_secretbox.h"
int
crypto_secretbox(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k)
{
return crypto_secretbox_xsalsa20poly1305(c, m, mlen, n, k);
}
int
crypto_secretbox_open(unsigned char *m, const unsigned char *c,
unsigned long long clen, const unsigned char *n,
const unsigned char *k)
{
return crypto_secretbox_xsalsa20poly1305_open(m, c, clen, n, k);
}
@@ -3,12 +3,18 @@
#include "crypto_secretbox_xsalsa20poly1305.h"
#define crypto_secretbox crypto_secretbox_xsalsa20poly1305
#define crypto_secretbox_open crypto_secretbox_xsalsa20poly1305_open
#define crypto_secretbox_KEYBYTES crypto_secretbox_xsalsa20poly1305_KEYBYTES
#define crypto_secretbox_NONCEBYTES crypto_secretbox_xsalsa20poly1305_NONCEBYTES
#define crypto_secretbox_ZEROBYTES crypto_secretbox_xsalsa20poly1305_ZEROBYTES
#define crypto_secretbox_BOXZEROBYTES crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES
#define crypto_secretbox_PRIMITIVE "xsalsa20poly1305"
int crypto_secretbox(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
int crypto_secretbox_open(unsigned char *m, const unsigned char *c,
unsigned long long clen, const unsigned char *n,
const unsigned char *k);
#endif