This commit is contained in:
Frank Denis 2016-11-26 20:24:58 +01:00
parent 2ace041fd9
commit 54a1357ce3

View File

@ -2,14 +2,15 @@
#include "utils.h" #include "utils.h"
int int
crypto_box_curve25519xsalsa20poly1305(unsigned char *c, const unsigned char *m, crypto_box_curve25519xsalsa20poly1305(unsigned char *c,
const unsigned char *m,
unsigned long long mlen, unsigned long long mlen,
const unsigned char *n, const unsigned char *n,
const unsigned char *pk, const unsigned char *pk,
const unsigned char *sk) const unsigned char *sk)
{ {
int ret;
unsigned char k[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES]; unsigned char k[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES];
int ret;
if (crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk) != 0) { if (crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk) != 0) {
return -1; return -1;
@ -21,12 +22,15 @@ crypto_box_curve25519xsalsa20poly1305(unsigned char *c, const unsigned char *m,
} }
int int
crypto_box_curve25519xsalsa20poly1305_open( crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m,
unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *c,
const unsigned char *n, const unsigned char *pk, const unsigned char *sk) unsigned long long clen,
const unsigned char *n,
const unsigned char *pk,
const unsigned char *sk)
{ {
int ret;
unsigned char k[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES]; unsigned char k[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES];
int ret;
if (crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk) != 0) { if (crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk) != 0) {
return -1; return -1;