rbnacl-libsodium 1.0.13 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +5 -0
  3. data/lib/rbnacl/libsodium.rb +1 -0
  4. data/lib/rbnacl/libsodium/version.rb +1 -1
  5. data/vendor/libsodium/AUTHORS +2 -2
  6. data/vendor/libsodium/ChangeLog +64 -0
  7. data/vendor/libsodium/Makefile.am +1 -0
  8. data/vendor/libsodium/README.markdown +1 -3
  9. data/vendor/libsodium/THANKS +13 -3
  10. data/vendor/libsodium/builds/Makefile.am +65 -0
  11. data/vendor/libsodium/builds/msvc/resource.rc +2 -2
  12. data/vendor/libsodium/builds/msvc/version.h +3 -3
  13. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +168 -173
  14. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +382 -394
  15. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +168 -173
  16. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +382 -394
  17. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +168 -173
  18. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +382 -394
  19. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +168 -173
  20. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +382 -394
  21. data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj +168 -173
  22. data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +382 -394
  23. data/vendor/libsodium/configure.ac +59 -10
  24. data/vendor/libsodium/contrib/Findsodium.cmake +2 -0
  25. data/vendor/libsodium/dist-build/emscripten-symbols.def +72 -32
  26. data/vendor/libsodium/dist-build/emscripten.sh +33 -6
  27. data/vendor/libsodium/dist-build/generate-emscripten-symbols.sh +52 -38
  28. data/vendor/libsodium/dist-build/ios.sh +2 -2
  29. data/vendor/libsodium/libsodium.vcxproj +168 -173
  30. data/vendor/libsodium/libsodium.vcxproj.filters +220 -235
  31. data/vendor/libsodium/m4/ax_check_catchable_abrt.m4 +57 -0
  32. data/vendor/libsodium/m4/ax_check_gnu_make.m4 +2 -2
  33. data/vendor/libsodium/m4/ax_pthread.m4 +2 -2
  34. data/vendor/libsodium/msvc-scripts/process.bat +3 -3
  35. data/vendor/libsodium/packaging/dotnet-core/README.md +5 -5
  36. data/vendor/libsodium/packaging/dotnet-core/libsodium.props +5 -2
  37. data/vendor/libsodium/packaging/dotnet-core/prepare.py +13 -31
  38. data/vendor/libsodium/packaging/dotnet-core/recipes/linux-x64 +4 -0
  39. data/vendor/libsodium/packaging/nuget/package.config +1 -1
  40. data/vendor/libsodium/src/libsodium/Makefile.am +11 -12
  41. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +11 -4
  42. data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +17 -4
  43. data/vendor/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c +8 -1
  44. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box.c +6 -0
  45. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_easy.c +5 -4
  46. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c +11 -4
  47. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c +6 -0
  48. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +78 -17
  49. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +74 -64
  50. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +2 -0
  51. data/vendor/libsodium/src/libsodium/crypto_kx/crypto_kx.c +7 -0
  52. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +1 -1
  53. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +1 -0
  54. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +17 -17
  55. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c +53 -48
  56. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h +37 -11
  57. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c +23 -179
  58. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c +4 -12
  59. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c +244 -0
  60. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +3 -12
  61. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +4 -12
  62. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +1 -5
  63. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h +1 -1
  64. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx512f.h +145 -0
  65. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +91 -14
  66. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +35 -14
  67. data/vendor/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c +41 -4
  68. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +31 -17
  69. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +4 -0
  70. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +5 -1
  71. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +30 -1
  72. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +8 -0
  73. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +3 -3
  74. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c +6 -0
  75. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +5 -4
  76. data/vendor/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c +11 -4
  77. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c +6 -0
  78. data/vendor/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c +311 -0
  79. data/vendor/libsodium/src/libsodium/crypto_sign/crypto_sign.c +6 -0
  80. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ed25519_ref10.h +3 -0
  81. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +9 -2
  82. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +1 -1
  83. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +6 -5
  84. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c +6 -0
  85. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c +3 -2
  86. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c +3 -2
  87. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h +1 -1
  88. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c +3 -2
  89. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c +12 -0
  90. data/vendor/libsodium/src/libsodium/crypto_stream/crypto_stream.c +6 -0
  91. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c +7 -1
  92. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h +1 -1
  93. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c +6 -0
  94. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c +6 -0
  95. data/vendor/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c +6 -0
  96. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c +6 -0
  97. data/vendor/libsodium/src/libsodium/crypto_verify/sodium/verify.c +66 -29
  98. data/vendor/libsodium/src/libsodium/include/Makefile.am +1 -1
  99. data/vendor/libsodium/src/libsodium/include/sodium.h +2 -2
  100. data/vendor/libsodium/src/libsodium/include/sodium/core.h +9 -0
  101. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +26 -0
  102. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +16 -4
  103. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h +10 -4
  104. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +4 -0
  105. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h +6 -0
  106. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +24 -15
  107. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h +8 -4
  108. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash.h +40 -18
  109. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +8 -2
  110. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +8 -2
  111. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +11 -3
  112. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +4 -0
  113. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h +6 -0
  114. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +17 -8
  115. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h +102 -0
  116. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +4 -0
  117. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +4 -0
  118. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +1 -0
  119. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +4 -0
  120. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +10 -0
  121. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h +4 -0
  122. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +4 -0
  123. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +15 -5
  124. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xchacha20.h +4 -0
  125. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +4 -0
  126. data/vendor/libsodium/src/libsodium/include/sodium/export.h +9 -0
  127. data/vendor/libsodium/src/libsodium/include/sodium/private/common.h +11 -0
  128. data/vendor/libsodium/src/libsodium/include/sodium/private/curve25519_ref10.h +2 -30
  129. data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +2 -0
  130. data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +12 -9
  131. data/vendor/libsodium/src/libsodium/include/sodium/utils.h +36 -0
  132. data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +3 -2
  133. data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +18 -14
  134. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +11 -10
  135. data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +20 -8
  136. data/vendor/libsodium/src/libsodium/sodium/codecs.c +333 -0
  137. data/vendor/libsodium/src/libsodium/sodium/core.c +36 -4
  138. data/vendor/libsodium/src/libsodium/sodium/runtime.c +18 -0
  139. data/vendor/libsodium/src/libsodium/sodium/utils.c +87 -100
  140. data/vendor/libsodium/test/constcheck.sh +19 -0
  141. data/vendor/libsodium/test/default/Makefile.am +39 -7
  142. data/vendor/libsodium/test/default/aead_aes256gcm.c +6 -0
  143. data/vendor/libsodium/test/default/aead_chacha20poly1305.c +16 -0
  144. data/vendor/libsodium/test/default/aead_xchacha20poly1305.c +25 -15
  145. data/vendor/libsodium/test/default/auth.c +13 -0
  146. data/vendor/libsodium/test/default/auth.exp +8 -0
  147. data/vendor/libsodium/test/default/box.c +3 -0
  148. data/vendor/libsodium/test/default/box2.c +2 -0
  149. data/vendor/libsodium/test/default/box_easy.c +1 -4
  150. data/vendor/libsodium/test/default/box_easy2.c +7 -3
  151. data/vendor/libsodium/test/default/chacha20.c +9 -2
  152. data/vendor/libsodium/test/default/cmptest.h +47 -1
  153. data/vendor/libsodium/test/default/codecs.c +226 -0
  154. data/vendor/libsodium/test/default/codecs.exp +28 -0
  155. data/vendor/libsodium/test/default/core3.c +42 -15
  156. data/vendor/libsodium/test/default/ed25519_convert.c +17 -0
  157. data/vendor/libsodium/test/default/kdf.c +8 -4
  158. data/vendor/libsodium/test/default/keygen.c +5 -2
  159. data/vendor/libsodium/test/default/kx.c +30 -0
  160. data/vendor/libsodium/test/default/metamorphic.c +187 -0
  161. data/vendor/libsodium/test/default/metamorphic.exp +1 -0
  162. data/vendor/libsodium/test/default/misuse.c +145 -0
  163. data/vendor/libsodium/test/default/misuse.exp +0 -0
  164. data/vendor/libsodium/test/default/onetimeauth.c +2 -0
  165. data/vendor/libsodium/test/default/{pwhash.c → pwhash_argon2i.c} +133 -106
  166. data/vendor/libsodium/test/default/{pwhash.exp → pwhash_argon2i.exp} +0 -1
  167. data/vendor/libsodium/test/default/pwhash_argon2id.c +254 -144
  168. data/vendor/libsodium/test/default/pwhash_argon2id.exp +2 -3
  169. data/vendor/libsodium/test/default/pwhash_scrypt.c +61 -18
  170. data/vendor/libsodium/test/default/pwhash_scrypt.exp +6 -0
  171. data/vendor/libsodium/test/default/randombytes.c +8 -3
  172. data/vendor/libsodium/test/default/secretbox.c +8 -0
  173. data/vendor/libsodium/test/default/secretbox2.c +5 -0
  174. data/vendor/libsodium/test/default/secretbox_easy.c +19 -1
  175. data/vendor/libsodium/test/default/secretbox_easy.exp +2 -0
  176. data/vendor/libsodium/test/default/secretbox_easy2.c +4 -0
  177. data/vendor/libsodium/test/default/secretstream.c +280 -0
  178. data/vendor/libsodium/test/default/secretstream.exp +1 -0
  179. data/vendor/libsodium/test/default/sign.c +31 -0
  180. data/vendor/libsodium/test/default/sodium_core.c +23 -1
  181. data/vendor/libsodium/test/default/sodium_core.exp +1 -1
  182. data/vendor/libsodium/test/default/sodium_utils.c +45 -56
  183. data/vendor/libsodium/test/default/sodium_utils.exp +0 -8
  184. data/vendor/libsodium/test/default/stream.c +2 -0
  185. data/vendor/libsodium/test/default/stream2.c +1 -0
  186. data/vendor/libsodium/test/default/xchacha20.c +58 -7
  187. metadata +21 -18
  188. data/vendor/libsodium/dist-build/emscripten-wasm.sh +0 -132
  189. data/vendor/libsodium/m4/pkg.m4 +0 -214
  190. data/vendor/libsodium/packaging/dotnet-core/desktop.targets +0 -16
  191. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c +0 -174
  192. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c +0 -66
  193. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/common.h +0 -766
  194. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/consts.h +0 -28
  195. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c +0 -28
  196. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/int128.h +0 -50
  197. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c +0 -149
  198. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c +0 -31
  199. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c +0 -195
  200. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/stream_aes128ctr.c +0 -19
  201. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +0 -65
