rbnacl-libsodium 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +6 -2
  3. data/lib/rbnacl/libsodium/version.rb +1 -1
  4. data/vendor/libsodium/ChangeLog +24 -0
  5. data/vendor/libsodium/LICENSE +2 -0
  6. data/vendor/libsodium/Makefile.in +6 -1
  7. data/vendor/libsodium/aclocal.m4 +1 -0
  8. data/vendor/libsodium/autom4te.cache/output.1 +1896 -1136
  9. data/vendor/libsodium/autom4te.cache/output.7 +19837 -0
  10. data/vendor/libsodium/autom4te.cache/requests +1271 -1031
  11. data/vendor/libsodium/autom4te.cache/traces.1 +532 -491
  12. data/vendor/libsodium/autom4te.cache/traces.7 +3614 -0
  13. data/vendor/libsodium/builds/msvc/version.h +2 -2
  14. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +22 -1
  15. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +23 -20
  16. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +13 -2
  17. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +12 -9
  18. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +12 -1
  19. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +3 -0
  20. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +2 -1
  21. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +14 -11
  22. data/vendor/libsodium/configure +1887 -1127
  23. data/vendor/libsodium/configure.ac +44 -11
  24. data/vendor/libsodium/dist-build/Makefile.am +4 -2
  25. data/vendor/libsodium/dist-build/Makefile.in +9 -2
  26. data/vendor/libsodium/dist-build/android-armv8-a.sh +1 -1
  27. data/vendor/libsodium/dist-build/android-build.sh +40 -3
  28. data/vendor/libsodium/dist-build/android-mips64.sh +1 -1
  29. data/vendor/libsodium/dist-build/android-x86_64.sh +4 -0
  30. data/vendor/libsodium/dist-build/emscripten-symbols.def +25 -25
  31. data/vendor/libsodium/dist-build/emscripten.sh +69 -35
  32. data/vendor/libsodium/dist-build/msys2-win32.sh +8 -2
  33. data/vendor/libsodium/dist-build/msys2-win64.sh +8 -2
  34. data/vendor/libsodium/dist-build/{nativeclient.sh → nativeclient-pnacl.sh} +3 -4
  35. data/vendor/libsodium/dist-build/nativeclient-x86.sh +19 -0
  36. data/vendor/libsodium/dist-build/nativeclient-x86_64.sh +19 -0
  37. data/vendor/libsodium/logo.png +0 -0
  38. data/vendor/libsodium/m4/ax_pthread.m4 +485 -0
  39. data/vendor/libsodium/msvc-scripts/Makefile.in +5 -0
  40. data/vendor/libsodium/msvc-scripts/process.bat +2 -2
  41. data/vendor/libsodium/packaging/nuget/package.bat +3 -3
  42. data/vendor/libsodium/src/Makefile.in +5 -0
  43. data/vendor/libsodium/src/libsodium/Makefile.am +2 -1
  44. data/vendor/libsodium/src/libsodium/Makefile.in +13 -8
  45. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +70 -87
  46. data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +6 -0
  47. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-avx2.c +1 -1
  48. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +9 -1
  49. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +11 -4
  50. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +14 -8
  51. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c +0 -1
  52. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +10 -6
  53. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +2 -1
  54. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +1 -1
  55. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +11 -11
  56. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h +2 -2
  57. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +3 -0
  58. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +3 -0
  59. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +830 -826
  60. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S +732 -728
  61. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +3 -0
  62. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128.h +1 -1
  63. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S +8 -0
  64. data/vendor/libsodium/src/libsodium/include/Makefile.in +5 -0
  65. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +1 -1
  66. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +1 -1
  67. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth.h +1 -1
  68. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +1 -1
  69. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512.h +1 -1
  70. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +1 -1
  71. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +3 -3
  72. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +1 -1
  73. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash.h +1 -1
  74. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +1 -1
  75. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash.h +1 -1
  76. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +1 -1
  77. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h +1 -1
  78. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h +1 -1
  79. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +1 -1
  80. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash.h +1 -1
  81. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +1 -1
  82. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +1 -1
  83. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +1 -1
  84. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +1 -1
  85. data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash.h +1 -1
  86. data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +1 -1
  87. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +3 -3
  88. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +1 -1
  89. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +1 -1
  90. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +1 -1
  91. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +1 -1
  92. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +1 -1
  93. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h +1 -1
  94. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +1 -1
  95. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +1 -1
  96. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +1 -1
  97. data/vendor/libsodium/src/libsodium/include/sodium/private/curve25519_ref10.h +2 -2
  98. data/vendor/libsodium/src/libsodium/include/sodium/private/mutex.h +7 -0
  99. data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +1 -1
  100. data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +15 -4
  101. data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +25 -15
  102. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +72 -15
  103. data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +43 -4
  104. data/vendor/libsodium/src/libsodium/sodium/core.c +131 -2
  105. data/vendor/libsodium/src/libsodium/sodium/runtime.c +5 -2
  106. data/vendor/libsodium/src/libsodium/sodium/utils.c +16 -8
  107. data/vendor/libsodium/test/Makefile.in +5 -0
  108. data/vendor/libsodium/test/default/Makefile.in +5 -0
  109. data/vendor/libsodium/test/default/generichash2.c +8 -2
  110. data/vendor/libsodium/test/default/nacl-test-wrapper.sh +19 -17
  111. data/vendor/libsodium/test/default/randombytes.c +4 -2
  112. data/vendor/libsodium/test/quirks/quirks.h +23 -2
  113. metadata +11 -15
  114. data/vendor/libsodium/README +0 -1
  115. data/vendor/libsodium/dist-build/android-x86-64.sh +0 -4
  116. data/vendor/libsodium/examples/Makefile +0 -21
  117. data/vendor/libsodium/examples/auth.c +0 -68
  118. data/vendor/libsodium/examples/box.c +0 -135
  119. data/vendor/libsodium/examples/box_detached.c +0 -134
  120. data/vendor/libsodium/examples/generichash.c +0 -80
  121. data/vendor/libsodium/examples/generichash_stream.c +0 -58
  122. data/vendor/libsodium/examples/shorthash.c +0 -58
  123. data/vendor/libsodium/examples/sign.c +0 -78
  124. data/vendor/libsodium/examples/utils.h +0 -110
