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
@@ -2,16 +2,18 @@
2
2
  #define TEST_NAME "core5"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char k[32]
5
+ static unsigned char k[32]
6
6
  = { 0xee, 0x30, 0x4f, 0xca, 0x27, 0x00, 0x8d, 0x8c, 0x12, 0x6f, 0x90,
7
7
  0x02, 0x79, 0x01, 0xd8, 0x0f, 0x7f, 0x1d, 0x8b, 0x8d, 0xc9, 0x36,
8
8
  0xcf, 0x3b, 0x9f, 0x81, 0x96, 0x92, 0x82, 0x7e, 0x57, 0x77 };
9
9
 
10
- unsigned char in[16] = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b,
11
- 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 };
10
+ static unsigned char in[16]
11
+ = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b,
12
+ 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 };
12
13
 
13
- unsigned char c[16] = { 101, 120, 112, 97, 110, 100, 32, 51,
14
- 50, 45, 98, 121, 116, 101, 32, 107 };
14
+ static unsigned char c[16]
15
+ = { 101, 120, 112, 97, 110, 100, 32, 51,
16
+ 50, 45, 98, 121, 116, 101, 32, 107 };
15
17
 
16
18
  unsigned char out[32];
17
19
 
@@ -2,18 +2,20 @@
2
2
  #define TEST_NAME "core6"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char k[32]
5
+ static unsigned char k[32]
6
6
  = { 0xee, 0x30, 0x4f, 0xca, 0x27, 0x00, 0x8d, 0x8c, 0x12, 0x6f, 0x90,
7
7
  0x02, 0x79, 0x01, 0xd8, 0x0f, 0x7f, 0x1d, 0x8b, 0x8d, 0xc9, 0x36,
8
8
  0xcf, 0x3b, 0x9f, 0x81, 0x96, 0x92, 0x82, 0x7e, 0x57, 0x77 };
9
9
 
10
- unsigned char in[16] = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b,
11
- 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 };
10
+ static unsigned char in[16]
11
+ = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b,
12
+ 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 };
12
13
 
13
- unsigned char c[16] = { 101, 120, 112, 97, 110, 100, 32, 51,
14
- 50, 45, 98, 121, 116, 101, 32, 107 };
14
+ static unsigned char c[16]
15
+ = { 101, 120, 112, 97, 110, 100, 32, 51,
16
+ 50, 45, 98, 121, 116, 101, 32, 107 };
15
17
 
16
- unsigned char out[64];
18
+ static unsigned char out[64];
17
19
 
18
20
  void print(unsigned char *x, unsigned char *y)
19
21
  {
@@ -1366,21 +1366,6 @@ main(void)
1366
1366
  printf("%02x", (unsigned int) out[j]);
1367
1367
  }
1368
1368
  printf("\n");
1369
-
1370
- memset(out, 0, sizeof out);
1371
- crypto_generichash(out, crypto_generichash_BYTES_MAX, in,
1372
- (unsigned long long) i, NULL, 1U);
1373
- for (j = 0; j < crypto_generichash_BYTES_MAX; ++j) {
1374
- printf("%02x", (unsigned int) out[j]);
1375
- }
1376
- printf("\n");
1377
-
1378
- assert(crypto_generichash(out, 0U, in, sizeof in, k, sizeof k) == -1);
1379
- assert(crypto_generichash(out, crypto_generichash_BYTES_MAX + 1U,
1380
- in, sizeof in, k, sizeof k) == -1);
1381
- assert(crypto_generichash(out, sizeof out, in, sizeof in,
1382
- k, crypto_generichash_KEYBYTES_MAX + 1U) == -1);
1383
-
1384
1369
  assert(crypto_generichash_bytes_min() > 0U);
1385
1370
  assert(crypto_generichash_bytes_max() > 0U);
1386
1371
  assert(crypto_generichash_bytes() > 0U);
