rbnacl-libsodium 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +4 -0
  3. data/lib/rbnacl/libsodium/version.rb +1 -1
  4. data/vendor/libsodium/AUTHORS +10 -3
  5. data/vendor/libsodium/ChangeLog +19 -1
  6. data/vendor/libsodium/Makefile.in +1 -0
  7. data/vendor/libsodium/README.markdown +1 -1
  8. data/vendor/libsodium/THANKS +1 -0
  9. data/vendor/libsodium/autogen.sh +24 -4
  10. data/vendor/libsodium/autom4te.cache/output.1 +208 -24
  11. data/vendor/libsodium/autom4te.cache/output.5 +208 -24
  12. data/vendor/libsodium/autom4te.cache/requests +869 -869
  13. data/vendor/libsodium/autom4te.cache/traces.1 +426 -406
  14. data/vendor/libsodium/autom4te.cache/traces.5 +255 -245
  15. data/vendor/libsodium/builds/msvc/version.h +2 -2
  16. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +14 -44
  17. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +36 -132
  18. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +14 -44
  19. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +36 -132
  20. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +14 -44
  21. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +36 -132
  22. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +14 -44
  23. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +62 -158
  24. data/vendor/libsodium/configure +208 -24
  25. data/vendor/libsodium/configure.ac +70 -15
  26. data/vendor/libsodium/dist-build/Makefile.in +1 -0
  27. data/vendor/libsodium/dist-build/emscripten.sh +52 -19
  28. data/vendor/libsodium/dist-build/ios.sh +8 -8
  29. data/vendor/libsodium/dist-build/msys2-win32.sh +2 -1
  30. data/vendor/libsodium/dist-build/msys2-win64.sh +2 -1
  31. data/vendor/libsodium/dist-build/osx.sh +2 -2
  32. data/vendor/libsodium/examples/box.c +3 -1
  33. data/vendor/libsodium/examples/box_detached.c +4 -2
  34. data/vendor/libsodium/examples/utils.h +3 -1
  35. data/vendor/libsodium/libsodium.vcxproj +13 -13
  36. data/vendor/libsodium/libsodium.vcxproj.filters +31 -35
  37. data/vendor/libsodium/msvc-scripts/Makefile.in +1 -0
  38. data/vendor/libsodium/msvc-scripts/process.bat +2 -2
  39. data/vendor/libsodium/src/Makefile.in +1 -0
  40. data/vendor/libsodium/src/libsodium/Makefile.am +43 -45
  41. data/vendor/libsodium/src/libsodium/Makefile.in +250 -249
  42. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +28 -22
  43. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +3 -4
  44. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c +3 -3
  45. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +3 -4
  46. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c +4 -4
  47. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c +4 -4
  48. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c +6 -4
  49. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_easy.c +6 -2
  50. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c +3 -3
  51. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c +5 -3
  52. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c +13 -9
  53. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c +3 -3
  54. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20.c +2 -2
  55. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/core_salsa20.c +2 -2
  56. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/core_salsa2012.c +2 -2
  57. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/core_salsa208.c +2 -2
  58. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +2 -2
  59. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +36 -26
  60. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +1 -1
  61. data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +1 -2
  62. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +2 -3
  63. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +2 -3
  64. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/{auth_poly1305_donna.c → poly1305_donna.c} +18 -11
  65. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +1 -5
  66. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +10 -9
  67. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +17 -9
  68. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +10 -1
  69. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +708 -0
  70. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h +31 -0
  71. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +1 -0
  72. data/vendor/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c +11 -12
  73. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/{smult_curve25519_donna_c64.c → curve25519_donna_c64.c} +32 -15
  74. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h +9 -0
  75. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.c +73 -0
  76. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.h +9 -0
  77. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_frombytes_curve25519_ref10.c +1 -0
  78. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S +25 -0
  79. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h +20 -0
  80. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c +114 -0
  81. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h +9 -0
  82. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h +25 -0
  83. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h +33 -0
  84. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +57 -0
  85. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S +189 -0
  86. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h +16 -0
  87. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +165 -0
  88. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +219 -0
  89. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +76 -0
  90. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +1432 -0
  91. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h +18 -0
  92. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S +1287 -0
  93. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h +18 -0
  94. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h +8 -0
  95. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h +8 -0
  96. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S +17 -0
  97. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +67 -0
  98. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h +11 -0
  99. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c +3 -3
  100. data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24.c +3 -2
  101. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge.h +2 -0
  102. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_double_scalarmult.c +42 -0
  103. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +7 -7
  104. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +113 -0
  105. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +10 -7
  106. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +10 -10
  107. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +2 -2
  108. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c +2 -2
  109. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c +10 -9
  110. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +2 -3
  111. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +72 -68
  112. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/{api.h → stream_chacha20_ref.h} +5 -0
  113. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/{stream_chacha20_api.c → stream_chacha20.c} +27 -7
  114. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.h +22 -0
  115. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.c +329 -0
  116. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.h +27 -0
  117. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S +1 -1
  118. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +2 -2
  119. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +1 -1
  120. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +2 -2
  121. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +2 -2
  122. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +2 -2
  123. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +2 -2
  124. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c +2 -2
  125. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c +4 -4
  126. data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/verify_16.c +14 -21
  127. data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/verify_32.c +14 -37
  128. data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/verify_64.c +14 -69
  129. data/vendor/libsodium/src/libsodium/include/Makefile.in +1 -0
  130. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +8 -4
  131. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +4 -2
  132. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +2 -2
  133. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +2 -3
  134. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h +2 -1
  135. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +6 -1
  136. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +5 -0
  137. data/vendor/libsodium/src/libsodium/include/sodium/randombytes_nativeclient.h +6 -20
  138. data/vendor/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h +1 -28
  139. data/vendor/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h +1 -27
  140. data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +3 -0
  141. data/vendor/libsodium/src/libsodium/include/sodium/utils.h +6 -0
  142. data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +3 -3
  143. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +58 -51
  144. data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +23 -18
  145. data/vendor/libsodium/src/libsodium/sodium/core.c +4 -0
  146. data/vendor/libsodium/src/libsodium/sodium/runtime.c +34 -15
  147. data/vendor/libsodium/src/libsodium/sodium/utils.c +104 -14
  148. data/vendor/libsodium/test/Makefile.in +1 -0
  149. data/vendor/libsodium/test/default/Makefile.in +1 -0
  150. data/vendor/libsodium/test/default/auth.c +5 -5
  151. data/vendor/libsodium/test/default/auth2.c +3 -3
  152. data/vendor/libsodium/test/default/auth3.c +3 -3
  153. data/vendor/libsodium/test/default/auth5.c +4 -4
  154. data/vendor/libsodium/test/default/auth6.c +3 -3
  155. data/vendor/libsodium/test/default/auth7.c +4 -4
  156. data/vendor/libsodium/test/default/box.c +13 -9
  157. data/vendor/libsodium/test/default/box2.c +11 -8
  158. data/vendor/libsodium/test/default/box7.c +11 -9
  159. data/vendor/libsodium/test/default/box8.c +32 -19
  160. data/vendor/libsodium/test/default/box_easy.c +31 -10
  161. data/vendor/libsodium/test/default/box_easy.exp +3 -19
  162. data/vendor/libsodium/test/default/box_easy2.c +30 -15
  163. data/vendor/libsodium/test/default/box_seed.c +1 -1
  164. data/vendor/libsodium/test/default/cmptest.h +22 -1
  165. data/vendor/libsodium/test/default/core1.c +6 -5
  166. data/vendor/libsodium/test/default/core2.c +6 -5
  167. data/vendor/libsodium/test/default/core3.c +8 -7
  168. data/vendor/libsodium/test/default/core4.c +11 -8
  169. data/vendor/libsodium/test/default/core5.c +7 -5
  170. data/vendor/libsodium/test/default/core6.c +8 -6
  171. data/vendor/libsodium/test/default/generichash.c +0 -15
  172. data/vendor/libsodium/test/default/generichash.exp +0 -1
  173. data/vendor/libsodium/test/default/generichash3.c +1 -21
  174. data/vendor/libsodium/test/default/generichash3.exp +1 -1
  175. data/vendor/libsodium/test/default/hash.c +3 -3
  176. data/vendor/libsodium/test/default/hash3.c +2 -2
  177. data/vendor/libsodium/test/default/index.html.tpl +84 -0
  178. data/vendor/libsodium/test/default/onetimeauth.c +3 -3
  179. data/vendor/libsodium/test/default/onetimeauth2.c +5 -4
  180. data/vendor/libsodium/test/default/onetimeauth7.c +4 -4
  181. data/vendor/libsodium/test/default/pre.js.inc +14 -6
  182. data/vendor/libsodium/test/default/randombytes.c +2 -2
  183. data/vendor/libsodium/test/default/scalarmult.c +19 -6
  184. data/vendor/libsodium/test/default/scalarmult.exp +1 -0
  185. data/vendor/libsodium/test/default/scalarmult2.c +2 -2
  186. data/vendor/libsodium/test/default/scalarmult5.c +6 -4
  187. data/vendor/libsodium/test/default/scalarmult6.c +5 -3
  188. data/vendor/libsodium/test/default/scalarmult7.c +11 -7
  189. data/vendor/libsodium/test/default/secretbox.c +7 -6
  190. data/vendor/libsodium/test/default/secretbox2.c +7 -6
  191. data/vendor/libsodium/test/default/secretbox7.c +5 -5
  192. data/vendor/libsodium/test/default/secretbox8.c +5 -5
  193. data/vendor/libsodium/test/default/secretbox_easy.c +27 -17
  194. data/vendor/libsodium/test/default/secretbox_easy.exp +7 -95
  195. data/vendor/libsodium/test/default/secretbox_easy2.c +22 -10
  196. data/vendor/libsodium/test/default/sign.c +5 -0
  197. data/vendor/libsodium/test/default/sodium_utils.c +73 -0
  198. data/vendor/libsodium/test/default/sodium_utils.exp +6 -0
  199. data/vendor/libsodium/test/default/stream.c +7 -6
  200. data/vendor/libsodium/test/default/stream2.c +4 -4
  201. data/vendor/libsodium/test/default/stream3.c +6 -5
  202. data/vendor/libsodium/test/default/stream4.c +7 -6
  203. data/vendor/libsodium/test/default/verify1.c +61 -18
  204. data/vendor/libsodium/test/default/verify1.exp +2 -6
  205. metadata +37 -44
  206. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/api.h +0 -9
  207. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/api.h +0 -9
  208. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/api.h +0 -9
  209. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/api.h +0 -20
  210. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/api.h +0 -10
  211. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/api.h +0 -10
  212. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/api.h +0 -10
  213. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/api.h +0 -10
  214. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/api.h +0 -2
  215. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/api.h +0 -10
  216. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/api.h +0 -10
  217. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/api.h +0 -6
  218. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/base_curve25519_donna_c64.c +0 -13
  219. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/api.h +0 -5
  220. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/base_curve25519_ref10.c +0 -14
  221. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/scalarmult_curve25519_ref10.c +0 -54
  222. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519_api.c +0 -14
  223. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/api.h +0 -11
  224. data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/api.h +0 -7
  225. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/api.h +0 -15
  226. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/api.h +0 -12
  227. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519.h +0 -54
  228. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519_edwards25519sha512batch.c +0 -348
  229. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519.h +0 -34
  230. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519_edwards25519sha512batch.c +0 -230
  231. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519.h +0 -51
  232. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519_edwards25519sha512batch.c +0 -150
  233. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c +0 -106
  234. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/sign_edwards25519sha512batch_api.c +0 -16
  235. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/api.h +0 -13
  236. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/api.h +0 -1
  237. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/api.h +0 -5
  238. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/api.h +0 -10
  239. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/api.h +0 -9
  240. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/api.h +0 -11
  241. data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/api.h +0 -2
  242. data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/api.h +0 -2
  243. data/vendor/libsodium/src/libsodium/crypto_verify/64/ref/api.h +0 -2