@@ -1,5 +1,5 @@
1
1
  AC_PREREQ([2.65])
2
- AC_INIT([libsodium],[1.0.10],
2
+ AC_INIT([libsodium],[1.0.11],
3
3
  [https://github.com/jedisct1/libsodium/issues],
4
4
  [libsodium],
5
5
  [https://github.com/jedisct1/libsodium])
@@ -17,9 +17,9 @@ ISODATE=`date +%Y-%m-%d`
17
17
  AC_SUBST(ISODATE)
18
18
 
19
19
  SODIUM_LIBRARY_VERSION_MAJOR=9
20
- SODIUM_LIBRARY_VERSION_MINOR=2
20
+ SODIUM_LIBRARY_VERSION_MINOR=3
21
21
  DLL_VERSION=8
22
- SODIUM_LIBRARY_VERSION=19:0:1
22
+ SODIUM_LIBRARY_VERSION=19:1:1
23
23
  # | | |
24
24
  # +------+ | +---+
25
25
  # | | |
@@ -40,8 +40,8 @@ LX_CFLAGS=${CFLAGS-NONE}
40
40
 
41
41
  dnl Path check
42
42
 
43
- AS_IF([test pwd | fgrep ' ' > /dev/null 2>&1],
44
- [AC_MSG_WARN([The build directory contains whitespaces - This can cause tests/installation to fail due to limitations of some libtool versions])]
43
+ AS_IF([pwd | fgrep ' ' > /dev/null 2>&1],
44
+ [AC_MSG_ERROR([The build directory contains whitespaces - This can cause tests/installation to fail due to limitations of some libtool versions])]
45
45
  )
46
46
 
47
47
  dnl Switches
@@ -72,9 +72,13 @@ AC_ARG_ENABLE(asm,
72
72
  enable_asm="yes"
73
73
  ])
74
74
 
75
- AS_IF([test "x$EMSCRIPTEN" != "x"],[
75
+ AS_IF([test "x$EMSCRIPTEN" != "x"], [
76
+ enable_asm="no"
77
+ AC_MSG_WARN([compiling to JavaScript - asm implementations disabled])
78
+ ])
79
+ AS_IF([test "$host_os" = "nacl" -o "$host_os" = "pnacl"], [
76
80
  enable_asm="no"
77
- AC_MSG_WARN([compiling to javascript - asm implementations disabled])
81
+ AC_MSG_WARN([compiling to Native Client - asm implementations disabled])
78
82
  ])
79
83
 
80
84
  AC_ARG_ENABLE(pie,
@@ -106,6 +110,18 @@ AC_ARG_ENABLE(minimal,
106
110
  ])
107
111
  AM_CONDITIONAL([MINIMAL], [test x$enable_minimal = xyes])
108
112
 
113
+ AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads],
114
+ [use pthreads library, or --without-pthreads to disable threading support.]),
115
+ [ ], [withval="yes"])
116
+
117
+ AS_IF([test "x$withval" = "xyes"], [
118
+ AX_PTHREAD([
119
+ AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
120
+ LIBS="$PTHREAD_LIBS $LIBS"
121
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
122
+ CC="$PTHREAD_CC"])
123
+ ])
124
+
109
125
  AC_ARG_WITH(safecode,
110
126
  [AS_HELP_STRING(--with-safecode,For maintainers only - please do not use)],
111
127
  [AS_IF([test "x$withval" = "xyes"], [
@@ -285,7 +301,7 @@ AC_CHECK_TOOL([AR], [ar], [ar])
285
301
 
286
302
  dnl Checks for headers
287
303
 
288
- AS_IF([test "x$EMSCRIPTEN" = "x"],[
304
+ AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [
289
305
 
290
306
  AC_MSG_CHECKING(for MMX instructions set)
291
307
  oldcflags="$CFLAGS"
@@ -361,6 +377,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[
361
377
  AX_CHECK_COMPILE_FLAG([-mavx], [CFLAGS="$CFLAGS -mavx"])
362
378
  AC_MSG_CHECKING(for AVX instructions set)
363
379
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
380
+ #ifdef __native_client__
381
+ # error NativeClient detected - Avoiding AVX opcodes
382
+ #endif
364
383
  #pragma GCC target("avx")
365
384
  #include <immintrin.h>
366
385
  ]], [[ _mm256_zeroall(); ]])],
@@ -374,6 +393,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[
374
393
  AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS="$CFLAGS -mavx2"])
375
394
  AC_MSG_CHECKING(for AVX2 instructions set)
376
395
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
396
+ #ifdef __native_client__
397
+ # error NativeClient detected - Avoiding AVX2 opcodes
398
+ #endif
377
399
  #pragma GCC target("avx2")
378
400
  #include <immintrin.h>
379
401
  ]], [[ __m256i x = _mm256_abs_epi8(_mm256_setzero_si256()); ]])],
@@ -382,6 +404,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[
382
404
  AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS_AVX="-mavx2"])
383
405
  AC_MSG_CHECKING(if _mm256_broadcastsi128_si256 is correctly defined)
384
406
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
407
+ #ifdef __native_client__
408
+ # error NativeClient detected - Avoiding AVX2 opcodes
409
+ #endif
385
410
  #pragma GCC target("avx2")
386
411
  #include <immintrin.h>
387
412
  ]], [[ __m256i y = _mm256_broadcastsi128_si256(_mm_setzero_si128()); ]])],