@@ -63,4 +63,3 @@ cc66a891768e95a2717b040c111996f14942f10f2475c33aa5f1c97476e6f8386733d6b21c16102d
63
63
  bdd3d0fafe8ba2b29d1ac0b79aa46e249cc9d3a82d0f772d690637bbdd353722356658d00436ff5dd5239ab747979329345eb8c7ed11b7331456ae87350fcf
64
64
  bd965bf31e87d70327536f2a341cebc4768eca275fa05ef98f7f1b71a0351298de006fba73fe6733ed01d75801b4a928e54231b38e38c562b2e33ea1284992fa
65
65
  2fc6e69fa26a89a5ed269092cb9b2a449a4409a7a44011eecad13d7c4b0456602d402fa5844f1a7a758136ce3d5d8d0e8b86921ffff4f692dd95bdc8e5ff0052
66
- 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -77,8 +77,6 @@ main(void)
77
77
  &st, k, crypto_generichash_blake2b_KEYBYTES_MAX,
78
78
  crypto_generichash_blake2b_BYTES_MAX, salt, NULL);
79
79
  crypto_generichash_blake2b_update(&st, in, MAXLEN);
80
- assert(crypto_generichash_blake2b_final(
81
- &st, out, crypto_generichash_blake2b_BYTES_MAX + 1U) == -1);
82
80
  crypto_generichash_blake2b_final(
83
81
  &st, out, crypto_generichash_blake2b_BYTES_MAX);
84
82
  for (j = 0; j < crypto_generichash_blake2b_BYTES_MAX; ++j) {
@@ -98,7 +96,7 @@ main(void)
98
96
  memset(out, 0, sizeof out);
99
97
  crypto_generichash_blake2b_salt_personal(
100
98
  out, crypto_generichash_blake2b_BYTES_MAX, in, MAXLEN,
101
- NULL, crypto_generichash_blake2b_KEYBYTES_MAX, salt, personal);
99
+ NULL, 0U, salt, personal);
102
100
  for (j = 0; j < crypto_generichash_blake2b_BYTES_MAX; ++j) {
103
101
  printf("%02x", (unsigned int) out[j]);
104
102
  }
@@ -149,24 +147,6 @@ main(void)
149
147
  }
150
148
  printf("\n");
151
149
 
152
- assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, 0U,
153
- salt, personal) == -1);
154
- assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k,
155
- crypto_generichash_BYTES_MAX + 1U,
156
- salt, personal) == -1);
157
- assert(crypto_generichash_blake2b_init_salt_personal(&st, k,
158
- crypto_generichash_KEYBYTES_MAX + 1U,
159
- sizeof out, salt, personal) == -1);
160
-
161
- assert(crypto_generichash_blake2b_salt_personal(out, 0U, in, MAXLEN,
162
- k, sizeof k,
163
- salt, personal) == -1);
164
- assert(crypto_generichash_blake2b_salt_personal(out, crypto_generichash_BYTES_MAX + 1U,
165
- in, MAXLEN, k, sizeof k,
166
- salt, personal) == -1);
167
- assert(crypto_generichash_blake2b_salt_personal(out, sizeof out, in, MAXLEN,
168
- k, crypto_generichash_KEYBYTES_MAX + 1U,
169
- salt, personal) == -1);
170
150
  assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, crypto_generichash_BYTES,
171
151
  NULL, personal) == 0);
172
152
  assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, crypto_generichash_BYTES,
@@ -67,7 +67,7 @@ c6d6722a916651a8671383d8260873347d9c248696b4cb3dac4dea9ba57ed971127cb18e44211d7e
67
67
  5789f474edd5206ededaccfc35e7dd3ed730748125b5395abf802b2601126b19b109a1db67556945bc79bb25e1ab59610599d155070e0e04354f11a6a5d6f3ac
68
68
  e78efc663a5547c089f2b3b08973c974c4bfd365eac18b80c68bdb3b1ba4554b54d6b8465a68a3b9aa0bc020621f16efd5b8dd8c7c01ed9ee3ec5544aae465ff