@@ -173,7 +173,7 @@ aesni_encrypt1(unsigned char *out, __m128i nv, const __m128i *rkeys)
173
173
  X(6); \
174
174
  X(7)
175
175
 
176
- #define COUNTER_INC2(N) (*(uint32_t *) &(N)[12]) = (2U + (((*(uint32_t *) &(N)[12]))))
176
+ #define COUNTER_INC2(N) (N)[3] += 2
177
177
 
178
178
  /* create a function of unrolling N ; the MAKEN is the unrolling
179
179
  macro, defined above. The N in MAKEN must match N, obviously. */
@@ -518,8 +518,8 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen
518
518
  unsigned long long i, j;
519
519
  unsigned long long adlen_rnd64 = adlen & ~63ULL;
520
520
  unsigned long long mlen_rnd128 = mlen & ~127ULL;
521
+ CRYPTO_ALIGN(16) uint32_t n2[4];
521
522
  CRYPTO_ALIGN(16) unsigned char H[16];
522
- CRYPTO_ALIGN(16) unsigned char n2[16];
523
523
  CRYPTO_ALIGN(16) unsigned char T[16];
524
524
  CRYPTO_ALIGN(16) unsigned char accum[16];
525
525
  CRYPTO_ALIGN(16) unsigned char fb[16];
