crypto_stream macros -> functions

This commit is contained in:
Frank Denis
2013-04-21 17:32:08 -07:00
parent 55d0b9f486
commit 3ffdfd2b3d
3 changed files with 27 additions and 5 deletions
+1
View File
@@ -118,6 +118,7 @@ libsodium_la_SOURCES = \
crypto_sign/edwards25519sha512batch/ref/sc25519.h \
crypto_sign/edwards25519sha512batch/ref/sc25519_edwards25519sha512batch.c \
crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c \
crypto_stream/crypto_stream.c \
crypto_stream/aes128ctr/portable/afternm_aes128ctr.c \
crypto_stream/aes128ctr/portable/api.h \
crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c \
@@ -0,0 +1,18 @@
#include "crypto_stream.h"
int
crypto_stream(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k)
{
return crypto_stream_xsalsa20(c, clen, n, k);
}
int
crypto_stream_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k)
{
return crypto_stream_xsalsa20_xor(c, m, mlen, n, k);
}
+8 -5
View File
@@ -3,13 +3,16 @@
#include "crypto_stream_xsalsa20.h"
#define crypto_stream crypto_stream_xsalsa20
#define crypto_stream_xor crypto_stream_xsalsa20_xor
#define crypto_stream_beforenm crypto_stream_xsalsa20_beforenm
#define crypto_stream_afternm crypto_stream_xsalsa20_afternm
#define crypto_stream_xor_afternm crypto_stream_xsalsa20_xor_afternm
#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES
#define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES
#define crypto_stream_PRIMITIVE "xsalsa20"
int crypto_stream(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
int crypto_stream_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
#endif