69
69
  1afc8ec818bef0a479d2b4cac81d40a52cafa27f6d80c42fc23cbaf4141882ab59ab1101922fcb6e707ef2f61efd07cce5d09094e6bee420b1b96998c7cee96d
70
- 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
70
+ 1afc8ec818bef0a479d2b4cac81d40a52cafa27f6d80c42fc23cbaf4141882ab59ab1101922fcb6e707ef2f61efd07cce5d09094e6bee420b1b96998c7cee96d
71
71
  fb4e2ad6b7fe6afd2ba06d5c1d79379c5bf10e336a35c89a1aaf408a805171716e0635a5b1d18190131e15b6888510bcb3e3752b050f892a09dbbde60b051495
72
72
  5789f474edd5206ededaccfc35e7dd3ed730748125b5395abf802b2601126b19b109a1db67556945bc79bb25e1ab59610599d155070e0e04354f11a6a5d6f3ac
73
73
  e78efc663a5547c089f2b3b08973c974c4bfd365eac18b80c68bdb3b1ba4554b54d6b8465a68a3b9aa0bc020621f16efd5b8dd8c7c01ed9ee3ec5544aae465ff
@@ -2,9 +2,9 @@
2
2
  #define TEST_NAME "hash"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char x[] = "testing\n";
6
- unsigned char x2[] = "The Conscience of a Hacker is a small essay written January 8, 1986 by a computer security hacker who went by the handle of The Mentor, who belonged to the 2nd generation of Legion of Doom.";
7
- unsigned char h[crypto_hash_BYTES];
5
+ static unsigned char x[] = "testing\n";
6
+ static unsigned char x2[] = "The Conscience of a Hacker is a small essay written January 8, 1986 by a computer security hacker who went by the handle of The Mentor, who belonged to the 2nd generation of Legion of Doom.";
7
+ static unsigned char h[crypto_hash_BYTES];
8
8
 
9
9
  int main(void)