@@ -529,13 +529,16 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen
529
529
  if (mlen > 16ULL * (1ULL << 32)) {
530
530
  abort();
531
531
  }
532
- memcpy(&n2[0], npub, 12);
533
- *(uint32_t *) &n2[12] = 0x01000000;
532
+ memcpy(&n2[0], npub, 3 * 4);
533
+ n2[3] = 0x01000000;
534
534
  aesni_encrypt1(T, _mm_load_si128((const __m128i *) n2), rkeys);
535
-
536
- (*(uint64_t *) &fb[0]) = _bswap64((uint64_t) (8 * adlen));
537
- (*(uint64_t *) &fb[8]) = _bswap64((uint64_t) (8 * mlen));
538
-
535
+ {
536
+ uint64_t x;
537
+ x = _bswap64((uint64_t) (8 * adlen));
538
+ memcpy(&fb[0], &x, sizeof x);
539
+ x = _bswap64((uint64_t) (8 * mlen));
540
+ memcpy(&fb[8], &x, sizeof x);
541
+ }
539
542
  /* we store H (and it's power) byte-reverted once and for all */
540
543
  Hv = _mm_shuffle_epi8(_mm_load_si128((const __m128i *) H), rev);
541
544
  _mm_store_si128((__m128i *) H, Hv);