@@ -1,132 +0,0 @@
1
- #! /bin/sh
2
-
3
- export MAKE_FLAGS='-j4'
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_keygen","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_keygen","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_aead_xchacha20poly1305_ietf_abytes","_crypto_aead_xchacha20poly1305_ietf_decrypt","_crypto_aead_xchacha20poly1305_ietf_decrypt_detached","_crypto_aead_xchacha20poly1305_ietf_encrypt","_crypto_aead_xchacha20poly1305_ietf_encrypt_detached","_crypto_aead_xchacha20poly1305_ietf_keybytes","_crypto_aead_xchacha20poly1305_ietf_keygen","_crypto_aead_xchacha20poly1305_ietf_npubbytes","_crypto_aead_xchacha20poly1305_ietf_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_keybytes","_crypto_auth_keygen","_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_core_hchacha20","_crypto_core_hchacha20_constbytes","_crypto_core_hchacha20_inputbytes","_crypto_core_hchacha20_keybytes","_crypto_core_hchacha20_outputbytes","_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_keygen","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_kdf_bytes_max","_crypto_kdf_bytes_min","_crypto_kdf_contextbytes","_crypto_kdf_derive_from_key","_crypto_kdf_keybytes","_crypto_kdf_keygen","_crypto_pwhash_bytes_max","_crypto_pwhash_bytes_min","_crypto_pwhash_memlimit_max","_crypto_pwhash_memlimit_min","_crypto_pwhash_opslimit_max","_crypto_pwhash_opslimit_min","_crypto_pwhash_passwd_max","_crypto_pwhash_passwd_min","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_scalarbytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_keygen","_crypto_secretbox_macbytes","_crypto_secretbox_noncebytes","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_shorthash_keygen","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_final_create","_crypto_sign_final_verify","_crypto_sign_init","_crypto_sign_keypair","_crypto_sign_open","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_statebytes","_crypto_sign_update","_crypto_sign_verify_detached","_crypto_stream_keygen","_randombytes","_randombytes_buf","_randombytes_buf_deterministic","_randombytes_close","_randombytes_random","_randombytes_seedbytes","_randombytes_stir","_randombytes_uniform","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_minimal","_sodium_library_version_major","_sodium_library_version_minor","_sodium_version_string"]'
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_keygen","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_keygen","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_aead_xchacha20poly1305_ietf_abytes","_crypto_aead_xchacha20poly1305_ietf_decrypt","_crypto_aead_xchacha20poly1305_ietf_decrypt_detached","_crypto_aead_xchacha20poly1305_ietf_encrypt","_crypto_aead_xchacha20poly1305_ietf_encrypt_detached","_crypto_aead_xchacha20poly1305_ietf_keybytes","_crypto_aead_xchacha20poly1305_ietf_keygen","_crypto_aead_xchacha20poly1305_ietf_npubbytes","_crypto_aead_xchacha20poly1305_ietf_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_keygen","_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_keygen","_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_keygen","_crypto_auth_hmacsha512_statebytes","_crypto_auth_hmacsha512_update","_crypto_auth_hmacsha512_verify","_crypto_auth_keybytes","_crypto_auth_keygen","_crypto_auth_primitive","_crypto_auth_verify","_crypto_box","_crypto_box_afternm","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_boxzerobytes","_crypto_box_curve25519xchacha20poly1305_beforenm","_crypto_box_curve25519xchacha20poly1305_beforenmbytes","_crypto_box_curve25519xchacha20poly1305_detached","_crypto_box_curve25519xchacha20poly1305_detached_afternm","_crypto_box_curve25519xchacha20poly1305_easy","_crypto_box_curve25519xchacha20poly1305_easy_afternm","_crypto_box_curve25519xchacha20poly1305_keypair","_crypto_box_curve25519xchacha20poly1305_macbytes","_crypto_box_curve25519xchacha20poly1305_noncebytes","_crypto_box_curve25519xchacha20poly1305_open_detached","_crypto_box_curve25519xchacha20poly1305_open_detached_afternm","_crypto_box_curve25519xchacha20poly1305_open_easy","_crypto_box_curve25519xchacha20poly1305_open_easy_afternm","_crypto_box_curve25519xchacha20poly1305_publickeybytes","_crypto_box_curve25519xchacha20poly1305_secretkeybytes","_crypto_box_curve25519xchacha20poly1305_seed_keypair","_crypto_box_curve25519xchacha20poly1305_seedbytes","_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_hchacha20","_crypto_core_hchacha20_constbytes","_crypto_core_hchacha20_inputbytes","_crypto_core_hchacha20_keybytes","_crypto_core_hchacha20_outputbytes","_crypto_core_hsalsa20","_crypto_core_hsalsa20_constbytes","_crypto_core_hsalsa20_inputbytes","_crypto_core_hsalsa20_keybytes","_crypto_core_hsalsa20_outputbytes","_crypto_core_salsa20","_crypto_core_salsa2012","_crypto_core_salsa2012_constbytes","_crypto_core_salsa2012_inputbytes","_crypto_core_salsa2012_keybytes","_crypto_core_salsa2012_outputbytes","_crypto_core_salsa208","_crypto_core_salsa208_constbytes","_crypto_core_salsa208_inputbytes","_crypto_core_salsa208_keybytes","_crypto_core_salsa208_outputbytes","_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_keygen","_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_keygen","_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_kdf_blake2b_bytes_max","_crypto_kdf_blake2b_bytes_min","_crypto_kdf_blake2b_contextbytes","_crypto_kdf_blake2b_derive_from_key","_crypto_kdf_blake2b_keybytes","_crypto_kdf_bytes_max","_crypto_kdf_bytes_min","_crypto_kdf_contextbytes","_crypto_kdf_derive_from_key","_crypto_kdf_keybytes","_crypto_kdf_keygen","_crypto_kdf_primitive","_crypto_onetimeauth","_crypto_onetimeauth_bytes","_crypto_onetimeauth_final","_crypto_onetimeauth_init","_crypto_onetimeauth_keybytes","_crypto_onetimeauth_keygen","_crypto_onetimeauth_poly1305","_crypto_onetimeauth_poly1305_bytes","_crypto_onetimeauth_poly1305_final","_crypto_onetimeauth_poly1305_init","_crypto_onetimeauth_poly1305_keybytes","_crypto_onetimeauth_poly1305_keygen","_crypto_onetimeauth_poly1305_statebytes","_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_bytes_max","_crypto_pwhash_argon2i_bytes_min","_crypto_pwhash_argon2i_memlimit_interactive","_crypto_pwhash_argon2i_memlimit_max","_crypto_pwhash_argon2i_memlimit_min","_crypto_pwhash_argon2i_memlimit_moderate","_crypto_pwhash_argon2i_memlimit_sensitive","_crypto_pwhash_argon2i_opslimit_interactive","_crypto_pwhash_argon2i_opslimit_max","_crypto_pwhash_argon2i_opslimit_min","_crypto_pwhash_argon2i_opslimit_moderate","_crypto_pwhash_argon2i_opslimit_sensitive","_crypto_pwhash_argon2i_passwd_max","_crypto_pwhash_argon2i_passwd_min","_crypto_pwhash_argon2i_saltbytes","_crypto_pwhash_argon2i_str","_crypto_pwhash_argon2i_str_verify","_crypto_pwhash_argon2i_strbytes","_crypto_pwhash_argon2i_strprefix","_crypto_pwhash_bytes_max","_crypto_pwhash_bytes_min","_crypto_pwhash_memlimit_interactive","_crypto_pwhash_memlimit_max","_crypto_pwhash_memlimit_min","_crypto_pwhash_memlimit_moderate","_crypto_pwhash_memlimit_sensitive","_crypto_pwhash_opslimit_interactive","_crypto_pwhash_opslimit_max","_crypto_pwhash_opslimit_min","_crypto_pwhash_opslimit_moderate","_crypto_pwhash_opslimit_sensitive","_crypto_pwhash_passwd_max","_crypto_pwhash_passwd_min","_crypto_pwhash_primitive","_crypto_pwhash_saltbytes","_crypto_pwhash_scryptsalsa208sha256","_crypto_pwhash_scryptsalsa208sha256_bytes_max","_crypto_pwhash_scryptsalsa208sha256_bytes_min","_crypto_pwhash_scryptsalsa208sha256_ll","_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive","_crypto_pwhash_scryptsalsa208sha256_memlimit_max","_crypto_pwhash_scryptsalsa208sha256_memlimit_min","_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive","_crypto_pwhash_scryptsalsa208sha256_opslimit_max","_crypto_pwhash_scryptsalsa208sha256_opslimit_min","_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_passwd_max","_crypto_pwhash_scryptsalsa208sha256_passwd_min","_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_keygen","_crypto_secretbox_macbytes","_crypto_secretbox_noncebytes","_crypto_secretbox_open","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_secretbox_primitive","_crypto_secretbox_xchacha20poly1305_detached","_crypto_secretbox_xchacha20poly1305_easy","_crypto_secretbox_xchacha20poly1305_keybytes","_crypto_secretbox_xchacha20poly1305_macbytes","_crypto_secretbox_xchacha20poly1305_noncebytes","_crypto_secretbox_xchacha20poly1305_open_detached","_crypto_secretbox_xchacha20poly1305_open_easy","_crypto_secretbox_xsalsa20poly1305","_crypto_secretbox_xsalsa20poly1305_boxzerobytes","_crypto_secretbox_xsalsa20poly1305_keybytes","_crypto_secretbox_xsalsa20poly1305_keygen","_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_keygen","_crypto_shorthash_primitive","_crypto_shorthash_siphash24","_crypto_shorthash_siphash24_bytes","_crypto_shorthash_siphash24_keybytes","_crypto_shorthash_siphashx24","_crypto_shorthash_siphashx24_bytes","_crypto_shorthash_siphashx24_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_ed25519ph_final_create","_crypto_sign_ed25519ph_final_verify","_crypto_sign_ed25519ph_init","_crypto_sign_ed25519ph_statebytes","_crypto_sign_ed25519ph_update","_crypto_sign_final_create","_crypto_sign_final_verify","_crypto_sign_init","_crypto_sign_keypair","_crypto_sign_open","_crypto_sign_primitive","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_statebytes","_crypto_sign_update","_crypto_sign_verify_detached","_crypto_stream","_crypto_stream_aes128ctr","_crypto_stream_aes128ctr_afternm","_crypto_stream_aes128ctr_beforenm","_crypto_stream_aes128ctr_beforenmbytes","_crypto_stream_aes128ctr_keybytes","_crypto_stream_aes128ctr_noncebytes","_crypto_stream_aes128ctr_xor","_crypto_stream_aes128ctr_xor_afternm","_crypto_stream_chacha20","_crypto_stream_chacha20_ietf","_crypto_stream_chacha20_ietf_keybytes","_crypto_stream_chacha20_ietf_keygen","_crypto_stream_chacha20_ietf_noncebytes","_crypto_stream_chacha20_ietf_xor","_crypto_stream_chacha20_ietf_xor_ic","_crypto_stream_chacha20_keybytes","_crypto_stream_chacha20_keygen","_crypto_stream_chacha20_noncebytes","_crypto_stream_chacha20_xor","_crypto_stream_chacha20_xor_ic","_crypto_stream_keybytes","_crypto_stream_keygen","_crypto_stream_noncebytes","_crypto_stream_primitive","_crypto_stream_salsa20","_crypto_stream_salsa2012","_crypto_stream_salsa2012_keybytes","_crypto_stream_salsa2012_keygen","_crypto_stream_salsa2012_noncebytes","_crypto_stream_salsa2012_xor","_crypto_stream_salsa208","_crypto_stream_salsa208_keybytes","_crypto_stream_salsa208_keygen","_crypto_stream_salsa208_noncebytes","_crypto_stream_salsa208_xor","_crypto_stream_salsa20_keybytes","_crypto_stream_salsa20_keygen","_crypto_stream_salsa20_noncebytes","_crypto_stream_salsa20_xor","_crypto_stream_salsa20_xor_ic","_crypto_stream_xchacha20","_crypto_stream_xchacha20_keybytes","_crypto_stream_xchacha20_keygen","_crypto_stream_xchacha20_noncebytes","_crypto_stream_xchacha20_xor","_crypto_stream_xchacha20_xor_ic","_crypto_stream_xor","_crypto_stream_xsalsa20","_crypto_stream_xsalsa20_keybytes","_crypto_stream_xsalsa20_keygen","_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_buf_deterministic","_randombytes_close","_randombytes_implementation_name","_randombytes_random","_randombytes_seedbytes","_randombytes_stir","_randombytes_uniform","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_minimal","_sodium_library_version_major","_sodium_library_version_minor","_sodium_version_string"]'
6
- export TOTAL_MEMORY=16777216
7
- export TOTAL_MEMORY_SUMO=67108864
8
- export LDFLAGS="-s RESERVED_FUNCTION_POINTERS=8"
9
- export LDFLAGS="${LDFLAGS} -s WASM=1"
10
- export LDFLAGS="${LDFLAGS} -s NO_DYNAMIC_EXECUTION=1 -s RUNNING_JS_OPTS=1 -s ASSERTIONS=0"
11
- export LDFLAGS="${LDFLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s ALIASING_FUNCTION_POINTERS=1"
12
- export LDFLAGS="${LDFLAGS} -s FUNCTION_POINTER_ALIGNMENT=1 -s DISABLE_EXCEPTION_CATCHING=1"
13
- export LDFLAGS="${LDFLAGS} -s ELIMINATE_DUPLICATE_FUNCTIONS=1"
14
- export LDFLAGS="${LDFLAGS} -s ALLOW_MEMORY_GROWTH=1"
15
- export LDFLAGS_DIST="-s NO_FILESYSTEM=1"
16
- export CFLAGS="-Os"
17
-
18
- echo
19
- if [ "x$1" = "x--standard" ]; then
20
- echo "Building a standard distribution in ${PREFIX}"
21
- export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_STANDARD"
22
- export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${TOTAL_MEMORY}"
23
- export PREFIX="$(pwd)/libsodium-js"
24
- export DONE_FILE="$(pwd)/js.done"
25
- export DIST='yes'
26
- elif [ "x$1" = "x--sumo" ]; then
27
- echo "Building a sumo distribution in ${PREFIX}"
28
- export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
29
- export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
30
- export PREFIX="$(pwd)/libsodium-js-sumo"
31
- export DONE_FILE="$(pwd)/js-sumo.done"
32
- export DIST='yes'
33
- elif [ "x$1" = "x--browser-tests" ]; then
34
- echo "Building tests for web browsers"
35
- export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
36
- export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
37
- export PREFIX="$(pwd)/libsodium-js-tests"
38
- export DONE_FILE="$(pwd)/js-tests-browser.done"
39
- export BROWSER_TESTS='yes'
40
- export DIST='no'
41
- elif [ "x$1" = "x--tests" ]; then
42
- echo "Building for testing"
43
- export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
44
- export CFLAGS="${CFLAGS} -s BINARYEN_METHOD='interpret-binary'"
45
- export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
46
- export PREFIX="$(pwd)/libsodium-js-tests"
47
- export DONE_FILE="$(pwd)/js-tests.done"
48
- export DIST='no'
49
- else
50
- echo "Usage: $0 <build_type>"
51
- echo "<build_type> := --standard | --sumo | --browser-tests | --tests"
52
- echo
53
- exit 1
54
- fi
55
- export JS_EXPORTS_FLAGS="-s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS}"
56
-
57
- rm -f "$DONE_FILE"
58
-
59
- echo
60
- emconfigure ./configure --enable-minimal --disable-shared --prefix="$PREFIX" \
61
- --without-pthreads CFLAGS="$CFLAGS" && \
62
- emmake make clean
63
- [ $? = 0 ] || exit 1
64
-
65
- if [ "$DIST" = yes ]; then
66
- emmake make $MAKE_FLAGS install && \
67
- emcc "$CFLAGS" --llvm-lto 1 --memory-init-file 0 $CPPFLAGS $LDFLAGS $JS_EXPORTS_FLAGS \
68
- "${PREFIX}/lib/libsodium.a" -o "${PREFIX}/lib/libsodium.js" || exit 1
69
- touch -r "${PREFIX}/lib/libsodium.js" "$DONE_FILE"
70
- ls -l "${PREFIX}/lib/libsodium.js"
71
- exit 0
72
- fi
73
-
74
- if test "x$NODE" = x; then
75
- for candidate in node nodejs; do
76
- case $($candidate --version 2>&1) in #(
77
- v*)
78
- NODE=$candidate
79
- break ;;
80
- esac
81
- done
82
- fi
83
-
84
- if [ "x$BROWSER_TESTS" != "x" ]; then
85
- echo 'Compiling the test suite for web browsers...' && \
86
- emmake make $MAKE_FLAGS CPPFLAGS="$CPPFLAGS -DBROWSER_TESTS=1" check > /dev/null 2>&1
87
- else
88
- if test "x$NODE" = x; then
89
- echo 'node.js not found - test suite skipped' >&2
90
- exit 1
91
- fi
92
- export NODE="${NODE} --expose-wasm"
93
- echo "Using [${NODE}] as a Javascript runtime"
94
- echo 'Compiling the test suite...' && \
95
- emmake make $MAKE_FLAGS check > /dev/null 2>&1
96
- fi
97
-
98
- if [ "x$BROWSER_TESTS" != "x" ]; then
99
- echo 'Creating the test suite for web browsers'
100
- (
101
- cd test/default && \
102
- mkdir -p browser-wasm && \
103
- rm -f browser-wasm/tests.txt && \
104
- for file in *.js; do
105
- tname=$(echo "$file" | sed 's/.js$//')
106
- echo "$tname" | egrep -q '[.]asm$' && continue
107
- echo "[${tname}]"
108
- fgrep -v "#! /usr/bin/env ${NODE}" "$file" > "browser-wasm/${file}"
109
- cp -f "${tname}.exp" "browser-wasm/${tname}.exp" 2> /dev/null
110
- cp -f "${tname}.wasm" "browser-wasm/${tname}.wasm" 2> /dev/null
111
- cp -f "${tname}.asm.js" "browser-wasm/${tname}.asm.js" 2> /dev/null
112
- sed "s/{{tname}}/${tname}/" index-wasm.html.tpl > "browser-wasm/${tname}.html"
113
- echo "${tname}.html" >> "browser-wasm/tests.txt"
114
- done
115
- touch "$DONE_FILE"
116
- )
117
- else
118
- echo 'Running the test suite'
119
- (
120
- cd test/default && \
121
- for file in $(ls *.js | fgrep -v asm.js); do
122
- echo "#! /usr/bin/env ${NODE}" > "${file}.tmp"
123
- fgrep -v "#! /usr/bin/env ${NODE}" "$file" >> "${file}.tmp"
124
- chmod +x "${file}.tmp"
125
- mv -f "${file}.tmp" "$file"
126
- done
127
- )
128
- make $MAKE_FLAGS check || exit 1
129
- touch "$DONE_FILE"
130
- fi
131
-
132
- echo 'Done.'
@@ -1,214 +0,0 @@
1
- # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2
- # serial 1 (pkg-config-0.24)
3
- #
4
- # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
5
- #
6
- # This program is free software; you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation; either version 2 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful, but
12
- # WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- # General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with this program; if not, write to the Free Software
18
- # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
- #
20
- # As a special exception to the GNU General Public License, if you
21
- # distribute this file as part of a program that contains a
22
- # configuration script generated by Autoconf, you may include it under
23
- # the same distribution terms that you use for the rest of that program.
24
-
25
- # PKG_PROG_PKG_CONFIG([MIN-VERSION])
26
- # ----------------------------------
27
- AC_DEFUN([PKG_PROG_PKG_CONFIG],
28
- [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
29
- m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
30
- m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
31
- AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
32
- AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
33
- AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
34
-
35
- if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
36
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
37
- fi
38
- if test -n "$PKG_CONFIG"; then
39
- _pkg_min_version=m4_default([$1], [0.9.0])
40
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
41
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
42
- AC_MSG_RESULT([yes])
43
- else
44
- AC_MSG_RESULT([no])
45
- PKG_CONFIG=""
46
- fi
47
- fi[]dnl
48
- ])# PKG_PROG_PKG_CONFIG
49
-
50
- # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
51
- #
52
- # Check to see whether a particular set of modules exists. Similar
53
- # to PKG_CHECK_MODULES(), but does not set variables or print errors.
54
- #
55
- # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
56
- # only at the first occurrence in configure.ac, so if the first place
57
- # it's called might be skipped (such as if it is within an "if", you
58
- # have to call PKG_CHECK_EXISTS manually
59
- # --------------------------------------------------------------
60
- AC_DEFUN([PKG_CHECK_EXISTS],
61
- [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
62
- if test -n "$PKG_CONFIG" && \
63
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
64
- m4_default([$2], [:])
65
- m4_ifvaln([$3], [else
66
- $3])dnl
67
- fi])
68
-
69
- # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
70
- # ---------------------------------------------
71
- m4_define([_PKG_CONFIG],
72
- [if test -n "$$1"; then
73
- pkg_cv_[]$1="$$1"
74
- elif test -n "$PKG_CONFIG"; then
75
- PKG_CHECK_EXISTS([$3],
76
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
77
- test "x$?" != "x0" && pkg_failed=yes ],
78
- [pkg_failed=yes])
79
- else
80
- pkg_failed=untried
81
- fi[]dnl
82
- ])# _PKG_CONFIG
83
-
84
- # _PKG_SHORT_ERRORS_SUPPORTED
85
- # -----------------------------
86
- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
87
- [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
88
- if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
89
- _pkg_short_errors_supported=yes
90
- else
91
- _pkg_short_errors_supported=no
92
- fi[]dnl
93
- ])# _PKG_SHORT_ERRORS_SUPPORTED
94
-
95
-
96
- # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
97
- # [ACTION-IF-NOT-FOUND])
98
- #
99
- #
100
- # Note that if there is a possibility the first call to
101
- # PKG_CHECK_MODULES might not happen, you should be sure to include an
102
- # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
103
- #
104
- #
105
- # --------------------------------------------------------------
106
- AC_DEFUN([PKG_CHECK_MODULES],
107
- [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
108
- AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
109
- AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
110
-
111
- pkg_failed=no
112
- AC_MSG_CHECKING([for $1])
113
-
114
- _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
115
- _PKG_CONFIG([$1][_LIBS], [libs], [$2])
116
-
117
- m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
118
- and $1[]_LIBS to avoid the need to call pkg-config.
119
- See the pkg-config man page for more details.])
120
-
121
- if test $pkg_failed = yes; then
122
- AC_MSG_RESULT([no])
123
- _PKG_SHORT_ERRORS_SUPPORTED
124
- if test $_pkg_short_errors_supported = yes; then
125
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
126
- else
127
- $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
128
- fi
129
- # Put the nasty error message in config.log where it belongs
130
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
131
-
132
- m4_default([$4], [AC_MSG_ERROR(
133
- [Package requirements ($2) were not met:
134
-
135
- $$1_PKG_ERRORS
136
-
137
- Consider adjusting the PKG_CONFIG_PATH environment variable if you
138
- installed software in a non-standard prefix.
139
-
140
- _PKG_TEXT])[]dnl
141
- ])
142
- elif test $pkg_failed = untried; then
143
- AC_MSG_RESULT([no])
144
- m4_default([$4], [AC_MSG_FAILURE(
145
- [The pkg-config script could not be found or is too old. Make sure it
146
- is in your PATH or set the PKG_CONFIG environment variable to the full
147
- path to pkg-config.
148
-
149
- _PKG_TEXT
150
-
151
- To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
152
- ])
153
- else
154
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
155
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
156
- AC_MSG_RESULT([yes])
157
- $3
158
- fi[]dnl
159
- ])# PKG_CHECK_MODULES
160
-
161
-
162
- # PKG_INSTALLDIR(DIRECTORY)
163
- # -------------------------
164
- # Substitutes the variable pkgconfigdir as the location where a module
165
- # should install pkg-config .pc files. By default the directory is
166
- # $libdir/pkgconfig, but the default can be changed by passing
167
- # DIRECTORY. The user can override through the --with-pkgconfigdir
168
- # parameter.
169
- AC_DEFUN([PKG_INSTALLDIR],
170
- [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
171
- m4_pushdef([pkg_description],
172
- [pkg-config installation directory @<:@]pkg_default[@:>@])
173
- AC_ARG_WITH([pkgconfigdir],
174
- [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
175
- [with_pkgconfigdir=]pkg_default)
176
- AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
177
- m4_popdef([pkg_default])
178
- m4_popdef([pkg_description])
179
- ]) dnl PKG_INSTALLDIR
180
-
181
-
182
- # PKG_NOARCH_INSTALLDIR(DIRECTORY)
183
- # -------------------------
184
- # Substitutes the variable noarch_pkgconfigdir as the location where a
185
- # module should install arch-independent pkg-config .pc files. By
186
- # default the directory is $datadir/pkgconfig, but the default can be
187
- # changed by passing DIRECTORY. The user can override through the
188
- # --with-noarch-pkgconfigdir parameter.
189
- AC_DEFUN([PKG_NOARCH_INSTALLDIR],
190
- [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
191
- m4_pushdef([pkg_description],
192
- [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
193
- AC_ARG_WITH([noarch-pkgconfigdir],
194
- [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
195
- [with_noarch_pkgconfigdir=]pkg_default)
196
- AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
197
- m4_popdef([pkg_default])
198
- m4_popdef([pkg_description])
199
- ]) dnl PKG_NOARCH_INSTALLDIR
200
-
201
-
202
- # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
203
- # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
204
- # -------------------------------------------
205
- # Retrieves the value of the pkg-config variable for the given module.
206
- AC_DEFUN([PKG_CHECK_VAR],
207
- [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
208
- AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
209
-
210
- _PKG_CONFIG([$1], [variable="][$3]["], [$2])
211
- AS_VAR_COPY([$1], [pkg_cv_][$1])
212
-
213
- AS_VAR_IF([$1], [""], [$5], [$4])dnl
214
- ])# PKG_CHECK_VAR
@@ -1,16 +0,0 @@
1
- <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
- <ItemGroup>
3
- <None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\libsodium.dll">
4
- <Link>x86\libsodium.dll</Link>
5
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6
- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
7
- <Visible>false</Visible>
8
- </None>
9
- <None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\libsodium.dll">
10
- <Link>x64\libsodium.dll</Link>
11
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12
- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
13
- <Visible>false</Visible>
14
- </None>
15
- </ItemGroup>
16
- </Project>
@@ -1,174 +0,0 @@
1
- /* Author: Peter Schwabe, ported from an assembly implementation by Emilia
2
- * Käsper
3
- * Date: 2009-03-19
4
- * Public domain */
5
-
6
- #include "common.h"
7
- #include "consts.h"
8
- #include "crypto_stream_aes128ctr.h"
9
- #include "int128.h"
10
-
11
- int
12
- crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len,
13
- const unsigned char *nonce,
14
- const unsigned char *c)
15
- {
16
- aes_uint128_t xmm0;
17
- aes_uint128_t xmm1;
18
- aes_uint128_t xmm2;
19
- aes_uint128_t xmm3;
20
- aes_uint128_t xmm4;
21
- aes_uint128_t xmm5;
22
- aes_uint128_t xmm6;
23
- aes_uint128_t xmm7;
24
- aes_uint128_t xmm8;
25
- aes_uint128_t xmm9;
26
- aes_uint128_t xmm10;
27
- aes_uint128_t xmm11;
28
- aes_uint128_t xmm12;
29
- aes_uint128_t xmm13;
30
- aes_uint128_t xmm14;
31
- aes_uint128_t xmm15;
32
- aes_uint128_t nonce_stack;
33
- unsigned long long lensav;
34
- unsigned char bl[128];
35
- unsigned char *blp;
36
- unsigned char *np;
37
- unsigned char b;
38
- uint32_t tmp;
39
-
40
- /* Copy nonce on the stack */
41
- copy2(&nonce_stack, (const aes_uint128_t *) (nonce + 0));
42
- np = (unsigned char *) &nonce_stack;
43
-
44
- enc_block:
45
-
46
- xmm0 = *(aes_uint128_t *) (np + 0);
47
- copy2(&xmm1, &xmm0);
48
- shufb(&xmm1, SWAP32);
49
- copy2(&xmm2, &xmm1);
50
- copy2(&xmm3, &xmm1);
51
- copy2(&xmm4, &xmm1);
52
- copy2(&xmm5, &xmm1);
53
- copy2(&xmm6, &xmm1);
54
- copy2(&xmm7, &xmm1);
55
-
56
- add_uint32_big(&xmm1, 1);
57
- add_uint32_big(&xmm2, 2);
58
- add_uint32_big(&xmm3, 3);
59
- add_uint32_big(&xmm4, 4);
60
- add_uint32_big(&xmm5, 5);
61
- add_uint32_big(&xmm6, 6);
62
- add_uint32_big(&xmm7, 7);
63
-
64
- shufb(&xmm0, M0);
65
- shufb(&xmm1, M0SWAP);
66
- shufb(&xmm2, M0SWAP);
67
- shufb(&xmm3, M0SWAP);
68
- shufb(&xmm4, M0SWAP);
69
- shufb(&xmm5, M0SWAP);
70
- shufb(&xmm6, M0SWAP);
71
- shufb(&xmm7, M0SWAP);
72
-
73
- bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, xmm8);
74
-
75
- aesround(1, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9,
76
- xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, c);
77
- aesround(2, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0,
78
- xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, c);
79
- aesround(3, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9,
80
- xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, c);
81
- aesround(4, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0,
82
- xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, c);
83
- aesround(5, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9,
84
- xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, c);
85
- aesround(6, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0,
86
- xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, c);
87
- aesround(7, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9,
88
- xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, c);
89
- aesround(8, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0,
90
- xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, c);
91
- aesround(9, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9,
92
- xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, c);
93
- lastround(xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1,
94
- xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, c);
95
-
96
- bitslice(xmm13, xmm10, xmm15, xmm11, xmm14, xmm12, xmm9, xmm8, xmm0);
97
-
98
- if (len < 128) {
99
- goto partial;
100
- }
101
- if (len == 128) {
102
- goto full;
103
- }
104
- tmp = LOAD32_BE(np + 12);
105
- tmp += 8;
106
- STORE32_BE(np + 12, tmp);
107
-
108
- *(aes_uint128_t *) (out + 0) = xmm8;
109
- *(aes_uint128_t *) (out + 16) = xmm9;
110
- *(aes_uint128_t *) (out + 32) = xmm12;
111
- *(aes_uint128_t *) (out + 48) = xmm14;
112
- *(aes_uint128_t *) (out + 64) = xmm11;
113
- *(aes_uint128_t *) (out + 80) = xmm15;
114
- *(aes_uint128_t *) (out + 96) = xmm10;
115
- *(aes_uint128_t *) (out + 112) = xmm13;
116
-
117
- len -= 128;
118
- out += 128;
119
-
120
- goto enc_block;
121
-
122
- partial:
123
-
124
- lensav = len;
125
- len >>= 4;
126
-
127
- tmp = LOAD32_BE(np + 12);
128
- tmp += len;
129
- STORE32_BE(np + 12, tmp);
130
-
131
- blp = bl;
132
-
133
- *(aes_uint128_t *) (blp + 0) = xmm8;
134
- *(aes_uint128_t *) (blp + 16) = xmm9;
135
- *(aes_uint128_t *) (blp + 32) = xmm12;
136
- *(aes_uint128_t *) (blp + 48) = xmm14;
137
- *(aes_uint128_t *) (blp + 64) = xmm11;
138
- *(aes_uint128_t *) (blp + 80) = xmm15;
139
- *(aes_uint128_t *) (blp + 96) = xmm10;
140
- *(aes_uint128_t *) (blp + 112) = xmm13;
141
-
142
- bytes:
143
-
144
- if (lensav == 0) {
145
- goto end;
146
- }
147
- b = blp[0]; /* clang false positive */
148
-
149
- *(unsigned char *) (out + 0) = b;
150
-
151
- blp += 1;
152
- out += 1;
153
- lensav -= 1;
154
-
155
- goto bytes;
156
-
157
- full:
158
-
159
- tmp = LOAD32_BE(np + 12);
160
- tmp += 8;
161
- STORE32_BE(np + 12, tmp);
162
-
163
- *(aes_uint128_t *) (out + 0) = xmm8;
164
- *(aes_uint128_t *) (out + 16) = xmm9;
165
- *(aes_uint128_t *) (out + 32) = xmm12;
166
- *(aes_uint128_t *) (out + 48) = xmm14;
167
- *(aes_uint128_t *) (out + 64) = xmm11;
168
- *(aes_uint128_t *) (out + 80) = xmm15;
169
- *(aes_uint128_t *) (out + 96) = xmm10;
170
- *(aes_uint128_t *) (out + 112) = xmm13;
171
-
172
- end:
173
- return 0;
174
- }