rbnacl-libsodium 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/rbnacl/libsodium/version.rb +1 -1
- data/vendor/libsodium/AUTHORS +3 -0
- data/vendor/libsodium/ChangeLog +21 -0
- data/vendor/libsodium/Makefile.in +9 -0
- data/vendor/libsodium/THANKS +3 -0
- data/vendor/libsodium/aclocal.m4 +1 -0
- data/vendor/libsodium/autom4te.cache/output.1 +919 -85
- data/vendor/libsodium/autom4te.cache/output.5 +18351 -0
- data/vendor/libsodium/autom4te.cache/requests +960 -725
- data/vendor/libsodium/autom4te.cache/traces.1 +289 -247
- data/vendor/libsodium/autom4te.cache/traces.5 +3032 -0
- data/vendor/libsodium/build-aux/ltmain.sh +70 -11
- data/vendor/libsodium/builds/msvc/properties/ARM.props +20 -0
- data/vendor/libsodium/builds/msvc/properties/ReleaseDEXE.props +1 -1
- data/vendor/libsodium/builds/msvc/version.h +2 -2
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +3 -1
- data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +2 -0
- data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +3 -1
- data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +3 -1
- data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +13 -1
- data/vendor/libsodium/builds/msvc/vs2015/test/test.vcxproj +244 -241
- data/vendor/libsodium/builds/msvc/vs2015/test/test.vcxproj.filters +192 -189
- data/vendor/libsodium/configure +918 -84
- data/vendor/libsodium/configure.ac +89 -15
- data/vendor/libsodium/dist-build/Makefile.am +6 -2
- data/vendor/libsodium/dist-build/Makefile.in +15 -2
- data/vendor/libsodium/dist-build/android-armv8-a.sh +4 -0
- data/vendor/libsodium/dist-build/android-build.sh +9 -9
- data/vendor/libsodium/dist-build/android-mips64.sh +4 -0
- data/vendor/libsodium/dist-build/android-x86-64.sh +4 -0
- data/vendor/libsodium/dist-build/emscripten.sh +3 -3
- data/vendor/libsodium/dist-build/ios.sh +5 -5
- data/vendor/libsodium/dist-build/nativeclient.sh +28 -0
- data/vendor/libsodium/examples/Makefile +21 -0
- data/vendor/libsodium/examples/auth.c +68 -0
- data/vendor/libsodium/examples/box.c +133 -0
- data/vendor/libsodium/examples/box_detached.c +132 -0
- data/vendor/libsodium/examples/generichash.c +80 -0
- data/vendor/libsodium/examples/generichash_stream.c +58 -0
- data/vendor/libsodium/examples/shorthash.c +58 -0
- data/vendor/libsodium/examples/sign.c +78 -0
- data/vendor/libsodium/examples/utils.h +106 -0
- data/vendor/libsodium/libsodium-uninstalled.pc.in +1 -1
- data/vendor/libsodium/libsodium.vcxproj +2 -0
- data/vendor/libsodium/libsodium.vcxproj.filters +6 -0
- data/vendor/libsodium/m4/ax_check_compile_flag.m4 +2 -2
- data/vendor/libsodium/m4/ax_check_define.m4 +92 -0
- data/vendor/libsodium/m4/ax_check_link_flag.m4 +3 -2
- data/vendor/libsodium/m4/libtool.m4 +111 -60
- data/vendor/libsodium/m4/ltoptions.m4 +1 -1
- data/vendor/libsodium/m4/ltsugar.m4 +1 -1
- data/vendor/libsodium/m4/ltversion.m4 +6 -6
- data/vendor/libsodium/m4/lt~obsolete.m4 +1 -1
- data/vendor/libsodium/msvc-scripts/Makefile.in +9 -0
- data/vendor/libsodium/msvc-scripts/process.bat +2 -2
- data/vendor/libsodium/src/Makefile.in +9 -0
- data/vendor/libsodium/src/libsodium/Makefile.am +27 -3
- data/vendor/libsodium/src/libsodium/Makefile.in +170 -63
- data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +852 -0
- data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +137 -17
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +1 -0
- data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +10 -6
- data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +1 -1
- data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +29 -23
- data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +9 -10
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +4 -2
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +1 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +4 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +3 -0
- data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +2 -1
- data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_frombytes_curve25519_ref10.c +10 -10
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/api.h +10 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +51 -0
- data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20_api.c +29 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.am +6 -0
- data/vendor/libsodium/src/libsodium/include/Makefile.in +67 -40
- data/vendor/libsodium/src/libsodium/include/sodium.h +4 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +88 -0
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +28 -2
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +0 -6
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +1 -1
- data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +23 -0
- data/vendor/libsodium/src/libsodium/include/sodium/export.h +8 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_nativeclient.h +37 -0
- data/vendor/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h +3 -2
- data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +6 -0
- data/vendor/libsodium/src/libsodium/include/sodium/utils.h +15 -1
- data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +49 -0
- data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +11 -1
- data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +71 -45
- data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +12 -2
- data/vendor/libsodium/src/libsodium/sodium/runtime.c +26 -3
- data/vendor/libsodium/src/libsodium/sodium/utils.c +86 -13
- data/vendor/libsodium/test/Makefile.in +9 -0
- data/vendor/libsodium/test/default/Makefile.am +130 -0
- data/vendor/libsodium/test/default/Makefile.in +197 -50
- data/vendor/libsodium/test/default/aead_aes256gcm.c +3197 -0
- data/vendor/libsodium/test/default/aead_aes256gcm.exp +1 -0
- data/vendor/libsodium/test/default/aead_chacha20poly1305.c +150 -17
- data/vendor/libsodium/test/default/aead_chacha20poly1305.exp +51 -0
- data/vendor/libsodium/test/default/chacha20.c +80 -5
- data/vendor/libsodium/test/default/chacha20.exp +11 -0
- data/vendor/libsodium/test/default/generichash.c +1332 -1
- data/vendor/libsodium/test/default/generichash.exp +1 -1
- data/vendor/libsodium/test/default/generichash2.c +3 -2
- data/vendor/libsodium/test/default/generichash3.c +2 -1
- data/vendor/libsodium/test/default/nacl-test-wrapper.sh +26 -0
- data/vendor/libsodium/test/default/randombytes.c +4 -0
- data/vendor/libsodium/test/default/scalarmult.c +33 -14
- data/vendor/libsodium/test/default/scalarmult.exp +4 -4
- data/vendor/libsodium/test/default/secretbox.c +9 -0
- data/vendor/libsodium/test/default/secretbox.exp +19 -0
- data/vendor/libsodium/test/default/secretbox_easy.c +40 -4
- data/vendor/libsodium/test/default/secretbox_easy.exp +58 -1
- data/vendor/libsodium/test/default/sodium_core.c +2 -0
- data/vendor/libsodium/test/default/sodium_utils.c +46 -7
- data/vendor/libsodium/test/default/sodium_utils.exp +5 -0
- data/vendor/libsodium/test/default/stream.c +1 -0
- metadata +28 -3
@@ -53,6 +53,9 @@ PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt,
|
|
53
53
|
int k;
|
54
54
|
size_t clen;
|
55
55
|
|
56
|
+
if (dkLen > 0x1fffffffe0UL) {
|
57
|
+
abort();
|
58
|
+
}
|
56
59
|
crypto_auth_hmacsha256_init(&PShctx, passwd, passwdlen);
|
57
60
|
crypto_auth_hmacsha256_update(&PShctx, salt, saltlen);
|
58
61
|
|
@@ -28,7 +28,8 @@
|
|
28
28
|
* online backup system.
|
29
29
|
*/
|
30
30
|
|
31
|
-
#if defined(HAVE_EMMINTRIN_H) ||
|
31
|
+
#if defined(HAVE_EMMINTRIN_H) || \
|
32
|
+
(defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86)))
|
32
33
|
#if __GNUC__
|
33
34
|
# pragma GCC target("sse2")
|
34
35
|
#endif
|
@@ -58,16 +58,16 @@ void fe_frombytes(fe h,const unsigned char *s)
|
|
58
58
|
carry6 = (h6 + (crypto_int64) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
|
59
59
|
carry8 = (h8 + (crypto_int64) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26;
|
60
60
|
|
61
|
-
h[0] = h0;
|
62
|
-
h[1] = h1;
|
63
|
-
h[2] = h2;
|
64
|
-
h[3] = h3;
|
65
|
-
h[4] = h4;
|
66
|
-
h[5] = h5;
|
67
|
-
h[6] = h6;
|
68
|
-
h[7] = h7;
|
69
|
-
h[8] = h8;
|
70
|
-
h[9] = h9;
|
61
|
+
h[0] = (crypto_int32) h0;
|
62
|
+
h[1] = (crypto_int32) h1;
|
63
|
+
h[2] = (crypto_int32) h2;
|
64
|
+
h[3] = (crypto_int32) h3;
|
65
|
+
h[4] = (crypto_int32) h4;
|
66
|
+
h[5] = (crypto_int32) h5;
|
67
|
+
h[6] = (crypto_int32) h6;
|
68
|
+
h[7] = (crypto_int32) h7;
|
69
|
+
h[8] = (crypto_int32) h8;
|
70
|
+
h[9] = (crypto_int32) h9;
|
71
71
|
}
|
72
72
|
|
73
73
|
#endif
|
@@ -10,3 +10,13 @@ crypto_stream_chacha20_ref_xor_ic(unsigned char *c, const unsigned char *m,
|
|
10
10
|
unsigned long long mlen,
|
11
11
|
const unsigned char *n, uint64_t ic,
|
12
12
|
const unsigned char *k);
|
13
|
+
|
14
|
+
int
|
15
|
+
crypto_stream_chacha20_ietf_ref(unsigned char *c, unsigned long long clen,
|
16
|
+
const unsigned char *n, const unsigned char *k);
|
17
|
+
|
18
|
+
int
|
19
|
+
crypto_stream_chacha20_ietf_ref_xor_ic(unsigned char *c, const unsigned char *m,
|
20
|
+
unsigned long long mlen,
|
21
|
+
const unsigned char *n, uint32_t ic,
|
22
|
+
const unsigned char *k);
|
@@ -91,6 +91,15 @@ chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter)
|
|
91
91
|
x->input[15] = U8TO32_LITTLE(iv + 4);
|
92
92
|
}
|
93
93
|
|
94
|
+
static void
|
95
|
+
chacha_ietf_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter)
|
96
|
+
{
|
97
|
+
x->input[12] = counter == NULL ? 0 : U8TO32_LITTLE(counter);
|
98
|
+
x->input[13] = U8TO32_LITTLE(iv + 0);
|
99
|
+
x->input[14] = U8TO32_LITTLE(iv + 4);
|
100
|
+
x->input[15] = U8TO32_LITTLE(iv + 8);
|
101
|
+
}
|
102
|
+
|
94
103
|
static void
|
95
104
|
chacha_encrypt_bytes(chacha_ctx *x, const u8 *m, u8 *c, unsigned long long bytes)
|
96
105
|
{
|
@@ -248,6 +257,25 @@ crypto_stream_chacha20_ref(unsigned char *c, unsigned long long clen,
|
|
248
257
|
return 0;
|
249
258
|
}
|
250
259
|
|
260
|
+
int
|
261
|
+
crypto_stream_chacha20_ietf_ref(unsigned char *c, unsigned long long clen,
|
262
|
+
const unsigned char *n, const unsigned char *k)
|
263
|
+
{
|
264
|
+
struct chacha_ctx ctx;
|
265
|
+
|
266
|
+
if (!clen) {
|
267
|
+
return 0;
|
268
|
+
}
|
269
|
+
(void) sizeof(int[crypto_stream_chacha20_KEYBYTES == 256 / 8 ? 1 : -1]);
|
270
|
+
chacha_keysetup(&ctx, k);
|
271
|
+
chacha_ietf_ivsetup(&ctx, n, NULL);
|
272
|
+
memset(c, 0, clen);
|
273
|
+
chacha_encrypt_bytes(&ctx, c, c, clen);
|
274
|
+
sodium_memzero(&ctx, sizeof ctx);
|
275
|
+
|
276
|
+
return 0;
|
277
|
+
}
|
278
|
+
|
251
279
|
int
|
252
280
|
crypto_stream_chacha20_ref_xor_ic(unsigned char *c, const unsigned char *m,
|
253
281
|
unsigned long long mlen,
|
@@ -269,6 +297,29 @@ crypto_stream_chacha20_ref_xor_ic(unsigned char *c, const unsigned char *m,
|
|
269
297
|
chacha_keysetup(&ctx, k);
|
270
298
|
chacha_ivsetup(&ctx, n, ic_bytes);
|
271
299
|
chacha_encrypt_bytes(&ctx, m, c, mlen);
|
300
|
+
|
301
|
+
sodium_memzero(&ctx, sizeof ctx);
|
302
|
+
sodium_memzero(ic_bytes, sizeof ic_bytes);
|
303
|
+
|
304
|
+
return 0;
|
305
|
+
}
|
306
|
+
|
307
|
+
int
|
308
|
+
crypto_stream_chacha20_ietf_ref_xor_ic(unsigned char *c, const unsigned char *m,
|
309
|
+
unsigned long long mlen,
|
310
|
+
const unsigned char *n, uint32_t ic,
|
311
|
+
const unsigned char *k)
|
312
|
+
{
|
313
|
+
struct chacha_ctx ctx;
|
314
|
+
uint8_t ic_bytes[4];
|
315
|
+
|
316
|
+
if (!mlen) {
|
317
|
+
return 0;
|
318
|
+
}
|
319
|
+
U32TO8_LITTLE(ic_bytes, ic);
|
320
|
+
chacha_keysetup(&ctx, k);
|
321
|
+
chacha_ietf_ivsetup(&ctx, n, ic_bytes);
|
322
|
+
chacha_encrypt_bytes(&ctx, m, c, mlen);
|
272
323
|
sodium_memzero(&ctx, sizeof ctx);
|
273
324
|
sodium_memzero(ic_bytes, sizeof ic_bytes);
|
274
325
|
|
@@ -11,6 +11,11 @@ crypto_stream_chacha20_noncebytes(void) {
|
|
11
11
|
return crypto_stream_chacha20_NONCEBYTES;
|
12
12
|
}
|
13
13
|
|
14
|
+
size_t
|
15
|
+
crypto_stream_chacha20_ietf_noncebytes(void) {
|
16
|
+
return crypto_stream_chacha20_IETF_NONCEBYTES;
|
17
|
+
}
|
18
|
+
|
14
19
|
int
|
15
20
|
crypto_stream_chacha20(unsigned char *c, unsigned long long clen,
|
16
21
|
const unsigned char *n, const unsigned char *k)
|
@@ -18,6 +23,13 @@ crypto_stream_chacha20(unsigned char *c, unsigned long long clen,
|
|
18
23
|
return crypto_stream_chacha20_ref(c, clen, n, k);
|
19
24
|
}
|
20
25
|
|
26
|
+
int
|
27
|
+
crypto_stream_chacha20_ietf(unsigned char *c, unsigned long long clen,
|
28
|
+
const unsigned char *n, const unsigned char *k)
|
29
|
+
{
|
30
|
+
return crypto_stream_chacha20_ietf_ref(c, clen, n, k);
|
31
|
+
}
|
32
|
+
|
21
33
|
int
|
22
34
|
crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
23
35
|
unsigned long long mlen,
|
@@ -27,6 +39,15 @@ crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
|
27
39
|
return crypto_stream_chacha20_ref_xor_ic(c, m, mlen, n, ic, k);
|
28
40
|
}
|
29
41
|
|
42
|
+
int
|
43
|
+
crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m,
|
44
|
+
unsigned long long mlen,
|
45
|
+
const unsigned char *n, uint32_t ic,
|
46
|
+
const unsigned char *k)
|
47
|
+
{
|
48
|
+
return crypto_stream_chacha20_ietf_ref_xor_ic(c, m, mlen, n, ic, k);
|
49
|
+
}
|
50
|
+
|
30
51
|
int
|
31
52
|
crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
|
32
53
|
unsigned long long mlen, const unsigned char *n,
|
@@ -34,3 +55,11 @@ crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
|
|
34
55
|
{
|
35
56
|
return crypto_stream_chacha20_ref_xor_ic(c, m, mlen, n, 0U, k);
|
36
57
|
}
|
58
|
+
|
59
|
+
int
|
60
|
+
crypto_stream_chacha20_ietf_xor(unsigned char *c, const unsigned char *m,
|
61
|
+
unsigned long long mlen, const unsigned char *n,
|
62
|
+
const unsigned char *k)
|
63
|
+
{
|
64
|
+
return crypto_stream_chacha20_ietf_ref_xor_ic(c, m, mlen, n, 0U, k);
|
65
|
+
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
SODIUM_EXPORT = \
|
3
3
|
sodium.h \
|
4
4
|
sodium/core.h \
|
5
|
+
sodium/crypto_aead_aes256gcm.h \
|
5
6
|
sodium/crypto_aead_chacha20poly1305.h \
|
6
7
|
sodium/crypto_auth.h \
|
7
8
|
sodium/crypto_auth_hmacsha256.h \
|
@@ -53,6 +54,11 @@ SODIUM_EXPORT = \
|
|
53
54
|
sodium/runtime.h \
|
54
55
|
sodium/utils.h
|
55
56
|
|
57
|
+
if NATIVECLIENT
|
58
|
+
SODIUM_EXPORT += \
|
59
|
+
sodium/randombytes_nativeclient.h
|
60
|
+
endif
|
61
|
+
|
56
62
|
EXTRA_SRC = $(SODIUM_EXPORT) \
|
57
63
|
sodium/version.h.in
|
58
64
|
|
@@ -88,9 +88,13 @@ PRE_UNINSTALL = :
|
|
88
88
|
POST_UNINSTALL = :
|
89
89
|
build_triplet = @build@
|
90
90
|
host_triplet = @host@
|
91
|
+
@NATIVECLIENT_TRUE@am__append_1 = \
|
92
|
+
@NATIVECLIENT_TRUE@ sodium/randombytes_nativeclient.h
|
93
|
+
|
91
94
|
subdir = src/libsodium/include
|
92
95
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
93
96
|
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
97
|
+
$(top_srcdir)/m4/ax_check_define.m4 \
|
94
98
|
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
95
99
|
$(top_srcdir)/m4/ld-output-def.m4 $(top_srcdir)/m4/libtool.m4 \
|
96
100
|
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
@@ -98,7 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
|
98
102
|
$(top_srcdir)/configure.ac
|
99
103
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
100
104
|
$(ACLOCAL_M4)
|
101
|
-
DIST_COMMON = $(srcdir)/Makefile.am $(
|
105
|
+
DIST_COMMON = $(srcdir)/Makefile.am $(am__nobase_include_HEADERS_DIST) \
|
102
106
|
$(am__DIST_COMMON)
|
103
107
|
mkinstalldirs = $(install_sh) -d
|
104
108
|
CONFIG_CLEAN_FILES =
|
@@ -122,6 +126,41 @@ am__can_run_installinfo = \
|
|
122
126
|
n|no|NO) false;; \
|
123
127
|
*) (install-info --version) >/dev/null 2>&1;; \
|
124
128
|
esac
|
129
|
+
am__nobase_include_HEADERS_DIST = sodium.h sodium/core.h \
|
130
|
+
sodium/crypto_aead_aes256gcm.h \
|
131
|
+
sodium/crypto_aead_chacha20poly1305.h sodium/crypto_auth.h \
|
132
|
+
sodium/crypto_auth_hmacsha256.h \
|
133
|
+
sodium/crypto_auth_hmacsha512.h \
|
134
|
+
sodium/crypto_auth_hmacsha512256.h sodium/crypto_box.h \
|
135
|
+
sodium/crypto_box_curve25519xsalsa20poly1305.h \
|
136
|
+
sodium/crypto_core_hsalsa20.h sodium/crypto_core_salsa20.h \
|
137
|
+
sodium/crypto_core_salsa2012.h sodium/crypto_core_salsa208.h \
|
138
|
+
sodium/crypto_generichash.h \
|
139
|
+
sodium/crypto_generichash_blake2b.h sodium/crypto_hash.h \
|
140
|
+
sodium/crypto_hash_sha256.h sodium/crypto_hash_sha512.h \
|
141
|
+
sodium/crypto_onetimeauth.h \
|
142
|
+
sodium/crypto_onetimeauth_poly1305.h \
|
143
|
+
sodium/crypto_pwhash_scryptsalsa208sha256.h \
|
144
|
+
sodium/crypto_scalarmult.h \
|
145
|
+
sodium/crypto_scalarmult_curve25519.h \
|
146
|
+
sodium/crypto_secretbox.h \
|
147
|
+
sodium/crypto_secretbox_xsalsa20poly1305.h \
|
148
|
+
sodium/crypto_shorthash.h sodium/crypto_shorthash_siphash24.h \
|
149
|
+
sodium/crypto_sign.h sodium/crypto_sign_ed25519.h \
|
150
|
+
sodium/crypto_sign_edwards25519sha512batch.h \
|
151
|
+
sodium/crypto_stream.h sodium/crypto_stream_aes128ctr.h \
|
152
|
+
sodium/crypto_stream_chacha20.h sodium/crypto_stream_salsa20.h \
|
153
|
+
sodium/crypto_stream_salsa2012.h \
|
154
|
+
sodium/crypto_stream_salsa208.h \
|
155
|
+
sodium/crypto_stream_xsalsa20.h sodium/crypto_int32.h \
|
156
|
+
sodium/crypto_int64.h sodium/crypto_uint16.h \
|
157
|
+
sodium/crypto_uint32.h sodium/crypto_uint64.h \
|
158
|
+
sodium/crypto_uint8.h sodium/crypto_verify_16.h \
|
159
|
+
sodium/crypto_verify_32.h sodium/crypto_verify_64.h \
|
160
|
+
sodium/export.h sodium/randombytes.h \
|
161
|
+
sodium/randombytes_salsa20_random.h \
|
162
|
+
sodium/randombytes_sysrandom.h sodium/runtime.h sodium/utils.h \
|
163
|
+
sodium/randombytes_nativeclient.h
|
125
164
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
126
165
|
am__vpath_adj = case $$p in \
|
127
166
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
@@ -187,6 +226,13 @@ CCASDEPMODE = @CCASDEPMODE@
|
|
187
226
|
CCASFLAGS = @CCASFLAGS@
|
188
227
|
CCDEPMODE = @CCDEPMODE@
|
189
228
|
CFLAGS = @CFLAGS@
|
229
|
+
CFLAGS_AESNI = @CFLAGS_AESNI@
|
230
|
+
CFLAGS_MMX = @CFLAGS_MMX@
|
231
|
+
CFLAGS_PCLMUL = @CFLAGS_PCLMUL@
|
232
|
+
CFLAGS_SSE2 = @CFLAGS_SSE2@
|
233
|
+
CFLAGS_SSE3 = @CFLAGS_SSE3@
|
234
|
+
CFLAGS_SSE4_1 = @CFLAGS_SSE4_1@
|
235
|
+
CFLAGS_SSSE3 = @CFLAGS_SSSE3@
|
190
236
|
CPP = @CPP@
|
191
237
|
CPPFLAGS = @CPPFLAGS@
|
192
238
|
CWFLAGS = @CWFLAGS@
|
@@ -223,6 +269,7 @@ LIBTOOL_EXTRA_FLAGS = @LIBTOOL_EXTRA_FLAGS@
|
|
223
269
|
LIPO = @LIPO@
|
224
270
|
LN_S = @LN_S@
|
225
271
|
LTLIBOBJS = @LTLIBOBJS@
|
272
|
+
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
226
273
|
MAINT = @MAINT@
|
227
274
|
MAKEINFO = @MAKEINFO@
|
228
275
|
MANIFEST_TOOL = @MANIFEST_TOOL@
|
@@ -304,25 +351,17 @@ target_alias = @target_alias@
|
|
304
351
|
top_build_prefix = @top_build_prefix@
|
305
352
|
top_builddir = @top_builddir@
|
306
353
|
top_srcdir = @top_srcdir@
|
307
|
-
SODIUM_EXPORT = \
|
308
|
-
sodium.h \
|
309
|
-
sodium/core.h \
|
310
|
-
sodium/crypto_aead_chacha20poly1305.h \
|
311
|
-
sodium/crypto_auth.h \
|
354
|
+
SODIUM_EXPORT = sodium.h sodium/core.h sodium/crypto_aead_aes256gcm.h \
|
355
|
+
sodium/crypto_aead_chacha20poly1305.h sodium/crypto_auth.h \
|
312
356
|
sodium/crypto_auth_hmacsha256.h \
|
313
357
|
sodium/crypto_auth_hmacsha512.h \
|
314
|
-
sodium/crypto_auth_hmacsha512256.h \
|
315
|
-
sodium/crypto_box.h \
|
358
|
+
sodium/crypto_auth_hmacsha512256.h sodium/crypto_box.h \
|
316
359
|
sodium/crypto_box_curve25519xsalsa20poly1305.h \
|
317
|
-
sodium/crypto_core_hsalsa20.h \
|
318
|
-
sodium/
|
319
|
-
sodium/crypto_core_salsa2012.h \
|
320
|
-
sodium/crypto_core_salsa208.h \
|
360
|
+
sodium/crypto_core_hsalsa20.h sodium/crypto_core_salsa20.h \
|
361
|
+
sodium/crypto_core_salsa2012.h sodium/crypto_core_salsa208.h \
|
321
362
|
sodium/crypto_generichash.h \
|
322
|
-
sodium/crypto_generichash_blake2b.h \
|
323
|
-
sodium/
|
324
|
-
sodium/crypto_hash_sha256.h \
|
325
|
-
sodium/crypto_hash_sha512.h \
|
363
|
+
sodium/crypto_generichash_blake2b.h sodium/crypto_hash.h \
|
364
|
+
sodium/crypto_hash_sha256.h sodium/crypto_hash_sha512.h \
|
326
365
|
sodium/crypto_onetimeauth.h \
|
327
366
|
sodium/crypto_onetimeauth_poly1305.h \
|
328
367
|
sodium/crypto_pwhash_scryptsalsa208sha256.h \
|
@@ -330,34 +369,22 @@ SODIUM_EXPORT = \
|
|
330
369
|
sodium/crypto_scalarmult_curve25519.h \
|
331
370
|
sodium/crypto_secretbox.h \
|
332
371
|
sodium/crypto_secretbox_xsalsa20poly1305.h \
|
333
|
-
sodium/crypto_shorthash.h \
|
334
|
-
sodium/
|
335
|
-
sodium/crypto_sign.h \
|
336
|
-
sodium/crypto_sign_ed25519.h \
|
372
|
+
sodium/crypto_shorthash.h sodium/crypto_shorthash_siphash24.h \
|
373
|
+
sodium/crypto_sign.h sodium/crypto_sign_ed25519.h \
|
337
374
|
sodium/crypto_sign_edwards25519sha512batch.h \
|
338
|
-
sodium/crypto_stream.h \
|
339
|
-
sodium/
|
340
|
-
sodium/crypto_stream_chacha20.h \
|
341
|
-
sodium/crypto_stream_salsa20.h \
|
375
|
+
sodium/crypto_stream.h sodium/crypto_stream_aes128ctr.h \
|
376
|
+
sodium/crypto_stream_chacha20.h sodium/crypto_stream_salsa20.h \
|
342
377
|
sodium/crypto_stream_salsa2012.h \
|
343
378
|
sodium/crypto_stream_salsa208.h \
|
344
|
-
sodium/crypto_stream_xsalsa20.h \
|
345
|
-
sodium/
|
346
|
-
sodium/
|
347
|
-
sodium/
|
348
|
-
sodium/
|
349
|
-
sodium/
|
350
|
-
sodium/crypto_uint8.h \
|
351
|
-
sodium/crypto_verify_16.h \
|
352
|
-
sodium/crypto_verify_32.h \
|
353
|
-
sodium/crypto_verify_64.h \
|
354
|
-
sodium/export.h \
|
355
|
-
sodium/randombytes.h \
|
379
|
+
sodium/crypto_stream_xsalsa20.h sodium/crypto_int32.h \
|
380
|
+
sodium/crypto_int64.h sodium/crypto_uint16.h \
|
381
|
+
sodium/crypto_uint32.h sodium/crypto_uint64.h \
|
382
|
+
sodium/crypto_uint8.h sodium/crypto_verify_16.h \
|
383
|
+
sodium/crypto_verify_32.h sodium/crypto_verify_64.h \
|
384
|
+
sodium/export.h sodium/randombytes.h \
|
356
385
|
sodium/randombytes_salsa20_random.h \
|
357
|
-
sodium/randombytes_sysrandom.h \
|
358
|
-
|
359
|
-
sodium/utils.h
|
360
|
-
|
386
|
+
sodium/randombytes_sysrandom.h sodium/runtime.h sodium/utils.h \
|
387
|
+
$(am__append_1)
|
361
388
|
EXTRA_SRC = $(SODIUM_EXPORT) \
|
362
389
|
sodium/version.h.in
|
363
390
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
#define sodium_H
|
4
4
|
|
5
5
|
#include "sodium/core.h"
|
6
|
+
#include "sodium/crypto_aead_aes256gcm.h"
|
6
7
|
#include "sodium/crypto_aead_chacha20poly1305.h"
|
7
8
|
#include "sodium/crypto_auth.h"
|
8
9
|
#include "sodium/crypto_auth_hmacsha256.h"
|
@@ -41,6 +42,9 @@
|
|
41
42
|
#include "sodium/crypto_verify_32.h"
|
42
43
|
#include "sodium/crypto_verify_64.h"
|
43
44
|
#include "sodium/randombytes.h"
|
45
|
+
#ifdef __native_client__
|
46
|
+
# include "sodium/randombytes_nativeclient.h"
|
47
|
+
#endif
|
44
48
|
#include "sodium/randombytes_salsa20_random.h"
|
45
49
|
#include "sodium/randombytes_sysrandom.h"
|
46
50
|
#include "sodium/runtime.h"
|
@@ -0,0 +1,88 @@
|
|
1
|
+
#ifndef crypto_aead_aes256gcm_H
|
2
|
+
#define crypto_aead_aes256gcm_H
|
3
|
+
|
4
|
+
#include <stddef.h>
|
5
|
+
#include "export.h"
|
6
|
+
|
7
|
+
#ifdef __cplusplus
|
8
|
+
# if __GNUC__
|
9
|
+
# pragma GCC diagnostic ignored "-Wlong-long"
|
10
|
+
# endif
|
11
|
+
extern "C" {
|
12
|
+
#endif
|
13
|
+
|
14
|
+
SODIUM_EXPORT
|
15
|
+
int crypto_aead_aes256gcm_is_available(void);
|
16
|
+
|
17
|
+
#define crypto_aead_aes256gcm_KEYBYTES 32U
|
18
|
+
SODIUM_EXPORT
|
19
|
+
size_t crypto_aead_aes256gcm_keybytes(void);
|
20
|
+
|
21
|
+
#define crypto_aead_aes256gcm_NSECBYTES 0U
|
22
|
+
SODIUM_EXPORT
|
23
|
+
size_t crypto_aead_aes256gcm_nsecbytes(void);
|
24
|
+
|
25
|
+
#define crypto_aead_aes256gcm_NPUBBYTES 12U
|
26
|
+
SODIUM_EXPORT
|
27
|
+
size_t crypto_aead_aes256gcm_npubbytes(void);
|
28
|
+
|
29
|
+
#define crypto_aead_aes256gcm_ABYTES 16U
|
30
|
+
SODIUM_EXPORT
|
31
|
+
size_t crypto_aead_aes256gcm_abytes(void);
|
32
|
+
|
33
|
+
typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_state[512];
|
34
|
+
SODIUM_EXPORT
|
35
|
+
size_t crypto_aead_aes256gcm_statebytes(void);
|
36
|
+
|
37
|
+
SODIUM_EXPORT
|
38
|
+
int crypto_aead_aes256gcm_encrypt(unsigned char *c,
|
39
|
+
unsigned long long *clen_p,
|
40
|
+
const unsigned char *m,
|
41
|
+
unsigned long long mlen,
|
42
|
+
const unsigned char *ad,
|
43
|
+
unsigned long long adlen,
|
44
|
+
const unsigned char *nsec,
|
45
|
+
const unsigned char *npub,
|
46
|
+
const unsigned char *k);
|
47
|
+
|
48
|
+
SODIUM_EXPORT
|
49
|
+
int crypto_aead_aes256gcm_decrypt(unsigned char *m,
|
50
|
+
unsigned long long *mlen_p,
|
51
|
+
unsigned char *nsec,
|
52
|
+
const unsigned char *c,
|
53
|
+
unsigned long long clen,
|
54
|
+
const unsigned char *ad,
|
55
|
+
unsigned long long adlen,
|
56
|
+
const unsigned char *npub,
|
57
|
+
const unsigned char *k);
|
58
|
+
|
59
|
+
SODIUM_EXPORT
|
60
|
+
int crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *ctx_,
|
61
|
+
const unsigned char *k);
|
62
|
+
|
63
|
+
SODIUM_EXPORT
|
64
|
+
int crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c,
|
65
|
+
unsigned long long *clen_p,
|
66
|
+
const unsigned char *m,
|
67
|
+
unsigned long long mlen,
|
68
|
+
const unsigned char *ad,
|
69
|
+
unsigned long long adlen,
|
70
|
+
const unsigned char *nsec,
|
71
|
+
const unsigned char *npub,
|
72
|
+
const crypto_aead_aes256gcm_state *ctx_);
|
73
|
+
|
74
|
+
SODIUM_EXPORT
|
75
|
+
int crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m,
|
76
|
+
unsigned long long *mlen_p,
|
77
|
+
unsigned char *nsec,
|
78
|
+
const unsigned char *c,
|
79
|
+
unsigned long long clen,
|
80
|
+
const unsigned char *ad,
|
81
|
+
unsigned long long adlen,
|
82
|
+
const unsigned char *npub,
|
83
|
+
const crypto_aead_aes256gcm_state *ctx_);
|
84
|
+
#ifdef __cplusplus
|
85
|
+
}
|
86
|
+
#endif
|
87
|
+
|
88
|
+
#endif
|