@@ -571,7 +574,7 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen
571
574
  const int lb = iter * 16; \
572
575
  \
573
576
  for (i = 0; i < mlen_rnd128; i += lb) { \
574
- aesni_encrypt8full(c + i, (uint32_t *) n2, rkeys, m + i, accum, Hv, H2v, H3v, H4v, rev); \
577
+ aesni_encrypt8full(c + i, n2, rkeys, m + i, accum, Hv, H2v, H3v, H4v, rev); \
575
578
  } \
576
579
  } while(0)
577
580
 
@@ -585,7 +588,7 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen
585
588
  CRYPTO_ALIGN(16) unsigned char outni[8 * 16]; \
586
589
  unsigned long long mj = lb; \
587
590
  \
588
- aesni_encrypt8(outni, (uint32_t *) n2, rkeys); \
591
+ aesni_encrypt8(outni, n2, rkeys); \
589
592
  if ((i + mj) >= mlen) { \
590
593
  mj = mlen - i; \
591
594
  } \
@@ -603,7 +606,7 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen
603
606
  } \
604
607
  } while(0)
605
608
 
606
- n2[15] = 0;
609
+ n2[3] &= 0x00ffffff;
607
610
  COUNTER_INC2(n2);
608
611
  LOOPRND128;
609
612
  LOOPRMD128;
@@ -635,8 +638,8 @@ crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen
635
638
  unsigned long long adlen_rnd64 = adlen & ~63ULL;
636
639
  unsigned long long mlen;
637
640
  unsigned long long mlen_rnd128;
641
+ CRYPTO_ALIGN(16) uint32_t n2[4];
638
642
  CRYPTO_ALIGN(16) unsigned char H[16];
639
- CRYPTO_ALIGN(16) unsigned char n2[16];
640
643
  CRYPTO_ALIGN(16) unsigned char T[16];
641
644
  CRYPTO_ALIGN(16) unsigned char accum[16];