10
10
  {
@@ -2,8 +2,8 @@
2
2
  #define TEST_NAME "hash3"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char x[] = "testing\n";
6
- unsigned char h[crypto_hash_BYTES];
5
+ static unsigned char x[] = "testing\n";
6
+ static unsigned char h[crypto_hash_BYTES];
7
7
 
8
8
  int main(void)
9
9
  {
@@ -0,0 +1,84 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <style>
5
+ <meta name="google" content="notranslate" />
6
+ body {
7
+ background: white;
8
+ color: black;
9
+ }
10
+ .test p {
11
+ margin: 1px;
12
+ }
13
+ .test {
14
+ font-family: monospace;
15
+ white-space: pre;
16
+ }
17
+ .err {
18
+ background: red;
19
+ color: white;
20
+ }
21
+ .passed {
22
+ background: green;
23
+ color: white;
24
+ }
25
+ </style>
26
+ </head>
27
+ <body>
28
+ <h1></h1>
29
+ <section class="test" id="test-res"></section>
30
+ <script>
31
+ function runTest(tname) {
32
+ var xhr, expected, hn, idx = 0, passed = true;
33
+
34
+ function outputReceived(e) {
35
+ var found = e.data;
36
+ var p = document.createElement('p');
37
+ if (found !== expected[idx++]) {
38
+ p.className = 'err';
39
+ passed = false;
40
+ }
41
+ p.appendChild(document.createTextNode(found));
42
+ document.getElementById('test-res').appendChild(p);
43
+ if (idx >= expected.length) {
44
+ if (passed) {
45
+ hn.appendChild(document.createTextNode(' - PASSED'));
46
+ hn.className = 'passed';
47
+ } else {
48
+ hn.appendChild(document.createTextNode(' - FAILED'));
49
+ hn.className = 'err';
50
+ }
51
+ }
52
+ }
53
+
54
+ hn = document.getElementsByTagName('h1')[0];
55
+ hn.appendChild(document.createTextNode('Test: ' + tname));
56
+
57
+ try {
58
+ xhr = new ActiveXObject('Microsoft.XMLHTTP');
59
+ } catch (e) {
60
+ xhr = new XMLHttpRequest();
61
+ }
62
+ xhr.open('GET', tname + '.exp');
63
+ xhr.onreadystatechange = function() {
64
+ if (xhr.readyState != 4 ||
65
+ (xhr.status != 200 && xhr.status != 302 && xhr.status != 0)) {
66
+ return;
67
+ }
68
+ expected = xhr.responseText.split('\n');
69
+ if (expected.length > 0 && expected[expected.length - 1] === '') {
70
+ expected.pop();
71
+ }
72
+ expected.push('--- SUCCESS ---');
73
+ window.addEventListener('test-output', outputReceived, false);
74
+ var s = document.getElementsByTagName('script')[0];
75
+ var st = document.createElement('script');
76
+ st.src = tname + '.js';
77
+ s.parentNode.insertBefore(st, s);
78
+ }
79
+ xhr.send(null);
80
+ }
81
+ runTest('{{tname}}');
82
+ </script>
83
+ </body>
84
+ </html>
@@ -2,12 +2,12 @@
2
2
  #define TEST_NAME "onetimeauth"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char rs[32]
5
+ static unsigned char rs[32]
6
6
  = { 0xee, 0xa6, 0xa7, 0x25, 0x1c, 0x1e, 0x72, 0x91, 0x6d, 0x11, 0xc2,
7
7
  0xcb, 0x21, 0x4d, 0x3c, 0x25, 0x25, 0x39, 0x12, 0x1d, 0x8e, 0x23,
8
8
  0x4e, 0x65, 0x2d, 0x65, 0x1f, 0xa4, 0xc8, 0xcf, 0xf8, 0x80 };
9
9
 
10
- unsigned char c[131]
10
+ static unsigned char c[131]
11
11
  = { 0x8e, 0x99, 0x3b, 0x9f, 0x48, 0x68, 0x12, 0x73, 0xc2, 0x96, 0x50, 0xba,
12
12
  0x32, 0xfc, 0x76, 0xce, 0x48, 0x33, 0x2e, 0xa7, 0x16, 0x4d, 0x96, 0xa4,
13
13
  0x47, 0x6f, 0xb8, 0xc5, 0x31, 0xa1, 0x18, 0x6a, 0xc0, 0xdf, 0xc1, 0x7c,
@@ -20,7 +20,7 @@ unsigned char c[131]
20
20
  0x88, 0xd5, 0xf9, 0xb3, 0x79, 0x73, 0xf6, 0x22, 0xa4, 0x3d, 0x14, 0xa6,
21
21
  0x59, 0x9b, 0x1f, 0x65, 0x4c, 0xb4, 0x5a, 0x74, 0xe3, 0x55, 0xa5 };
22
22
 
23
- unsigned char a[16];
23
+ static unsigned char a[16];
24
24
 
25
25
  int main(void)
26
26
  {
@@ -2,12 +2,12 @@
2
2
  #define TEST_NAME "onetimeauth2"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char rs[32]
5
+ static unsigned char rs[32]
6
6
  = { 0xee, 0xa6, 0xa7, 0x25, 0x1c, 0x1e, 0x72, 0x91, 0x6d, 0x11, 0xc2,
7
7
  0xcb, 0x21, 0x4d, 0x3c, 0x25, 0x25, 0x39, 0x12, 0x1d, 0x8e, 0x23,
8
8
  0x4e, 0x65, 0x2d, 0x65, 0x1f, 0xa4, 0xc8, 0xcf, 0xf8, 0x80 };
9
9
 
10
- unsigned char c[131]
10
+ static unsigned char c[131]
11
11
  = { 0x8e, 0x99, 0x3b, 0x9f, 0x48, 0x68, 0x12, 0x73, 0xc2, 0x96, 0x50, 0xba,
12
12
  0x32, 0xfc, 0x76, 0xce, 0x48, 0x33, 0x2e, 0xa7, 0x16, 0x4d, 0x96, 0xa4,
13
13
  0x47, 0x6f, 0xb8, 0xc5, 0x31, 0xa1, 0x18, 0x6a, 0xc0, 0xdf, 0xc1, 0x7c,
@@ -20,8 +20,9 @@ unsigned char c[131]
20
20
  0x88, 0xd5, 0xf9, 0xb3, 0x79, 0x73, 0xf6, 0x22, 0xa4, 0x3d, 0x14, 0xa6,
21
21
  0x59, 0x9b, 0x1f, 0x65, 0x4c, 0xb4, 0x5a, 0x74, 0xe3, 0x55, 0xa5 };
22
22
 
23
- unsigned char a[16] = { 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5,
24
- 0x2a, 0x7d, 0xfb, 0x4b, 0x3d, 0x33, 0x05, 0xd9 };
23
+ static unsigned char a[16]
24
+ = { 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5,
25
+ 0x2a, 0x7d, 0xfb, 0x4b, 0x3d, 0x33, 0x05, 0xd9 };
25
26
 
26
27
  int main(void)
27
28
  {
@@ -2,15 +2,15 @@
2
2
  #define TEST_NAME "onetimeauth7"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char key[32];
6
- unsigned char c[10000];
7
- unsigned char a[16];
5
+ static unsigned char key[32];
6
+ static unsigned char c[1000];
7
+ static unsigned char a[16];
8
8
 
9
9
  int main(void)
10
10
  {
11
11
  int clen;
12
12
 
13
- for (clen = 0; clen < 10000; ++clen) {
13
+ for (clen = 0; clen < 1000; ++clen) {
14
14
  randombytes_buf(key, sizeof key);
15
15
  randombytes_buf(c, clen);
16
16
  crypto_onetimeauth(a, c, clen, key);
@@ -4,9 +4,17 @@ try {
4
4
  } catch(e) {
5
5
  this['Module'] = Module = {};
6
6
  }
7
- Module['preRun'] = Module['preRun'] || [];
8
- Module['preRun'].push(function(){
9
- FS.init();
10
- FS.mkdir('/test-data');
11
- FS.mount(NODEFS, { root: '.' }, '/test-data');
12
- });
7
+ if (typeof process === 'object') {
8
+ Module['preRun'] = Module['preRun'] || [];
9
+ Module['preRun'].push(function() {
10
+ FS.init();
11
+ FS.mkdir('/test-data');
12
+ FS.mount(NODEFS, { root: '.' }, '/test-data');
13
+ });
14
+ } else {
15
+ Module['print'] = function(x) {
16
+ var event = new Event('test-output');
17
+ event.data = x;
18
+ window.dispatchEvent(event);
19
+ };
20
+ }
@@ -2,8 +2,8 @@
2
2
  #define TEST_NAME "randombytes"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char x[65536];
6
- unsigned long long freq[256];
5
+ static unsigned char x[65536];
6
+ static unsigned long long freq[256];
7
7
 
8
8
  static int compat_tests(void)
9
9
  {
@@ -2,17 +2,22 @@
2
2
  #define TEST_NAME "scalarmult"
3
3
  #include "cmptest.h"
4
4
 
5
- const unsigned char alicesk[crypto_scalarmult_BYTES]
5
+ static const unsigned char alicesk[crypto_scalarmult_BYTES]
6
6
  = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1,
7
7
  0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0,
8
8
  0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a };
9
9
 
10
- const unsigned char bobsk[crypto_scalarmult_BYTES]
10
+ static const unsigned char bobsk[crypto_scalarmult_BYTES]
11
11
  = { 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, 0x79, 0xe1, 0x7f,
12
12
  0x8b, 0x83, 0x80, 0x0e, 0xe6, 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18,
13
13
  0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb };
14
14
 
15
- char hex[crypto_scalarmult_BYTES * 2 + 1];
15
+ static const unsigned char small_order_p[crypto_scalarmult_BYTES]
16
+ = { 0xe0, 0xeb, 0x7a, 0x7c, 0x3b, 0x41, 0xb8, 0xae, 0x16, 0x56, 0xe3,
17
+ 0xfa, 0xf1, 0x9f, 0xc4, 0x6a, 0xda, 0x09, 0x8d, 0xeb, 0x9c, 0x32,
18
+ 0xb1, 0xfd, 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x00 };
19
+
20
+ static char hex[crypto_scalarmult_BYTES * 2 + 1];
16
21
 
17
22
  int main(void)
18
23
  {
@@ -22,6 +27,7 @@ int main(void)
22
27
  (unsigned char *) sodium_malloc(crypto_scalarmult_BYTES);
23
28
  unsigned char *k =
24
29
  (unsigned char *) sodium_malloc(crypto_scalarmult_BYTES);
30
+ int ret;
25
31
 
26
32
  assert(alicepk != NULL && bobpk != NULL && k != NULL);
27
33
 
@@ -33,17 +39,24 @@ int main(void)
33
39
  sodium_bin2hex(hex, sizeof hex, bobpk, crypto_scalarmult_BYTES);
34
40
  printf("%s\n", hex);
35
41
 
36
- crypto_scalarmult(k, alicesk, bobpk);
42
+ ret = crypto_scalarmult(k, alicesk, bobpk);
43
+ assert(ret == 0);
37
44
  sodium_bin2hex(hex, sizeof hex, k, crypto_scalarmult_BYTES);
38
45
  printf("%s\n", hex);
39
46
 
40
- crypto_scalarmult(k, bobsk, alicepk);
47
+ ret = crypto_scalarmult(k, bobsk, alicepk);
48
+ assert(ret == 0);
49
+ sodium_bin2hex(hex, sizeof hex, k, crypto_scalarmult_BYTES);
50
+ printf("%s\n", hex);
51
+
52
+ ret = crypto_scalarmult(k, bobsk, small_order_p);
53
+ assert(ret == -1);
41
54
  sodium_bin2hex(hex, sizeof hex, k, crypto_scalarmult_BYTES);
42
55
  printf("%s\n", hex);
43
56
 
44
- sodium_free(k);
45
57
  sodium_free(bobpk);
46
58
  sodium_free(alicepk);
59
+ sodium_free(k);
47
60
 
48
61
  assert(crypto_scalarmult_bytes() > 0U);
49
62
  assert(crypto_scalarmult_scalarbytes() > 0U);
@@ -2,3 +2,4 @@
2
2
  de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f
3
3
  4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742
4
4
  4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742
5
+ 0000000000000000000000000000000000000000000000000000000000000000
@@ -2,12 +2,12 @@
2
2
  #define TEST_NAME "scalarmult2"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char bobsk[32]
5
+ static unsigned char bobsk[32]
6
6
  = { 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, 0x79, 0xe1, 0x7f,
7
7
  0x8b, 0x83, 0x80, 0x0e, 0xe6, 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18,
8
8
  0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb };
9
9
 
10
- unsigned char bobpk[32];
10
+ static unsigned char bobpk[32];
11
11
 
12
12
  int main(void)
13
13
  {
@@ -2,23 +2,25 @@
2
2
  #define TEST_NAME "scalarmult5"
3
3
  #include "cmptest.h"
4
4
 
5
- unsigned char alicesk[32]
5
+ static unsigned char alicesk[32]
6
6
  = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1,
7
7
  0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0,
8
8
  0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a };
9
9
 
10
- unsigned char bobpk[32]
10
+ static unsigned char bobpk[32]
11
11
  = { 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3, 0x5b, 0x61,
12
12
  0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78,
13
13
  0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f };
14
14
 
15
- unsigned char k[32];
15
+ static unsigned char k[32];
16
16
 
17
17
  int main(void)
18
18
  {
19
19
  int i;
20
+ int ret;
20
21
 
21
- crypto_scalarmult(k, alicesk, bobpk);
22
+ ret = crypto_scalarmult(k, alicesk, bobpk);
23
+ assert(ret == 0);
22
24
 
23
25
  for (i = 0; i < 32; ++i) {
24
26
  if (i > 0) {