@@ -398,6 +423,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[
398
423
  AX_CHECK_COMPILE_FLAG([-mpclmul], [CFLAGS="$CFLAGS -mpclmul"])
399
424
  AC_MSG_CHECKING(for AESNI instructions set and PCLMULQDQ)
400
425
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
426
+ #ifdef __native_client__
427
+ # error NativeClient detected - Avoiding AESNI opcodes
428
+ #endif
401
429
  #pragma GCC target("aes")
402
430
  #pragma GCC target("pclmul")
403
431
  #include <wmmintrin.h>
@@ -541,7 +569,7 @@ AM_CONDITIONAL([HAVE_TI_MODE], [test $HAVE_TI_MODE_V = 1])
541
569
  AC_SUBST(HAVE_TI_MODE_V)
542
570
 
543
571
  HAVE_CPUID_V=0
544
- AS_IF([test "$enable_asm" != "no"],[
572
+ AS_IF([test "$enable_asm" != "no" -o "$host_alias" = "x86_64-nacl"],[
545
573
  AC_MSG_CHECKING(for cpuid instruction)
546
574
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
547
575
  unsigned int cpu_info[4];
@@ -558,7 +586,7 @@ __asm__ __volatile__ ("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1" :
558
586
  AC_SUBST(HAVE_CPUID_V)
559
587
 
560
588
  asm_hide_symbol="unsupported"
561
- AS_IF([test "$enable_asm" != "no"],[
589
+ AS_IF([test "$enable_asm" != "no" -o "$host_os" = "nacl"],[
562
590
  AC_MSG_CHECKING(if the .private_extern asm directive is supported)
563
591
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
564
592
  __asm__ __volatile__ (".private_extern dummy_symbol \n"
@@ -600,6 +628,9 @@ __asm__ __volatile__ (".hidden dummy_symbol \n"
600
628
 
601
629
  AC_MSG_CHECKING(if weak symbols are supported)
602
630
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
631
+ #if !defined(__ELF__) && !defined(__APPLE_CC__)
632
+ # error Support for weak symbols may not be available
633
+ #endif
603
634
  __attribute__((weak)) void __dummy(void *x) { }
604
635
  void f(void *x) { __dummy(x); }
605
636
  ]], [[ ]]
@@ -629,7 +660,7 @@ dnl Checks for functions and headers
629
660
 
630
661
  AS_IF([test "x$EMSCRIPTEN" = "x"],[
631
662
  AC_CHECK_FUNCS([arc4random arc4random_buf])
632
- AC_CHECK_FUNCS([mmap mlock madvise mprotect explicit_bzero])
663
+ AC_CHECK_FUNCS([mmap mlock madvise mprotect explicit_bzero nanosleep])
633
664
  ])
634
665
  AC_CHECK_FUNCS([posix_memalign getpid])
635
666
 
@@ -645,6 +676,8 @@ AM_CONDITIONAL([EMSCRIPTEN], [test "x$EMSCRIPTEN" != "x"])
645
676
 
646
677
  AM_CONDITIONAL([NATIVECLIENT], [test "x$NATIVECLIENT" != "x"])
647
678
 
679
+ AC_DEFINE([CONFIGURED], [1], [the build system was properly configured])
680
+
648
681
  dnl Libtool.
649
682
 
650
683
  LT_INIT([dlopen])
@@ -7,9 +7,11 @@ EXTRA_DIST = \
7
7
  android-mips32.sh \
8
8
  android-mips64.sh \
9
9
  android-x86.sh \
10
- android-x86-64.sh \
10
+ android-x86_64.sh \
11
11
  emscripten.sh \
12
12
  ios.sh \
13
13
  msys2-win32.sh \
14
14
  msys2-win64.sh \
15
- nativeclient.sh
15
+ nativeclient-pnacl.sh \
16
+ nativeclient-x86.sh \
17
+ nativeclient-x86_64.sh
@@ -92,6 +92,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92
92
  am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
93
93
  $(top_srcdir)/m4/ax_check_define.m4 \
94
94
  $(top_srcdir)/m4/ax_check_link_flag.m4 \
95
+ $(top_srcdir)/m4/ax_pthread.m4 \
95
96
  $(top_srcdir)/m4/ax_valgrind_check.m4 \
96
97
  $(top_srcdir)/m4/ld-output-def.m4 $(top_srcdir)/m4/libtool.m4 \
97
98
  $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -205,6 +206,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
205
206
  PACKAGE_URL = @PACKAGE_URL@
206
207
  PACKAGE_VERSION = @PACKAGE_VERSION@
207
208
  PATH_SEPARATOR = @PATH_SEPARATOR@
209
+ PTHREAD_CC = @PTHREAD_CC@
210
+ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
211
+ PTHREAD_LIBS = @PTHREAD_LIBS@
208
212
  RANLIB = @RANLIB@
209
213
  SAFECODE_HOME = @SAFECODE_HOME@
210
214
  SED = @SED@
@@ -234,6 +238,7 @@ am__leading_dot = @am__leading_dot@
234
238
  am__quote = @am__quote@
235
239
  am__tar = @am__tar@
236
240
  am__untar = @am__untar@
241
+ ax_pthread_config = @ax_pthread_config@
237
242
  bindir = @bindir@
238
243
  build = @build@
239
244
  build_alias = @build_alias@
@@ -282,12 +287,14 @@ EXTRA_DIST = \
282
287
  android-mips32.sh \
283
288
  android-mips64.sh \
284
289
  android-x86.sh \
285
- android-x86-64.sh \
290
+ android-x86_64.sh \
286
291
  emscripten.sh \
287
292
  ios.sh \
288
293
  msys2-win32.sh \
289
294
  msys2-win64.sh \
290
- nativeclient.sh
295
+ nativeclient-pnacl.sh \
296
+ nativeclient-x86.sh \
297
+ nativeclient-x86_64.sh
291
298
 
292
299
  all: all-am
293
300
 
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  export TARGET_ARCH=armv8-a
3
3
  export CFLAGS="-Os -march=${TARGET_ARCH}"
4
- ARCH=arm64 HOST_COMPILER=aarch64-linux-android "$(dirname "$0")/android-build.sh"
4
+ NDK_PLATFORM_COMPAT=android-21 ARCH=arm64 HOST_COMPILER=aarch64-linux-android "$(dirname "$0")/android-build.sh"
@@ -1,5 +1,12 @@
1
1
  #! /bin/sh
2
2
 
3
+ if [ -z "$NDK_PLATFORM" ]; then
4
+ export NDK_PLATFORM="android-24"
5
+ export NDK_PLATFORM_COMPAT="${NDK_PLATFORM_COMPAT:-android-16}"
6
+ else
7
+ export NDK_PLATFORM_COMPAT="${NDK_PLATFORM_COMPAT:-${NDK_PLATFORM}}"
8
+ fi
9
+
3
10
  if [ -z "$ANDROID_NDK_HOME" ]; then
4
11
  echo "You should probably set ANDROID_NDK_HOME to the directory containing"
5
12
  echo "the Android NDK"
@@ -24,14 +31,44 @@ export PATH="${PATH}:${TOOLCHAIN_DIR}/bin"
24
31
 
25
32
  rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}"
26
33
 
27
- bash $MAKE_TOOLCHAIN --platform="${NDK_PLATFORM:-android-16}" \
28
- --arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" && \
34
+ echo
35
+ echo "Building for platform [${NDK_PLATFORM}], retaining compatibility with platform [${NDK_PLATFORM_COMPAT}]"
36
+ echo
37
+
38
+ bash $MAKE_TOOLCHAIN --platform="$NDK_PLATFORM_COMPAT" \
39
+ --arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" || exit 1
40
+
29
41
  ./configure \
30
42
  --disable-soname-versions \
31
43
  --enable-minimal \
32
44
  --host="${HOST_COMPILER}" \
33
45
  --prefix="${PREFIX}" \
34
- --with-sysroot="${TOOLCHAIN_DIR}/sysroot" && \
46
+ --with-sysroot="${TOOLCHAIN_DIR}/sysroot" || exit 1
47
+
48
+ if [ "$NDK_PLATFORM" != "$NDK_PLATFORM_COMPAT" ]; then
49
+ egrep '^#define ' config.log | sort -u > config-def-compat.log
50
+ echo
51
+ echo "Configuring again for platform [${NDK_PLATFORM}]"
52
+ echo
53
+ bash $MAKE_TOOLCHAIN --platform="$NDK_PLATFORM" \
54
+ --arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" || exit 1
55
+
56
+ ./configure \
57
+ --disable-soname-versions \
58
+ --enable-minimal \
59
+ --host="${HOST_COMPILER}" \
60
+ --prefix="${PREFIX}" \
61
+ --with-sysroot="${TOOLCHAIN_DIR}/sysroot" || exit 1
62
+
63
+ egrep '^#define ' config.log | sort -u > config-def.log
64
+ if ! cmp config-def.log config-def-compat.log; then
65
+ echo "Platform [${NDK_PLATFORM}] is not backwards-compatible with [${NDK_PLATFORM_COMPAT}]" >&2
66
+ diff -u config-def.log config-def-compat.log >&2
67
+ exit 1
68
+ fi
69
+ rm -f config-def.log config-def-compat.log
70
+ fi
71
+
35
72
  make clean && \
36
73
  make -j3 install && \
37
74
  echo "libsodium has been installed into ${PREFIX}"
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  export TARGET_ARCH=mips64r6
3
3
  export CFLAGS="-Os -march=${TARGET_ARCH}"
4
- ARCH=mips64 HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh"
4
+ NDK_PLATFORM_COMPAT=android-21 ARCH=mips64 HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ export TARGET_ARCH=westmere
3
+ export CFLAGS="-Os -march=${TARGET_ARCH}"
4
+ NDK_PLATFORM_COMPAT=android-21 ARCH=x86_64 HOST_COMPILER=x86_64-linux-android "$(dirname "$0")/android-build.sh"
@@ -183,9 +183,9 @@ _crypto_onetimeauth_primitive 0 1
183
183
  _crypto_onetimeauth_statebytes 0 1
184
184
  _crypto_onetimeauth_update 0 1
185
185
  _crypto_onetimeauth_verify 0 1
186
- _crypto_pwhash 1 1
187
- _crypto_pwhash_alg_argon2i13 1 1
188
- _crypto_pwhash_alg_default 1 1
186
+ _crypto_pwhash 0 1
187
+ _crypto_pwhash_alg_argon2i13 0 1
188
+ _crypto_pwhash_alg_default 0 1
189
189
  _crypto_pwhash_argon2i 0 1
190
190
  _crypto_pwhash_argon2i_alg_argon2i13 0 1
191
191
  _crypto_pwhash_argon2i_memlimit_interactive 0 1
@@ -199,29 +199,29 @@ _crypto_pwhash_argon2i_str 0 1
199
199
  _crypto_pwhash_argon2i_str_verify 0 1
200
200
  _crypto_pwhash_argon2i_strbytes 0 1
201
201
  _crypto_pwhash_argon2i_strprefix 0 1
202
- _crypto_pwhash_memlimit_interactive 1 1
203
- _crypto_pwhash_memlimit_moderate 1 1
204
- _crypto_pwhash_memlimit_sensitive 1 1
205
- _crypto_pwhash_opslimit_interactive 1 1
206
- _crypto_pwhash_opslimit_moderate 1 1
207
- _crypto_pwhash_opslimit_sensitive 1 1
202
+ _crypto_pwhash_memlimit_interactive 0 1
203
+ _crypto_pwhash_memlimit_moderate 0 1
204
+ _crypto_pwhash_memlimit_sensitive 0 1
205
+ _crypto_pwhash_opslimit_interactive 0 1
206
+ _crypto_pwhash_opslimit_moderate 0 1
207
+ _crypto_pwhash_opslimit_sensitive 0 1
208
208
  _crypto_pwhash_primitive 0 1
209
- _crypto_pwhash_saltbytes 1 1
210
- _crypto_pwhash_scryptsalsa208sha256 1 1
211
- _crypto_pwhash_scryptsalsa208sha256_ll 1 1
212
- _crypto_pwhash_scryptsalsa208sha256_memlimit_interactive 1 1
213
- _crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive 1 1
214
- _crypto_pwhash_scryptsalsa208sha256_opslimit_interactive 1 1
215
- _crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive 1 1
216
- _crypto_pwhash_scryptsalsa208sha256_saltbytes 1 1
217
- _crypto_pwhash_scryptsalsa208sha256_str 1 1
218
- _crypto_pwhash_scryptsalsa208sha256_str_verify 1 1
219
- _crypto_pwhash_scryptsalsa208sha256_strbytes 1 1
220
- _crypto_pwhash_scryptsalsa208sha256_strprefix 1 1
221
- _crypto_pwhash_str 1 1
222
- _crypto_pwhash_str_verify 1 1
223
- _crypto_pwhash_strbytes 1 1
224
- _crypto_pwhash_strprefix 1 1
209
+ _crypto_pwhash_saltbytes 0 1
210
+ _crypto_pwhash_scryptsalsa208sha256 0 1
211
+ _crypto_pwhash_scryptsalsa208sha256_ll 0 1
212
+ _crypto_pwhash_scryptsalsa208sha256_memlimit_interactive 0 1
213
+ _crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive 0 1
214
+ _crypto_pwhash_scryptsalsa208sha256_opslimit_interactive 0 1
215
+ _crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive 0 1
216
+ _crypto_pwhash_scryptsalsa208sha256_saltbytes 0 1
217
+ _crypto_pwhash_scryptsalsa208sha256_str 0 1
218
+ _crypto_pwhash_scryptsalsa208sha256_str_verify 0 1
219
+ _crypto_pwhash_scryptsalsa208sha256_strbytes 0 1
220
+ _crypto_pwhash_scryptsalsa208sha256_strprefix 0 1
221
+ _crypto_pwhash_str 0 1
222
+ _crypto_pwhash_str_verify 0 1
223
+ _crypto_pwhash_strbytes 0 1
224
+ _crypto_pwhash_strprefix 0 1
225
225
  _crypto_scalarmult 1 1
226
226
  _crypto_scalarmult_base 1 1
227
227
  _crypto_scalarmult_bytes 1 1
@@ -1,35 +1,72 @@
1
1
  #! /bin/sh
2
2
 
3
3
  export MAKE_FLAGS='-j4'
4
- export PREFIX="$(pwd)/libsodium-js"
5
- export EXPORTED_FUNCTIONS_STANDARD='["_crypto_aead_chacha20poly1305_abytes","_crypto_aead_chacha20poly1305_decrypt","_crypto_aead_chacha20poly1305_decrypt_detached","_crypto_aead_chacha20poly1305_encrypt","_crypto_aead_chacha20poly1305_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_abytes","_crypto_aead_chacha20poly1305_ietf_decrypt","_crypto_aead_chacha20poly1305_ietf_decrypt_detached","_crypto_aead_chacha20poly1305_ietf_encrypt","_crypto_aead_chacha20poly1305_ietf_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_keybytes","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_keybytes","_crypto_auth_verify","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_detached","_crypto_box_detached_afternm","_crypto_box_easy","_crypto_box_easy_afternm","_crypto_box_keypair","_crypto_box_macbytes","_crypto_box_noncebytes","_crypto_box_open_detached","_crypto_box_open_detached_afternm","_crypto_box_open_easy","_crypto_box_open_easy_afternm","_crypto_box_publickeybytes","_crypto_box_seal","_crypto_box_seal_open","_crypto_box_sealbytes","_crypto_box_secretkeybytes","_crypto_box_seed_keypair","_crypto_box_seedbytes","_crypto_generichash","_crypto_generichash_bytes","_crypto_generichash_bytes_max","_crypto_generichash_bytes_min","_crypto_generichash_final","_crypto_generichash_init","_crypto_generichash_keybytes","_crypto_generichash_keybytes_max","_crypto_generichash_keybytes_min","_crypto_generichash_primitive","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_pwhash","_crypto_pwhash_alg_argon2i13","_crypto_pwhash_alg_default","_crypto_pwhash_memlimit_interactive","_crypto_pwhash_memlimit_moderate","_crypto_pwhash_memlimit_sensitive","_crypto_pwhash_opslimit_interactive","_crypto_pwhash_opslimit_moderate","_crypto_pwhash_opslimit_sensitive","_crypto_pwhash_saltbytes","_crypto_pwhash_scryptsalsa208sha256","_crypto_pwhash_scryptsalsa208sha256_ll","_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive","_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive","_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_saltbytes","_crypto_pwhash_scryptsalsa208sha256_str","_crypto_pwhash_scryptsalsa208sha256_str_verify","_crypto_pwhash_scryptsalsa208sha256_strbytes","_crypto_pwhash_scryptsalsa208sha256_strprefix","_crypto_pwhash_str","_crypto_pwhash_str_verify","_crypto_pwhash_strbytes","_crypto_pwhash_strprefix","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_scalarbytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_macbytes","_crypto_secretbox_noncebytes","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_keypair","_crypto_sign_open","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_verify_detached","_randombytes","_randombytes_buf","_randombytes_close","_randombytes_random","_randombytes_stir","_randombytes_uniform","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_version_major","_sodium_library_version_minor","_sodium_version_string"]'
4
+ export EXPORTED_FUNCTIONS_STANDARD='["_crypto_aead_chacha20poly1305_abytes","_crypto_aead_chacha20poly1305_decrypt","_crypto_aead_chacha20poly1305_decrypt_detached","_crypto_aead_chacha20poly1305_encrypt","_crypto_aead_chacha20poly1305_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_abytes","_crypto_aead_chacha20poly1305_ietf_decrypt","_crypto_aead_chacha20poly1305_ietf_decrypt_detached","_crypto_aead_chacha20poly1305_ietf_encrypt","_crypto_aead_chacha20poly1305_ietf_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_keybytes","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_keybytes","_crypto_auth_verify","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_detached","_crypto_box_detached_afternm","_crypto_box_easy","_crypto_box_easy_afternm","_crypto_box_keypair","_crypto_box_macbytes","_crypto_box_noncebytes","_crypto_box_open_detached","_crypto_box_open_detached_afternm","_crypto_box_open_easy","_crypto_box_open_easy_afternm","_crypto_box_publickeybytes","_crypto_box_seal","_crypto_box_seal_open","_crypto_box_sealbytes","_crypto_box_secretkeybytes","_crypto_box_seed_keypair","_crypto_box_seedbytes","_crypto_generichash","_crypto_generichash_bytes","_crypto_generichash_bytes_max","_crypto_generichash_bytes_min","_crypto_generichash_final","_crypto_generichash_init","_crypto_generichash_keybytes","_crypto_generichash_keybytes_max","_crypto_generichash_keybytes_min","_crypto_generichash_primitive","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_scalarbytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_macbytes","_crypto_secretbox_noncebytes","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_keypair","_crypto_sign_open","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_verify_detached","_randombytes","_randombytes_buf","_randombytes_close","_randombytes_random","_randombytes_stir","_randombytes_uniform","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_version_major","_sodium_library_version_minor","_sodium_version_string"]'
6
5
  export EXPORTED_FUNCTIONS_SUMO='["_crypto_aead_chacha20poly1305_abytes","_crypto_aead_chacha20poly1305_decrypt","_crypto_aead_chacha20poly1305_decrypt_detached","_crypto_aead_chacha20poly1305_encrypt","_crypto_aead_chacha20poly1305_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_abytes","_crypto_aead_chacha20poly1305_ietf_decrypt","_crypto_aead_chacha20poly1305_ietf_decrypt_detached","_crypto_aead_chacha20poly1305_ietf_encrypt","_crypto_aead_chacha20poly1305_ietf_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_keybytes","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_hmacsha256","_crypto_auth_hmacsha256_bytes","_crypto_auth_hmacsha256_final","_crypto_auth_hmacsha256_init","_crypto_auth_hmacsha256_keybytes","_crypto_auth_hmacsha256_statebytes","_crypto_auth_hmacsha256_update","_crypto_auth_hmacsha256_verify","_crypto_auth_hmacsha512","_crypto_auth_hmacsha512256","_crypto_auth_hmacsha512256_bytes","_crypto_auth_hmacsha512256_final","_crypto_auth_hmacsha512256_init","_crypto_auth_hmacsha512256_keybytes","_crypto_auth_hmacsha512256_statebytes","_crypto_auth_hmacsha512256_update","_crypto_auth_hmacsha512256_verify","_crypto_auth_hmacsha512_bytes","_crypto_auth_hmacsha512_final","_crypto_auth_hmacsha512_init","_crypto_auth_hmacsha512_keybytes","_crypto_auth_hmacsha512_statebytes","_crypto_auth_hmacsha512_update","_crypto_auth_hmacsha512_verify","_crypto_auth_keybytes","_crypto_auth_verify","_crypto_box","_crypto_box_afternm","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_boxzerobytes","_crypto_box_curve25519xsalsa20poly1305","_crypto_box_curve25519xsalsa20poly1305_afternm","_crypto_box_curve25519xsalsa20poly1305_beforenm","_crypto_box_curve25519xsalsa20poly1305_beforenmbytes","_crypto_box_curve25519xsalsa20poly1305_boxzerobytes","_crypto_box_curve25519xsalsa20poly1305_keypair","_crypto_box_curve25519xsalsa20poly1305_macbytes","_crypto_box_curve25519xsalsa20poly1305_noncebytes","_crypto_box_curve25519xsalsa20poly1305_open","_crypto_box_curve25519xsalsa20poly1305_open_afternm","_crypto_box_curve25519xsalsa20poly1305_publickeybytes","_crypto_box_curve25519xsalsa20poly1305_secretkeybytes","_crypto_box_curve25519xsalsa20poly1305_seed_keypair","_crypto_box_curve25519xsalsa20poly1305_seedbytes","_crypto_box_curve25519xsalsa20poly1305_zerobytes","_crypto_box_detached","_crypto_box_detached_afternm","_crypto_box_easy","_crypto_box_easy_afternm","_crypto_box_keypair","_crypto_box_macbytes","_crypto_box_noncebytes","_crypto_box_open","_crypto_box_open_afternm","_crypto_box_open_detached","_crypto_box_open_detached_afternm","_crypto_box_open_easy","_crypto_box_open_easy_afternm","_crypto_box_primitive","_crypto_box_publickeybytes","_crypto_box_seal","_crypto_box_seal_open","_crypto_box_sealbytes","_crypto_box_secretkeybytes","_crypto_box_seed_keypair","_crypto_box_seedbytes","_crypto_box_zerobytes","_crypto_core_hsalsa20","_crypto_core_hsalsa20_constbytes","_crypto_core_hsalsa20_inputbytes","_crypto_core_hsalsa20_keybytes","_crypto_core_hsalsa20_outputbytes","_crypto_core_salsa20","_crypto_core_salsa20_constbytes","_crypto_core_salsa20_inputbytes","_crypto_core_salsa20_keybytes","_crypto_core_salsa20_outputbytes","_crypto_generichash","_crypto_generichash_blake2b","_crypto_generichash_blake2b_bytes","_crypto_generichash_blake2b_bytes_max","_crypto_generichash_blake2b_bytes_min","_crypto_generichash_blake2b_final","_crypto_generichash_blake2b_init","_crypto_generichash_blake2b_init_salt_personal","_crypto_generichash_blake2b_keybytes","_crypto_generichash_blake2b_keybytes_max","_crypto_generichash_blake2b_keybytes_min","_crypto_generichash_blake2b_personalbytes","_crypto_generichash_blake2b_salt_personal","_crypto_generichash_blake2b_saltbytes","_crypto_generichash_blake2b_statebytes","_crypto_generichash_blake2b_update","_crypto_generichash_bytes","_crypto_generichash_bytes_max","_crypto_generichash_bytes_min","_crypto_generichash_final","_crypto_generichash_init","_crypto_generichash_keybytes","_crypto_generichash_keybytes_max","_crypto_generichash_keybytes_min","_crypto_generichash_primitive","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_hash_primitive","_crypto_hash_sha256","_crypto_hash_sha256_bytes","_crypto_hash_sha256_final","_crypto_hash_sha256_init","_crypto_hash_sha256_statebytes","_crypto_hash_sha256_update","_crypto_hash_sha512","_crypto_hash_sha512_bytes","_crypto_hash_sha512_final","_crypto_hash_sha512_init","_crypto_hash_sha512_statebytes","_crypto_hash_sha512_update","_crypto_onetimeauth","_crypto_onetimeauth_bytes","_crypto_onetimeauth_final","_crypto_onetimeauth_init","_crypto_onetimeauth_keybytes","_crypto_onetimeauth_poly1305","_crypto_onetimeauth_poly1305_bytes","_crypto_onetimeauth_poly1305_final","_crypto_onetimeauth_poly1305_init","_crypto_onetimeauth_poly1305_keybytes","_crypto_onetimeauth_poly1305_update","_crypto_onetimeauth_poly1305_verify","_crypto_onetimeauth_primitive","_crypto_onetimeauth_statebytes","_crypto_onetimeauth_update","_crypto_onetimeauth_verify","_crypto_pwhash","_crypto_pwhash_alg_argon2i13","_crypto_pwhash_alg_default","_crypto_pwhash_argon2i","_crypto_pwhash_argon2i_alg_argon2i13","_crypto_pwhash_argon2i_memlimit_interactive","_crypto_pwhash_argon2i_memlimit_moderate","_crypto_pwhash_argon2i_memlimit_sensitive","_crypto_pwhash_argon2i_opslimit_interactive","_crypto_pwhash_argon2i_opslimit_moderate","_crypto_pwhash_argon2i_opslimit_sensitive","_crypto_pwhash_argon2i_saltbytes","_crypto_pwhash_argon2i_str","_crypto_pwhash_argon2i_str_verify","_crypto_pwhash_argon2i_strbytes","_crypto_pwhash_argon2i_strprefix","_crypto_pwhash_memlimit_interactive","_crypto_pwhash_memlimit_moderate","_crypto_pwhash_memlimit_sensitive","_crypto_pwhash_opslimit_interactive","_crypto_pwhash_opslimit_moderate","_crypto_pwhash_opslimit_sensitive","_crypto_pwhash_primitive","_crypto_pwhash_saltbytes","_crypto_pwhash_scryptsalsa208sha256","_crypto_pwhash_scryptsalsa208sha256_ll","_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive","_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive","_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_saltbytes","_crypto_pwhash_scryptsalsa208sha256_str","_crypto_pwhash_scryptsalsa208sha256_str_verify","_crypto_pwhash_scryptsalsa208sha256_strbytes","_crypto_pwhash_scryptsalsa208sha256_strprefix","_crypto_pwhash_str","_crypto_pwhash_str_verify","_crypto_pwhash_strbytes","_crypto_pwhash_strprefix","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_curve25519","_crypto_scalarmult_curve25519_base","_crypto_scalarmult_curve25519_bytes","_crypto_scalarmult_curve25519_scalarbytes","_crypto_scalarmult_primitive","_crypto_scalarmult_scalarbytes","_crypto_secretbox","_crypto_secretbox_boxzerobytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_macbytes","_crypto_secretbox_noncebytes","_crypto_secretbox_open","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_secretbox_primitive","_crypto_secretbox_xsalsa20poly1305","_crypto_secretbox_xsalsa20poly1305_boxzerobytes","_crypto_secretbox_xsalsa20poly1305_keybytes","_crypto_secretbox_xsalsa20poly1305_macbytes","_crypto_secretbox_xsalsa20poly1305_noncebytes","_crypto_secretbox_xsalsa20poly1305_open","_crypto_secretbox_xsalsa20poly1305_zerobytes","_crypto_secretbox_zerobytes","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_shorthash_primitive","_crypto_shorthash_siphash24","_crypto_shorthash_siphash24_bytes","_crypto_shorthash_siphash24_keybytes","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519","_crypto_sign_ed25519_bytes","_crypto_sign_ed25519_detached","_crypto_sign_ed25519_keypair","_crypto_sign_ed25519_open","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_publickeybytes","_crypto_sign_ed25519_secretkeybytes","_crypto_sign_ed25519_seed_keypair","_crypto_sign_ed25519_seedbytes","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_ed25519_sk_to_pk","_crypto_sign_ed25519_sk_to_seed","_crypto_sign_ed25519_verify_detached","_crypto_sign_keypair","_crypto_sign_open","_crypto_sign_primitive","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_verify_detached","_crypto_stream","_crypto_stream_chacha20","_crypto_stream_chacha20_ietf","_crypto_stream_chacha20_ietf_noncebytes","_crypto_stream_chacha20_ietf_xor","_crypto_stream_chacha20_ietf_xor_ic","_crypto_stream_chacha20_keybytes","_crypto_stream_chacha20_noncebytes","_crypto_stream_chacha20_xor","_crypto_stream_chacha20_xor_ic","_crypto_stream_keybytes","_crypto_stream_noncebytes","_crypto_stream_primitive","_crypto_stream_salsa20","_crypto_stream_salsa20_keybytes","_crypto_stream_salsa20_noncebytes","_crypto_stream_salsa20_xor","_crypto_stream_salsa20_xor_ic","_crypto_stream_xor","_crypto_stream_xsalsa20","_crypto_stream_xsalsa20_keybytes","_crypto_stream_xsalsa20_noncebytes","_crypto_stream_xsalsa20_xor","_crypto_stream_xsalsa20_xor_ic","_crypto_verify_16","_crypto_verify_16_bytes","_crypto_verify_32","_crypto_verify_32_bytes","_crypto_verify_64","_crypto_verify_64_bytes","_randombytes","_randombytes_buf","_randombytes_close","_randombytes_implementation_name","_randombytes_random","_randombytes_stir","_randombytes_uniform","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_version_major","_sodium_library_version_minor","_sodium_version_string"]'
7
- export TOTAL_MEMORY=50000000
8
- export LDFLAGS="-s TOTAL_MEMORY=${TOTAL_MEMORY} -s RESERVED_FUNCTION_POINTERS=8 -s NO_DYNAMIC_EXECUTION=1 -s RUNNING_JS_OPTS=1"
6
+ export TOTAL_MEMORY=131072
7
+ export TOTAL_MEMORY_SUMO=35000000
8
+ export LDFLAGS="-s RESERVED_FUNCTION_POINTERS=8"
9
+ export LDFLAGS="${LDFLAGS} -s NO_DYNAMIC_EXECUTION=1 -s RUNNING_JS_OPTS=1 -s ASSERTIONS=0"
10
+ export LDFLAGS="${LDFLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s ALIASING_FUNCTION_POINTERS=1"
11
+ export LDFLAGS="${LDFLAGS} -s FUNCTION_POINTER_ALIGNMENT=1 -s DISABLE_EXCEPTION_CATCHING=1"
12
+ export LDFLAGS="${LDFLAGS} -s ELIMINATE_DUPLICATE_FUNCTIONS=1"
13
+ export LDFLAGS_DIST="-s NO_FILESYSTEM=1"
14
+ export CFLAGS="-Os"
9
15
 
10
- export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_STANDARD"
11
- if [ "x$1" = "x--sumo" ]; then
16
+ echo
17
+ if [ "x$1" = "x--standard" ]; then
18
+ echo "Building a standard distribution in ${PREFIX}"
19
+ export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_STANDARD"
20
+ export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${TOTAL_MEMORY}"
21
+ export PREFIX="$(pwd)/libsodium-js"
22
+ export DONE_FILE="$(pwd)/js.done"
23
+ export DIST='yes'
24
+ elif [ "x$1" = "x--sumo" ]; then
25
+ echo "Building a sumo distribution in ${PREFIX}"
12
26
  export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
13
- fi
14
- export JS_EXPORTS_FLAGS="-s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS}"
15
-
16
- if [ "x$1" = "x--browser-tests" ]; then
27
+ export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
28
+ export PREFIX="$(pwd)/libsodium-js-sumo"
29
+ export DONE_FILE="$(pwd)/js-sumo.done"
30
+ export DIST='yes'
31
+ elif [ "x$1" = "x--browser-tests" ]; then
32
+ echo "Building tests for web browsers"
33
+ export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
34
+ export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
35
+ export PREFIX="$(pwd)/libsodium-js-tests"
36
+ export DONE_FILE="$(pwd)/js-tests-browser.done"
17
37
  export BROWSER_TESTS='yes'
18
- fi
19
-
20
- if [ "x$BROWSER_TESTS" != "x" ]; then
21
- echo "Tests will be built to be run in a web browser"
22
- rm -f test/browser-js.done
38
+ export DIST='no'
39
+ elif [ "x$1" = "x--tests" ]; then
40
+ echo "Building for testing"
41
+ export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
42
+ export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
43
+ export PREFIX="$(pwd)/libsodium-js-tests"
44
+ export DONE_FILE="$(pwd)/js-tests.done"
45
+ export DIST='no'
23
46
  else
24
- rm -f test/js.done
47
+ echo "Usage: $0 <build_type>"
48
+ echo "<build_type> := --standard | --sumo | --browser-tests | --tests"
49
+ echo
50
+ exit 1
25
51
  fi
52
+ export JS_EXPORTS_FLAGS="-s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS}"
53
+
54
+ rm -f "$DONE_FILE"
26
55
 
56
+ echo
27
57
  emconfigure ./configure --enable-minimal --disable-shared --prefix="$PREFIX" \
28
- CFLAGS="-O3" && \
29
- emmake make clean && \
30
- emmake make $MAKE_FLAGS install V=1 && \
31
- emcc -O3 --llvm-lto 1 --memory-init-file 0 $CPPFLAGS $LDFLAGS $JS_EXPORTS_FLAGS \
32
- "${PREFIX}/lib/libsodium.a" -o "${PREFIX}/lib/libsodium.js" || exit 1
58
+ --without-pthreads CFLAGS="$CFLAGS" && \
59
+ emmake make clean
60
+ [ $? = 0 ] || exit 1
61
+
62
+ if [ "$DIST" = yes ]; then
63
+ emmake make $MAKE_FLAGS install && \
64
+ emcc "$CFLAGS" --llvm-lto 1 --memory-init-file 0 $CPPFLAGS $LDFLAGS $JS_EXPORTS_FLAGS \
65
+ "${PREFIX}/lib/libsodium.a" -o "${PREFIX}/lib/libsodium.js" || exit 1
66
+ touch -r "${PREFIX}/lib/libsodium.js" "$DONE_FILE"
67
+ ls -l "${PREFIX}/lib/libsodium.js"
68
+ exit 0
69
+ fi
33
70
 
34
71
  if test "x$NODE" = x; then
35
72
  for candidate in node nodejs; do
@@ -41,18 +78,15 @@ if test "x$NODE" = x; then
41
78
  done
42
79
  fi
43
80
 
44
- if test "x$NODE" = x; then
45
- echo 'node.js not found - test suite skipped' >&2
46
- exit 1
47
- fi
48
-
49
- echo "Using [${NODE}] as a Javascript runtime"
50
-
51
81
  if [ "x$BROWSER_TESTS" != "x" ]; then
52
82
  echo 'Compiling the test suite for web browsers...' && \
53
- emmake make $MAKE_FLAGS CPPFLAGS="$CPPFLAGS -DBROWSER_TESTS=1" check \
54
- > /dev/null 2>&1
83
+ emmake make $MAKE_FLAGS CPPFLAGS="$CPPFLAGS -DBROWSER_TESTS=1" check > /dev/null 2>&1
55
84
  else
85
+ if test "x$NODE" = x; then
86
+ echo 'node.js not found - test suite skipped' >&2
87
+ exit 1
88
+ fi
89
+ echo "Using [${NODE}] as a Javascript runtime"
56
90
  echo 'Compiling the test suite...' && \
57
91
  emmake make $MAKE_FLAGS check > /dev/null 2>&1
58
92
  fi
@@ -64,13 +98,13 @@ if [ "x$BROWSER_TESTS" != "x" ]; then
64
98
  mkdir -p browser && \
65
99
  rm -f browser/tests.txt && \
66
100
  for file in *.js; do
67
- fgrep -v "#! /usr/bin/env {NODE}" "$file" > "browser/${file}"
101
+ fgrep -v "#! /usr/bin/env ${NODE}" "$file" > "browser/${file}"
68
102
  tname=$(echo "$file" | sed 's/.js$//')
69
103
  cp -f "${tname}.exp" "browser/${tname}.exp"
70
104
  sed "s/{{tname}}/${tname}/" index.html.tpl > "browser/${tname}.html"
71
105
  echo "${tname}.html" >> "browser/tests.txt"
72
106
  done
73
- touch -r "${PREFIX}/lib/libsodium.js" ../browser-js.done
107
+ touch "$DONE_FILE"
74
108
  )
75
109
  else
76
110
  echo 'Running the test suite'
@@ -78,13 +112,13 @@ else
78
112
  cd test/default && \
79
113
  for file in *.js; do
80
114
  echo "#! /usr/bin/env ${NODE}" > "${file}.tmp"
81
- fgrep -v "#! /usr/bin/env {NODE}" "$file" >> "${file}.tmp"
115
+ fgrep -v "#! /usr/bin/env ${NODE}" "$file" >> "${file}.tmp"
82
116
  chmod +x "${file}.tmp"
83
117
  mv -f "${file}.tmp" "$file"
84
118
  done
85
119
  )
86
- make $MAKE_FLAGS check || exit 1
87
- touch -r "${PREFIX}/lib/libsodium.js" test/js.done
120
+ time make $MAKE_FLAGS check || exit 1
121
+ touch "$DONE_FILE"
88
122
  fi
89
123
 
90
124
  echo 'Done.'