642
645
  CRYPTO_ALIGN(16) unsigned char fb[16];
@@ -653,13 +656,16 @@ crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen
653
656
  }
654
657
  mlen = clen - 16;
655
658
 
656
- memcpy(&n2[0], npub, 12);
657
- *(uint32_t *) &n2[12] = 0x01000000;
659
+ memcpy(&n2[0], npub, 3 * 4);
660
+ n2[3] = 0x01000000;
658
661
  aesni_encrypt1(T, _mm_load_si128((const __m128i *) n2), rkeys);
659
-
660
- (*(uint64_t *) &fb[0]) = _bswap64((uint64_t)(8 * adlen));
661
- (*(uint64_t *) &fb[8]) = _bswap64((uint64_t)(8 * mlen));
662
-
662
+ {
663
+ uint64_t x;
664
+ x = _bswap64((uint64_t)(8 * adlen));
665
+ memcpy(&fb[0], &x, sizeof x);
666
+ x = _bswap64((uint64_t)(8 * mlen));
667
+ memcpy(&fb[8], &x, sizeof x);
668
+ }
663
669
  memcpy(H, ctx->H, sizeof H);
664
670
  Hv = _mm_shuffle_epi8(_mm_load_si128((const __m128i *) H), rev);
665
671
  _mm_store_si128((__m128i *) H, Hv);
@@ -702,7 +708,7 @@ crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen
702
708
  const int lb = iter * 16; \
703
709
  \
704
710
  for (i = 0; i < mlen_rnd128; i += lb) { \
705
- aesni_decrypt8full(m + i, (uint32_t *) n2, rkeys, c + i); \
711
+ aesni_decrypt8full(m + i, n2, rkeys, c + i); \
706
712
  } \
707
713
  } while(0)
708
714
 
@@ -740,13 +746,13 @@ crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen
740
746
  if ((i + mj) >= mlen) { \
741
747
  mj = mlen - i; \
742
748
  } \
743
- aesni_encrypt8(outni, (uint32_t *) n2, rkeys); \
749
+ aesni_encrypt8(outni, n2, rkeys); \
744
750
  for (j = 0; j < mj; j++) { \
745
751
  m[i + j] = c[i + j] ^ outni[j]; \
746
752
  } \
747
753
  } \
748
754
  } while(0)
749
- n2[15] = 0;
755
+ n2[3] &= 0x00ffffff;
750
756
 
751
757
  COUNTER_INC2(n2);
752
758
  LOOPACCUMDRND128;
@@ -762,7 +768,7 @@ crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen
762
768
  return -1;
763
769
  }
764
770
  }
765
- *(uint32_t *) &n2[12] = 0;
771
+ n2[3] = 0U;
766
772
  COUNTER_INC2(n2);
767
773
  LOOPDRND128;
768
774
  LOOPDRMD128;
@@ -26,7 +26,6 @@
26
26
  *
27
27
  */
28
28
 
29
- #include "api.h"
30
29
  #include "crypto_auth_hmacsha256.h"
31
30
  #include "crypto_hash_sha256.h"
32
31
  #include "utils.h"
@@ -98,12 +97,12 @@ crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state,
98
97
  }
99
98
 
100
99
  int
101
- crypto_auth(unsigned char *out, const unsigned char *in,
102
- unsigned long long inlen, const unsigned char *k)
100
+ crypto_auth_hmacsha256(unsigned char *out, const unsigned char *in,
101
+ unsigned long long inlen, const unsigned char *k)
103
102
  {
104
103
  crypto_auth_hmacsha256_state state;
105
104
 
106
- crypto_auth_hmacsha256_init(&state, k, crypto_auth_KEYBYTES);
105
+ crypto_auth_hmacsha256_init(&state, k, crypto_auth_hmacsha256_KEYBYTES);
107
106
  crypto_auth_hmacsha256_update(&state, in, inlen);
108
107
  crypto_auth_hmacsha256_final(&state, out);
109
108
 
@@ -1,11 +1,11 @@
1
- #include "api.h"
1
+ #include "crypto_auth_hmacsha256.h"
2
2
  #include "crypto_verify_32.h"
3
3
  #include "utils.h"
4
4
 
5
- int crypto_auth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k)
5
+ int crypto_auth_hmacsha256_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k)
6
6
  {
7
7
  unsigned char correct[32];
8
- crypto_auth(correct,in,inlen,k);
8
+ crypto_auth_hmacsha256(correct,in,inlen,k);
9
9
  return crypto_verify_32(h,correct) | (-(h == correct)) |
10
10
  sodium_memcmp(correct,h,32);
11
11
  }
