summaryrefslogtreecommitdiff
path: root/nacl/crypto_secretbox/xsalsa20poly1305
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-13 10:09:38 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-13 10:09:38 -0400
commitd4fe483efd3e0062f12430efe9deb66d43d914d7 (patch)
treee6aa9ac716ae82cdb15c6e6cb5d9d1d9d29f053b /nacl/crypto_secretbox/xsalsa20poly1305
parent835ef0320d47372eac14bef31c979b8217d04498 (diff)
NaCl moved to other repo.
Diffstat (limited to 'nacl/crypto_secretbox/xsalsa20poly1305')
-rw-r--r--nacl/crypto_secretbox/xsalsa20poly1305/checksum1
-rw-r--r--nacl/crypto_secretbox/xsalsa20poly1305/ref/api.h4
-rw-r--r--nacl/crypto_secretbox/xsalsa20poly1305/ref/box.c35
-rw-r--r--nacl/crypto_secretbox/xsalsa20poly1305/selected0
-rw-r--r--nacl/crypto_secretbox/xsalsa20poly1305/used0
5 files changed, 0 insertions, 40 deletions
diff --git a/nacl/crypto_secretbox/xsalsa20poly1305/checksum b/nacl/crypto_secretbox/xsalsa20poly1305/checksum
deleted file mode 100644
index af3c6897..00000000
--- a/nacl/crypto_secretbox/xsalsa20poly1305/checksum
+++ /dev/null
@@ -1 +0,0 @@
1df372f95dd87381b7c9ceb6f340ccaa03d19bed5d9e4ab004d99d847675a9658
diff --git a/nacl/crypto_secretbox/xsalsa20poly1305/ref/api.h b/nacl/crypto_secretbox/xsalsa20poly1305/ref/api.h
deleted file mode 100644
index f5aeb356..00000000
--- a/nacl/crypto_secretbox/xsalsa20poly1305/ref/api.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#define CRYPTO_KEYBYTES 32
2#define CRYPTO_NONCEBYTES 24
3#define CRYPTO_ZEROBYTES 32
4#define CRYPTO_BOXZEROBYTES 16
diff --git a/nacl/crypto_secretbox/xsalsa20poly1305/ref/box.c b/nacl/crypto_secretbox/xsalsa20poly1305/ref/box.c
deleted file mode 100644
index f1abb06f..00000000
--- a/nacl/crypto_secretbox/xsalsa20poly1305/ref/box.c
+++ /dev/null
@@ -1,35 +0,0 @@
1#include "crypto_onetimeauth_poly1305.h"
2#include "crypto_stream_xsalsa20.h"
3#include "crypto_secretbox.h"
4
5int crypto_secretbox(
6 unsigned char *c,
7 const unsigned char *m,unsigned long long mlen,
8 const unsigned char *n,
9 const unsigned char *k
10)
11{
12 int i;
13 if (mlen < 32) return -1;
14 crypto_stream_xsalsa20_xor(c,m,mlen,n,k);
15 crypto_onetimeauth_poly1305(c + 16,c + 32,mlen - 32,c);
16 for (i = 0;i < 16;++i) c[i] = 0;
17 return 0;
18}
19
20int crypto_secretbox_open(
21 unsigned char *m,
22 const unsigned char *c,unsigned long long clen,
23 const unsigned char *n,
24 const unsigned char *k
25)
26{
27 int i;
28 unsigned char subkey[32];
29 if (clen < 32) return -1;
30 crypto_stream_xsalsa20(subkey,32,n,k);
31 if (crypto_onetimeauth_poly1305_verify(c + 16,c + 32,clen - 32,subkey) != 0) return -1;
32 crypto_stream_xsalsa20_xor(m,c,clen,n,k);
33 for (i = 0;i < 32;++i) m[i] = 0;
34 return 0;
35}
diff --git a/nacl/crypto_secretbox/xsalsa20poly1305/selected b/nacl/crypto_secretbox/xsalsa20poly1305/selected
deleted file mode 100644
index e69de29b..00000000
--- a/nacl/crypto_secretbox/xsalsa20poly1305/selected
+++ /dev/null
diff --git a/nacl/crypto_secretbox/xsalsa20poly1305/used b/nacl/crypto_secretbox/xsalsa20poly1305/used
deleted file mode 100644
index e69de29b..00000000
--- a/nacl/crypto_secretbox/xsalsa20poly1305/used
+++ /dev/null