@@ -26,7 +26,6 @@
26
26
  *
27
27
  */
28
28
 
29
- #include "api.h"
30
29
  #include "crypto_auth_hmacsha512.h"
31
30
  #include "crypto_hash_sha512.h"
32
31
  #include "utils.h"
@@ -98,12 +97,12 @@ crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
98
97
  }
99
98
 
100
99
  int
101
- crypto_auth(unsigned char *out, const unsigned char *in,
102
- unsigned long long inlen, const unsigned char *k)
100
+ crypto_auth_hmacsha512(unsigned char *out, const unsigned char *in,
101
+ unsigned long long inlen, const unsigned char *k)
103
102
  {
104
103
  crypto_auth_hmacsha512_state state;
105
104
 
106
- crypto_auth_hmacsha512_init(&state, k, crypto_auth_KEYBYTES);
105
+ crypto_auth_hmacsha512_init(&state, k, crypto_auth_hmacsha512_KEYBYTES);
107
106
  crypto_auth_hmacsha512_update(&state, in, inlen);
108
107
  crypto_auth_hmacsha512_final(&state, out);
109
108
 
@@ -1,12 +1,12 @@
1
- #include "api.h"
1
+ #include "crypto_auth_hmacsha512.h"
2
2
  #include "crypto_verify_64.h"
3
3
  #include "utils.h"
4
4
 
5
- int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
6
- unsigned long long inlen, const unsigned char *k)
5
+ int crypto_auth_hmacsha512_verify(const unsigned char *h, const unsigned char *in,
6
+ unsigned long long inlen, const unsigned char *k)
7
7
  {
8
8
  unsigned char correct[64];
9
- crypto_auth(correct,in,inlen,k);
9
+ crypto_auth_hmacsha512(correct,in,inlen,k);
10
10
  return crypto_verify_64(h,correct) | (-(h == correct)) |
11
11
  sodium_memcmp(correct,h,64);
12
12
  }
@@ -1,5 +1,4 @@
1
1
 
2
- #include "api.h"
3
2
  #include "crypto_auth_hmacsha512256.h"
4
3
  #include "crypto_auth_hmacsha512.h"
5
4
  #include "crypto_hash_sha512.h"
@@ -41,12 +40,13 @@ crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state,
41
40
  }
42
41
 
43
42
  int
44
- crypto_auth(unsigned char *out, const unsigned char *in,
45
- unsigned long long inlen, const unsigned char *k)
43
+ crypto_auth_hmacsha512256(unsigned char *out, const unsigned char *in,
44
+ unsigned long long inlen, const unsigned char *k)
46
45
  {
47
46
  crypto_auth_hmacsha512256_state state;
48
47
 
49
- crypto_auth_hmacsha512256_init(&state, k, crypto_auth_KEYBYTES);
48
+ crypto_auth_hmacsha512256_init(&state, k,
49
+ crypto_auth_hmacsha512256_KEYBYTES);
50
50
  crypto_auth_hmacsha512256_update(&state, in, inlen);
51
51
  crypto_auth_hmacsha512256_final(&state, out);
52
52
 
@@ -1,12 +1,14 @@
1
- #include "api.h"
1
+ #include "crypto_auth_hmacsha512256.h"
2
2
  #include "crypto_verify_32.h"
3
3
  #include "utils.h"
4
4
 
5
- int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
6
- unsigned long long inlen, const unsigned char *k)
5
+ int crypto_auth_hmacsha512256_verify(const unsigned char *h,
6
+ const unsigned char *in,
7
+ unsigned long long inlen,
8
+ const unsigned char *k)
7
9
  {
8
10
  unsigned char correct[32];
9
- crypto_auth(correct,in,inlen,k);
11
+ crypto_auth_hmacsha512256(correct,in,inlen,k);
10
12
  return crypto_verify_32(h,correct) | (-(h == correct)) |
11
13
  sodium_memcmp(correct,h,32);
12
14
  }
@@ -26,7 +26,9 @@ crypto_box_detached(unsigned char *c, unsigned char *mac,
26
26
 
27
27
  (void) sizeof(int[crypto_box_BEFORENMBYTES >=
28
28
  crypto_secretbox_KEYBYTES ? 1 : -1]);
29
- crypto_box_beforenm(k, pk, sk);
29
+ if (crypto_box_beforenm(k, pk, sk) != 0) {
30
+ return -1;
31
+ }
30
32
  ret = crypto_box_detached_afternm(c, mac, m, mlen, n, k);
31
33
  sodium_memzero(k, sizeof k);
32
34
 
@@ -75,7 +77,9 @@ crypto_box_open_detached(unsigned char *m, const unsigned char *c,
75
77
  unsigned char k[crypto_box_BEFORENMBYTES];
76
78
  int ret;
77
79
 
78
- crypto_box_beforenm(k, pk, sk);
80
+ if (crypto_box_beforenm(k, pk, sk) != 0) {
81
+ return -1;
82
+ }
79
83
  ret = crypto_box_open_detached_afternm(m, c, mac, clen, n, k);
80
84
  sodium_memzero(k, sizeof k);
81
85
 
@@ -1,7 +1,7 @@
1
- #include "api.h"
1
+ #include "crypto_box_curve25519xsalsa20poly1305.h"
2
2
  #include "crypto_secretbox_xsalsa20poly1305.h"
3
3
 
4
- int crypto_box_afternm(
4
+ int crypto_box_curve25519xsalsa20poly1305_afternm(
5
5
  unsigned char *c,
6
6
  const unsigned char *m,unsigned long long mlen,
7
7
  const unsigned char *n,
@@ -11,7 +11,7 @@ int crypto_box_afternm(
11
11
  return crypto_secretbox_xsalsa20poly1305(c,m,mlen,n,k);
12
12
  }
13
13
 
14
- int crypto_box_open_afternm(
14
+ int crypto_box_curve25519xsalsa20poly1305_open_afternm(
15
15
  unsigned char *m,
16
16
  const unsigned char *c,unsigned long long clen,
17
17
  const unsigned char *n,
@@ -1,4 +1,4 @@
1
- #include "api.h"
1
+ #include "crypto_box_curve25519xsalsa20poly1305.h"
2
2
  #include "crypto_core_hsalsa20.h"
3
3
  #include "crypto_scalarmult_curve25519.h"
4
4
 
@@ -7,13 +7,15 @@ static const unsigned char sigma[16] = {
7
7
  };
8
8
  static const unsigned char n[16] = {0};
9
9
 
10
- int crypto_box_beforenm(
10
+ int crypto_box_curve25519xsalsa20poly1305_beforenm(
11
11
  unsigned char *k,
12
12
  const unsigned char *pk,
13
13
  const unsigned char *sk
14
14
  )
15
15
  {
16
16
  unsigned char s[32];
17
- crypto_scalarmult_curve25519(s,sk,pk);
17
+ if (crypto_scalarmult_curve25519(s,sk,pk) != 0) {
18
+ return -1;
19
+ }
18
20
  return crypto_core_hsalsa20(k,n,s,sigma);
19
21
  }
@@ -1,7 +1,7 @@
1
- #include "api.h"
1
+ #include "crypto_box_curve25519xsalsa20poly1305.h"
2
2
  #include "utils.h"
3
3
 
4
- int crypto_box(
4
+ int crypto_box_curve25519xsalsa20poly1305(
5
5
  unsigned char *c,
6
6
  const unsigned char *m,unsigned long long mlen,
7
7
  const unsigned char *n,
@@ -9,17 +9,19 @@ int crypto_box(
9
9
  const unsigned char *sk
10
10
  )
11
11
  {
12
- unsigned char k[crypto_box_BEFORENMBYTES];
12
+ unsigned char k[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES];
13
13
  int ret;
14
14
 
15
- crypto_box_beforenm(k,pk,sk);
16
- ret = crypto_box_afternm(c,m,mlen,n,k);
15
+ if (crypto_box_curve25519xsalsa20poly1305_beforenm(k,pk,sk) != 0) {
16
+ return -1;
17
+ }
18
+ ret = crypto_box_curve25519xsalsa20poly1305_afternm(c,m,mlen,n,k);
17
19
  sodium_memzero(k, sizeof k);
18
20
 
19
21
  return ret;
20
22
  }
21
23
 
22
- int crypto_box_open(
24
+ int crypto_box_curve25519xsalsa20poly1305_open(
23
25
  unsigned char *m,
24
26
  const unsigned char *c,unsigned long long clen,
25
27
  const unsigned char *n,
@@ -27,11 +29,13 @@ int crypto_box_open(
27
29
  const unsigned char *sk
28
30
  )
29
31
  {
30
- unsigned char k[crypto_box_BEFORENMBYTES];
32
+ unsigned char k[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES];
31
33
  int ret;
32
34
 
33
- crypto_box_beforenm(k,pk,sk);
34
- ret = crypto_box_open_afternm(m,c,clen,n,k);
35
+ if (crypto_box_curve25519xsalsa20poly1305_beforenm(k,pk,sk) != 0) {
36
+ return -1;
37
+ }
38
+ ret = crypto_box_curve25519xsalsa20poly1305_open_afternm(m,c,clen,n,k);
35
39
  sodium_memzero(k, sizeof k);
36
40
 
37
41
  return ret;
@@ -1,12 +1,12 @@
1
1
  #include <string.h>
2
2
 
3
+ #include "crypto_box_curve25519xsalsa20poly1305.h"
3
4
  #include "crypto_hash_sha512.h"
4
5
  #include "crypto_scalarmult_curve25519.h"
5
- #include "api.h"
6
6
  #include "randombytes.h"
7
7
  #include "utils.h"
8
8
 
9
- int crypto_box_seed_keypair(
9
+ int crypto_box_curve25519xsalsa20poly1305_seed_keypair(
10
10
  unsigned char *pk,
11
11
  unsigned char *sk,
12
12
  const unsigned char *seed
@@ -19,7 +19,7 @@ int crypto_box_seed_keypair(
19
19
  return crypto_scalarmult_curve25519_base(pk,sk);
20
20
  }
21
21
 
22
- int crypto_box_keypair(
22
+ int crypto_box_curve25519xsalsa20poly1305_keypair(
23
23
  unsigned char *pk,
24
24
  unsigned char *sk
25
25
  )
@@ -4,7 +4,7 @@ D. J. Bernstein
4
4
  Public domain.
5
5
  */
6
6
 
7
- #include "api.h"
7
+ #include "crypto_core_hsalsa20.h"
8
8
 
9
9
  #define ROUNDS 20
10
10
 
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
33
33
  x[3] = u;
34
34
  }
35
35
 
36
- int crypto_core(
36
+ int crypto_core_hsalsa20(
37
37
  unsigned char *out,
38
38
  const unsigned char *in,
39
39
  const unsigned char *k,
@@ -4,7 +4,7 @@ D. J. Bernstein
4
4
  Public domain.
5
5
  */
6
6
 
7
- #include "api.h"
7
+ #include "crypto_core_salsa20.h"
8
8
 
9
9
  #define ROUNDS 20
10
10
 
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
33
33
  x[3] = u;
34
34
  }
35
35
 
36
- int crypto_core(
36
+ int crypto_core_salsa20(
37
37
  unsigned char *out,
38
38
  const unsigned char *in,
39
39
  const unsigned char *k,
@@ -4,7 +4,7 @@ D. J. Bernstein
4
4
  Public domain.
5
5
  */
6
6
 
7
- #include "api.h"
7
+ #include "crypto_core_salsa2012.h"
8
8
 
9
9
  #define ROUNDS 12
10
10
 
@@ -33,7 +33,7 @@ static void store_littleendian(unsigned char *x,uint32 u)
33
33
  x[3] = u;
34
34
  }
35
35
 
36
- int crypto_core(
36
+ int crypto_core_salsa2012(
37
37
  unsigned char *out,
38
38
  const unsigned char *in,
39
39
  const unsigned char *k,