rbnacl-libsodium 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +23 -0
  3. data/CHANGES.md +5 -0
  4. data/Gemfile +5 -2
  5. data/Rakefile +5 -0
  6. data/ext/rbnacl/extconf.rb +2 -1
  7. data/lib/rbnacl/libsodium.rb +8 -2
  8. data/lib/rbnacl/libsodium/version.rb +1 -1
  9. data/vendor/libsodium/AUTHORS +14 -0
  10. data/vendor/libsodium/ChangeLog +26 -0
  11. data/vendor/libsodium/LICENSE +1 -1
  12. data/vendor/libsodium/Makefile.am +1 -0
  13. data/vendor/libsodium/Makefile.in +9 -0
  14. data/vendor/libsodium/README.markdown +7 -0
  15. data/vendor/libsodium/aclocal.m4 +1 -0
  16. data/vendor/libsodium/appveyor.yml +25 -0
  17. data/vendor/libsodium/autom4te.cache/output.1 +640 -126
  18. data/vendor/libsodium/autom4te.cache/output.6 +19049 -0
  19. data/vendor/libsodium/autom4te.cache/requests +1151 -914
  20. data/vendor/libsodium/autom4te.cache/traces.1 +472 -426
  21. data/vendor/libsodium/autom4te.cache/traces.6 +3193 -0
  22. data/vendor/libsodium/builds/msvc/version.h +2 -2
  23. data/vendor/libsodium/builds/msvc/vs2010/libsodium.sln +50 -79
  24. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +20 -8
  25. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +208 -166
  26. data/vendor/libsodium/builds/msvc/vs2012/libsodium.sln +50 -79
  27. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +20 -8
  28. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +206 -164
  29. data/vendor/libsodium/builds/msvc/vs2013/libsodium.sln +52 -81
  30. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +20 -8
  31. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +206 -164
  32. data/vendor/libsodium/builds/msvc/vs2015/libsodium.sln +52 -81
  33. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +20 -8
  34. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +206 -164
  35. data/vendor/libsodium/configure +639 -125
  36. data/vendor/libsodium/configure.ac +94 -16
  37. data/vendor/libsodium/dist-build/Makefile.in +9 -0
  38. data/vendor/libsodium/dist-build/emscripten-symbols.def +370 -0
  39. data/vendor/libsodium/dist-build/emscripten.sh +9 -3
  40. data/vendor/libsodium/dist-build/generate-emscripten-symbols.sh +43 -0
  41. data/vendor/libsodium/libsodium-uninstalled.pc.in +1 -1
  42. data/vendor/libsodium/libsodium.pc.in +1 -1
  43. data/vendor/libsodium/libsodium.vcxproj +70 -66
  44. data/vendor/libsodium/libsodium.vcxproj.filters +204 -192
  45. data/vendor/libsodium/m4/ax_valgrind_check.m4 +190 -0
  46. data/vendor/libsodium/msvc-scripts/Makefile.in +9 -0
  47. data/vendor/libsodium/msvc-scripts/process.bat +2 -2
  48. data/vendor/libsodium/src/Makefile.in +9 -0
  49. data/vendor/libsodium/src/libsodium/Makefile.am +31 -6
  50. data/vendor/libsodium/src/libsodium/Makefile.in +238 -42
  51. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +234 -38
  52. data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +208 -118
  53. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_seal.c +2 -2
  54. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c +1 -4
  55. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +1799 -1790
  56. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.h +39 -39
  57. data/vendor/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c +86 -0
  58. data/vendor/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.h +28 -0
  59. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20.c +38 -46
  60. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/core_salsa20.c +47 -55
  61. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/core_salsa2012.c +47 -55
  62. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/core_salsa208.c +47 -55
  63. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c +7 -0
  64. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2-impl.h +0 -89
  65. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +50 -141
  66. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-avx2.c +45 -0
  67. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-avx2.h +123 -0
  68. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-ref.c +3 -2
  69. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-sse41.c +2 -2
  70. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/{blake2b-round.h → blake2b-compress-sse41.h} +2 -28
  71. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-ssse3.c +2 -4
  72. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-compress-ssse3.h +97 -0
  73. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-load-avx2.h +339 -0
  74. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-load-sse2.h +0 -2
  75. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-load-sse41.h +0 -2
  76. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +29 -18
  77. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +4 -43
  78. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512.c +3 -32
  79. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +1 -20
  80. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +22 -41
  81. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +12 -39
  82. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +2 -4
  83. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h +1 -20
  84. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c +570 -0
  85. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h +198 -0
  86. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c +444 -0
  87. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h +32 -0
  88. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +229 -0
  89. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +222 -0
  90. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-impl.h +40 -0
  91. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +238 -0
  92. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h +251 -0
  93. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c +80 -0
  94. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.h +8 -0
  95. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h +38 -0
  96. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h +117 -0
  97. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +164 -0
  98. data/vendor/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c +106 -0
  99. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +1 -1
  100. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +4 -4
  101. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +186 -186
  102. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +2 -2
  103. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +3 -2
  104. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c +33 -33
  105. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +253 -254
  106. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c +16 -17
  107. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h +1 -0
  108. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +11 -11
  109. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h +1 -0
  110. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h +1 -1
  111. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h +3 -2
  112. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h +5 -3
  113. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +41 -41
  114. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S +10 -2
  115. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h +1 -1
  116. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +4 -0
  117. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +4 -0
  118. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +31 -32
  119. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +4 -0
  120. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h +1 -1
  121. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S +4 -0
  122. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h +1 -1
  123. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h +1 -1
  124. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h +1 -1
  125. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +2 -6
  126. data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24.c +8 -28
  127. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +75 -0
  128. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +6 -6
  129. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common.h +1 -18
  130. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128_aes128ctr.c +20 -20
  131. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/types.h +4 -4
  132. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +6 -6
  133. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +56 -77
  134. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.h +1 -0
  135. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.h +1 -0
  136. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +2 -8
  137. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +2 -8
  138. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +2 -8
  139. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +2 -8
  140. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +2 -8
  141. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +2 -8
  142. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c +1 -5
  143. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c +1 -5
  144. data/vendor/libsodium/src/libsodium/include/Makefile.am +3 -0
  145. data/vendor/libsodium/src/libsodium/include/Makefile.in +19 -8
  146. data/vendor/libsodium/src/libsodium/include/sodium.h +3 -0
  147. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +50 -0
  148. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +94 -22
  149. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +6 -6
  150. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_hchacha20.h +35 -0
  151. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +3 -0
  152. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash.h +89 -0
  153. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +86 -0
  154. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +6 -6
  155. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +0 -11
  156. data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +3 -0
  157. data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +3 -0
  158. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +5 -1
  159. data/vendor/libsodium/src/libsodium/sodium/common.h +150 -0
  160. data/vendor/libsodium/src/libsodium/sodium/core.c +3 -1
  161. data/vendor/libsodium/src/libsodium/sodium/runtime.c +37 -19
  162. data/vendor/libsodium/src/libsodium/sodium/utils.c +18 -9
  163. data/vendor/libsodium/test/Makefile.in +9 -0
  164. data/vendor/libsodium/test/default/Makefile.am +10 -0
  165. data/vendor/libsodium/test/default/Makefile.in +53 -20
  166. data/vendor/libsodium/test/default/aead_aes256gcm.c +43 -17
  167. data/vendor/libsodium/test/default/aead_chacha20poly1305.c +179 -86
  168. data/vendor/libsodium/test/default/auth7.c +5 -5
  169. data/vendor/libsodium/test/default/box.c +4 -4
  170. data/vendor/libsodium/test/default/box2.c +1 -1
  171. data/vendor/libsodium/test/default/core6.c +1 -1
  172. data/vendor/libsodium/test/default/generichash.c +12 -1
  173. data/vendor/libsodium/test/default/generichash2.c +2 -2
  174. data/vendor/libsodium/test/default/generichash3.c +21 -0
  175. data/vendor/libsodium/test/default/pwhash.c +186 -168
  176. data/vendor/libsodium/test/default/pwhash.exp +11 -30
  177. data/vendor/libsodium/test/default/pwhash_scrypt.c +349 -0
  178. data/vendor/libsodium/test/default/pwhash_scrypt.exp +31 -0
  179. data/vendor/libsodium/test/default/secretbox.c +1 -1
  180. data/vendor/libsodium/test/default/secretbox2.c +1 -1
  181. data/vendor/libsodium/test/default/sign.c +15 -0
  182. data/vendor/libsodium/test/default/sodium_utils2.c +8 -3
  183. data/vendor/libsodium/test/default/sodium_utils3.c +4 -2
  184. data/vendor/libsodium/test/default/verify1.c +0 -4
  185. data/vendor/libsodium/test/quirks/quirks.h +3 -0
  186. metadata +37 -22
  187. data/vendor/libsodium/builds/msvc/vs2010/test/test.props +0 -43
  188. data/vendor/libsodium/builds/msvc/vs2010/test/test.runner.bat +0 -78
  189. data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj +0 -244
  190. data/vendor/libsodium/builds/msvc/vs2010/test/test.vcxproj.filters +0 -192
  191. data/vendor/libsodium/builds/msvc/vs2012/test/test.props +0 -43
  192. data/vendor/libsodium/builds/msvc/vs2012/test/test.runner.bat +0 -78
  193. data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj +0 -244
  194. data/vendor/libsodium/builds/msvc/vs2012/test/test.vcxproj.filters +0 -192
  195. data/vendor/libsodium/builds/msvc/vs2013/test/test.props +0 -43
  196. data/vendor/libsodium/builds/msvc/vs2013/test/test.runner.bat +0 -78
  197. data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj +0 -244
  198. data/vendor/libsodium/builds/msvc/vs2013/test/test.vcxproj.filters +0 -192
  199. data/vendor/libsodium/builds/msvc/vs2015/test/test.props +0 -43
  200. data/vendor/libsodium/builds/msvc/vs2015/test/test.runner.bat +0 -78
  201. data/vendor/libsodium/builds/msvc/vs2015/test/test.vcxproj +0 -244
  202. data/vendor/libsodium/builds/msvc/vs2015/test/test.vcxproj.filters +0 -192
  203. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sysendian.h +0 -146
  204. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common_aes128ctr.c +0 -64
@@ -1,31 +1,12 @@
1
- 8d40f5f8c6a1791204f03e19a98cd74f918b6e331b39cfc2415e5014d7738b7bb0a83551fb14a035e07fdd4dc0c60c1a6822ac253918979f6324ff0c87cba75d3b91f88f41ca5414a0f152bdc4d636f42ab2250afd058c19ec31a3374d1bd7133289bf21513ff67cbf8482e626aee9864c58fd05f9ea02e508a10182b7d838157119866f072004987ef6c56683ed207705923921af9d76444a331a
2
- d985d4c278343a46d82af0c4268b7ae6b6d1d2dd289675ef45bfb6d0648bffe5bab8c91228f3a31b091154a9c1142670a07b92e70a298333066de07db9300e046fd7cacc99780804683df7babdfc9d019047178400b2875bde0a1ad824dda7a422d9ed48475af9a3876378dd3a2f206e34984e223afb82c0c1e4644c9a458f4666379fdd3e2d9206d87e3c32c3977f35826a27590baaa1ec1a3bd7d15a92bc84c95dcfc56c14fca7c4c9810162dfdf9dc08a191e79fe40250b7e07d3a9317d9a5cb56e1062c419a6cd6a9b73128e8ad79ab7efffbb3cc52c1f49f86d2ebb46e6e4846aecdb14c2d046f5380517ff8cc794e4a772a58b93083dad
3
- ee7e9e1369267ec555981f0ea088ff6f93953abfcb767d88ec3c46393d24cfbaba5e4e26e0f35b5d5259647748476d65cd8881c96f8cda049d9c877b2d33d932e67f4c0df2cb434b4b4900e0c49c3f8ba9663795420577e65d0b456201ad9162fbc485c7b44f2b34e6673aa3692c123021ee3b624c3bb22b808b89613d8ecc7b87da47f57152eb3f7b10ad206f6b09cb6935b347b5e42bc3b8c9c9bcd8d7b7c44929b367fc279dec48ea78e6ee3e2620d7459700bd0aedb1c9aa5a323ca94403927f5e5c2b73bda7c5c3287b62fe51874cfeb1dc3151cd886b26d83ece68833229d2d432798c602d85b0505947207d8430febbe901164b12ce
4
- 1828b82997
5
- bcc5c2fd785e4781d1201ed43d84925537e2a540d3de55f5812f29e9dd0a4a00451a5c8ddbb4862c03d45c75bf91b7fb49265feb667ad5c899fdbf2ca19eac67aa5e48595d5b02f8183ab07f71b1ce0d76e5df54919f63810ad0893ded7d1ca18fc956ec06ffd4c3d1f77a00ed53608947b25eea5df6bea02272be15815f974c321a2a9208674fdf59d1d798c2a12f1889df68b0c222b37ee9ef0d6391fc160b0281ec53073cb3a3706ce1d71c3af2f5237a1b3d8545d99012eecc0b4abb
6
- 82765c040c58c1810f8c053ef5c248556299385476bde44bdd91a0d9a239f24e9b1717fd8b23209ffa45b7aa7937296c601b79e77da99e8d2fda0ea4459be2d0900f5bc5a269b5488d873d4632d1baf75965e509ee24b12501a9ce3bbbd8b7d759987d545a1c221a363195e5802d768b3b9e00ebe5ac0ed8ad2362c1c4157b910a40f94adf2561a2b0d3e65dbb06f244e5ac44d362103df54c9b9175777b3db1cdadb03e977ab8a79baf1e1e18ec9f5d0f25c487ddc53d7e81910f83576b44e9caeece26e2eb376569ad3a8cdccbde8bc355210e
7
- ca9216d4127e2e4a6ee3584b49be106217bb61cc807016d46d0cfbb1fd722e2bbac33541386bdfeac41a299ead22790993fcaa8e1d23bd1c8426afa5ff4c08e731dc476ef834f142c32dfb2c1be12b9978802e63b2cd6f226b1a8df59f0c79154d7ef4296a68ec654538d987104f9a11aca1b7c83ab2ed8fd69da6b88f0bcbd27d3fea01329cecf10c57ec3ba163d57b38801bd6c3b31ce527b33717bb56a46f78fb96be9f2424a21b3284232388cbba6a74
8
- 2732a7566023c8db90a5fdd08dbe6c1b5e70c046d50c5735c8d86a589ba177f69db12d6cc3596319fa27c9e063ed05b8a31970a07dc905
9
- d7b1ef464be03ce9050b5108e25f0b8e821299986fe0ff89e17fbae65ba9fad167fbd265866ac03efc86ab0b50d46d6740a59adf5949b44f7f9f3ac3f3d4cc9f128966db9099deb1b6b78505242b2401a193820408eb0780b27162ebafb7c505b0e7c32ce66c6efc0be487008c1201454680498a2fc06e00b454e0b20933906bbb0e43b399b9ee46d882f107df1ebdd1e7cd867c9cdba6015b7e80064ae8b3417d969524bec046e782a13b125f058cd36b5d1ae65886ae7caab45a6d98651ada435b8ee11d5c1224232f5f515df974138dd6cf347b730481d4b073af8ff0394fe9f0b8cdfd99f5
10
- 1839be14287053bfcd4ea60db82777fad1a6e9535c388b770743e61235449e668717199defd516c438b3ebd79b3529eb32482ef414525292ea1bbec09da10790a2330a4399f2fe6dd63d80954e3c547a5f1c619db5a30bde495b23f2214b4fa7572851d75246f2817775f0b521acc6efbc7832c9a76de7465e3c65cade88e86c973f85a882bb54f92b983977c6e937c88f083ba68c70fb49497065b158e2e789809b1d4cc9ec2d
11
- d54916748076b9d9f72198c8fbef563462dc8c706e1ad38abd1fac570016721acd0a7659ab49a47299a996b43597690c0c947143069f35d83e606273dbf2d622321393949b8ed5a68315362c4f84804384d05e0e0e86bc00e3641233f9f975ab46b60ba185c5e5fe47f78efd207e69fd8f6390730828b93b9b3763ea1283caa03bc36726763715de811915681dd214524f5ad4dd386608cac6c7f2
12
- d54916748076b9d9f72198c8fbef563462dc8c706e1ad38abd1fac570016721acd0a7659ab49a47299a996b43597690c0c947143069f35d83e606273dbf2d622321393949b8ed5a68315362c4f84804384d05e0e0e86bc00e3641233f9f975ab46b60ba185c5e5fe47f78efd207e69fd8f6390730828b93b9b3763ea1283caa03bc36726763715de811915681dd214524f5ad4dd386608cac6c7f2
13
- pwhash_str failure: [10]
14
- pwhash_str failure: [11]
15
- pwhash_str failure: [12]
16
- pwhash_str failure: [13]
17
- pwhash_str failure: [14]
18
- pwhash_str failure: [15]
19
- pwhash_str failure: [16]
20
- pwhash_str failure: [17]
21
- pwhash_str failure: [18]
22
- pwhash_str failure: [19]
23
- pwhash_str failure: [20]
24
- pwhash_str failure: [21]
25
- pwhash_str failure: [22]
26
- pwhash_str failure: [23]
27
- pwhash_str failure: [24]
28
- pwhash_str failure: [25]
29
- pwhash_str failure: [26]
30
- pwhash_str failure: [27]
1
+ 23b803c84eaa25f4b44634cc1e5e37792c53fcd9b1eb20f865329c68e09cbfa9f1968757901b383fce221afe27713f97914a041395bbe1fb70e079e5bed2c7145b1f6154046f5958e9b1b29055454e264d1f2231c316f26be2e3738e83a80315e9a0951ce4b137b52e7d5ee7b37f7d936dcee51362bcf792595e3c896ad5042734fc90c92cae572ce63ff659a2f7974a3bd730d04d525d253ccc38
2
+ 0bb3769b064b9c43a9460476ab38c4a9a2470d55d4c992c6e723af895e4c07c09af41f22f90eab583a0c362d177f4677f212482fd145bfb9ac6211635e48461122bb49097b5fb0739d2cd22a39bf03d268e7495d4fd8d710aa156202f0a06e932ff513e6e7c76a4e98b6df5cf922f124791b1076ad904e6897271f5d7d24c5929e2a3b836d0f2f2697c2d758ee79bf1264f3fae65f3744e0f6d7d07ef6e8b35b70c0f88e9036325bfb24ac7f550351486da87aef10d6b0cb77d1cf6e31cf98399c6f241c605c6530dffb4764784f6c0b0bf601d4e4431e8b18dabdc3079c6e264302ade79f61cbd5497c95486340bb891a737223100be0429650
3
+ e9aa073b0b872f15c083d1d7ce52c09f493b827ca78f13a06c1721b45b1e17b24c04e19fe869333135360197a7eb55994fee3e8d9680aedfdf7674f3ad7b84d59d7eab03579ffc10c7093093bc48ec84252aa1b30f40f5e838f1443e15e2772a39f4e774eb052097e8881e94f15457b779fa2af2bbc9a993687657c7704ac8a37c25c1df4289eb4c70da45f2fd46bc0f78259767d3dd478a7c369cf866758bc36d9bd8e2e3c9fb0cf7fd6073ebf630c1f67fa7d303c07da40b36749d157ea37965fef810f2ea05ae6fc7d96a8f3470d73e15b22b42e8d6986dbfe5303256b2b3560372c4452ffb2a04fb7c6691489f70cb46831be0679117f7
4
+ [tv] pwhash failure (maybe intentional): [3]
5
+ c121209f0ba70aed93d49200e5dc82cce013cef25ea31e160bf8db3cf448a59d1a56f6c19259e18ea020553cb75781761d112b2d949a297584c65e60df95ad89c4109825a3171dc6f20b1fd6b0cdfd194861bc2b414295bee5c6c52619e544abce7d520659c3d51de2c60e89948d830695ab38dcb75dd7ab06a4770dd4bc7c8f335519e04b038416b1a7dbd25c026786a8105c5ffe7a0931364f0376ae5772be39b51d91d3281464e0f3a128e7155a68e87cf79626ffca0b2a3022fc8420
6
+ 91c337ce8918a5805a59b00bd1819d3eb4356807cbd2a80b271c4b482dce03f5b02ae4eb831ff668cbb327b93c300b41da4852e5547bea8342d518dd9311aaeb5f90eccf66d548f9275631f0b1fd4b299cec5d2e86a59e55dc7b3afab6204447b21d1ef1da824abaf31a25a0d6135c4fe81d34a06816c8a6eab19141f5687108500f3719a862af8c5fee36e130c69921e11ce83dfc72c5ec3b862c1bccc5fd63ad57f432fbcca6f9e18d5a59015950cdf053
7
+ [tv] pwhash failure (maybe intentional): [6]
8
+ e942951dfbc2d508294b10f9e97b47d0cd04e668a043cb95679cc1139df7c27cd54367688725be9d069f5704c12223e7e4ca181fbd0bed18bb4634795e545a6c04a7306933a41a794baedbb628d41bc285e0b9084055ae136f6b63624c874f5a1e1d8be7b0b7227a171d2d7ed578d88bfdcf18323198962d0dcad4126fd3f21adeb1e11d66252ea0c58c91696e91031bfdcc2a9dc0e028d17b9705ba2d7bcdcd1e3ba75b4b1fea
9
+ 9fbbc02a420b00614a49a8e8d89834df368fa54dbef5dce7f9928f4d09f45ce22766598c0c979a707b1df130ab8d63802447923f6e8b89b3c183d71d694161569b1937d8b58f0091fcb8b1f48f2e3f43067bb2498b727fb62cc776ed39219613aa2083619385ec64dfb38f3cda7fddce9cec708a1aa5e9b09d6a5f063cda6c644c5e4a6c1bba9362b27f050984ee3a91bbed69160c95d63c04724f
10
+ 28645e1a4f5bc2a58786c87f0d88c2c68047b874b122e2c3936fb6adf26d7ca8fbcb872a8aef282ff202526a91b8ca1d0926c4ae0f5429c342bfd4987916b147ccaa1624bbb2d3f197e56601a541939a1a867ee659515d379d252c8b53aa2297b6008f97bc4a246040b0fb4f46754482884ff04bdade7ffc74989c68ec085de660ef2071db22bacc227d43af282a2336049d78fe0b8ff543628dc8
11
+ [tv3] pwhash_str failure (maybe intentional): [0]
31
12
  OK
@@ -0,0 +1,349 @@
1
+
2
+ #define TEST_NAME "pwhash_scrypt"
3
+ #include "cmptest.h"
4
+
5
+ #define OUT_LEN 128
6
+ #define OPSLIMIT 1000000
7
+ #define MEMLIMIT 10000000
8
+
9
+ static void tv(void)
10
+ {
11
+ static struct {
12
+ const char *passwd_hex;
13
+ size_t passwdlen;
14
+ const char *salt_hex;
15
+ size_t outlen;
16
+ unsigned long long opslimit;
17
+ size_t memlimit;
18
+ } tests[] = {
19
+ { "a347ae92bce9f80f6f595a4480fc9c2fe7e7d7148d371e9487d75f5c23008ffae0"
20
+ "65577a928febd9b1973a5a95073acdbeb6a030cfc0d79caa2dc5cd011cef02c08d"
21
+ "a232d76d52dfbca38ca8dcbd665b17d1665f7cf5fe59772ec909733b24de97d6f5"
22
+ "8d220b20c60d7c07ec1fd93c52c31020300c6c1facd77937a597c7a6",
23
+ 127,
24
+ "5541fbc995d5c197ba290346d2c559dedf405cf97e5f95482143202f9e74f5c2",
25
+ 155, 481326, 7256678 },
26
+ { "e125cee61c8cb7778d9e5ad0a6f5d978ce9f84de213a8556d9ffe202020ab4a6ed"
27
+ "9074a4eb3416f9b168f137510f3a30b70b96cbfa219ff99f6c6eaffb15c06b60e0"
28
+ "0cc2890277f0fd3c622115772f7048adaebed86e",
29
+ 86,
30
+ "f1192dd5dc2368b9cd421338b22433455ee0a3699f9379a08b9650ea2c126f0d",
31
+ 250, 535778, 7849083 },
32
+ { "92263cbf6ac376499f68a4289d3bb59e5a22335eba63a32e6410249155b956b6a3"
33
+ "b48d4a44906b18b897127300b375b8f834f1ceffc70880a885f47c33876717e392"
34
+ "be57f7da3ae58da4fd1f43daa7e44bb82d3717af4319349c24cd31e46d295856b0"
35
+ "441b6b289992a11ced1cc3bf3011604590244a3eb737ff221129215e4e4347f491"
36
+ "5d41292b5173d196eb9add693be5319fdadc242906178bb6c0286c9b6ca6012746"
37
+ "711f58c8c392016b2fdfc09c64f0f6b6ab7b",
38
+ 183,
39
+ "3b840e20e9555e9fb031c4ba1f1747ce25cc1d0ff664be676b9b4a90641ff194",
40
+ 249, 311757, 7994791 },
41
+ { "027b6d8e8c8c474e9b69c7d9ed4f9971e8e1ce2f6ba95048414c3970f0f09b70e3"
42
+ "b6c5ae05872b3d8678705b7d381829c351a5a9c88c233569b35d6b0b809df44b64"
43
+ "51a9c273f1150e2ef8a0b5437eb701e373474cd44b97ef0248ebce2ca0400e1b53"
44
+ "f3d86221eca3f18eb45b702b9172440f774a82cbf1f6f525df30a6e293c873cce6"
45
+ "9bb078ed1f0d31e7f9b8062409f37f19f8550aae",
46
+ 152,
47
+ "eb2a3056a09ad2d7d7f975bcd707598f24cd32518cde3069f2e403b34bfee8a5",
48
+ 5, 643464, 1397645 },
49
+ { "4a857e2ee8aa9b6056f2424e84d24a72473378906ee04a46cb05311502d5250b82"
50
+ "ad86b83c8f20a23dbb74f6da60b0b6ecffd67134d45946ac8ebfb3064294bc097d"
51
+ "43ced68642bfb8bbbdd0f50b30118f5e",
52
+ 82,
53
+ "39d82eef32010b8b79cc5ba88ed539fbaba741100f2edbeca7cc171ffeabf258",
54
+ 190, 758010, 5432947 },
55
+ { "1845e375479537e9dd4f4486d5c91ac72775d66605eeb11a787b78a7745f1fd005"
56
+ "2d526c67235dbae1b2a4d575a74cb551c8e9096c593a497aee74ba3047d911358e"
57
+ "de57bc27c9ea1829824348daaab606217cc931dcb6627787bd6e4e5854f0e8",
58
+ 97,
59
+ "3ee91a805aa62cfbe8dce29a2d9a44373a5006f4a4ce24022aca9cecb29d1473",
60
+ 212, 233177, 13101817 },
61
+ { "c7b09aec680e7b42fedd7fc792e78b2f6c1bea8f4a884320b648f81e8cf515e8ba"
62
+ "9dcfb11d43c4aae114c1734aa69ca82d44998365db9c93744fa28b63fd16000e82"
63
+ "61cbbe083e7e2da1e5f696bde0834fe53146d7e0e35e7de9920d041f5a5621aabe"
64
+ "02da3e2b09b405b77937efef3197bd5772e41fdb73fb5294478e45208063b5f58e"
65
+ "089dbeb6d6342a909c1307b3fff5fe2cf4da56bdae50848f",
66
+ 156,
67
+ "039c056d933b475032777edbaffac50f143f64c123329ed9cf59e3b65d3f43b6",
68
+ 178, 234753, 4886999 },
69
+ { "8f3a06e2fd8711350a517bb12e31f3d3423e8dc0bb14aac8240fca0995938d59bb"
70
+ "37bd0a7dfc9c9cc0705684b46612e8c8b1d6655fb0f9887562bb9899791a0250d1"
71
+ "320f945eda48cdc20c233f40a5bb0a7e3ac5ad7250ce684f68fc0b8c9633bfd75a"
72
+ "ad116525af7bdcdbbdb4e00ab163fd4df08f243f12557e",
73
+ 122,
74
+ "90631f686a8c3dbc0703ffa353bc1fdf35774568ac62406f98a13ed8f47595fd",
75
+ 55, 695191, 15738350 },
76
+ { "b540beb016a5366524d4605156493f9874514a5aa58818cd0c6dfffaa9e90205f1"
77
+ "7b",
78
+ 34,
79
+ "44071f6d181561670bda728d43fb79b443bb805afdebaf98622b5165e01b15fb",
80
+ 231, 78652, 6631659 },
81
+ { "a14975c26c088755a8b715ff2528d647cd343987fcf4aa25e7194a8417fb2b4b3f"
82
+ "7268da9f3182b4cfb22d138b2749d673a47ecc7525dd15a0a3c66046971784bb63"
83
+ "d7eae24cc84f2631712075a10e10a96b0e0ee67c43e01c423cb9c44e5371017e9c"
84
+ "496956b632158da3fe12addecb88912e6759bc37f9af2f45af72c5cae3b179ffb6"
85
+ "76a697de6ebe45cd4c16d4a9d642d29ddc0186a0a48cb6cd62bfc3dd229d313b30"
86
+ "1560971e740e2cf1f99a9a090a5b283f35475057e96d7064e2e0fc81984591068d"
87
+ "55a3b4169f22cccb0745a2689407ea1901a0a766eb99",
88
+ 220,
89
+ "3d968b2752b8838431165059319f3ff8910b7b8ecb54ea01d3f54769e9d98daf",
90
+ 167, 717248, 10784179 },
91
+ };
92
+ char passwd[256];
93
+ unsigned char salt[crypto_pwhash_scryptsalsa208sha256_SALTBYTES];
94
+ unsigned char out[256];
95
+ char out_hex[256 * 2 + 1];
96
+ size_t i = 0U;
97
+
98
+ do {
99
+ sodium_hex2bin((unsigned char *) passwd, sizeof passwd,
100
+ tests[i].passwd_hex, strlen(tests[i].passwd_hex), NULL,
101
+ NULL, NULL);
102
+ sodium_hex2bin(salt, sizeof salt, tests[i].salt_hex,
103
+ strlen(tests[i].salt_hex), NULL, NULL, NULL);
104
+ if (crypto_pwhash_scryptsalsa208sha256(
105
+ out, (unsigned long long) tests[i].outlen,
106
+ passwd, tests[i].passwdlen,
107
+ (const unsigned char *) salt, tests[i].opslimit,
108
+ tests[i].memlimit) != 0) {
109
+ printf("pwhash failure\n");
110
+ }
111
+ sodium_bin2hex(out_hex, sizeof out_hex, out, tests[i].outlen);
112
+ printf("%s\n", out_hex);
113
+ } while (++i < (sizeof tests) / (sizeof tests[0]));
114
+ }
115
+
116
+ static void tv2(void)
117
+ {
118
+ static struct {
119
+ const char *passwd_hex;
120
+ size_t passwdlen;
121
+ const char *salt_hex;
122
+ size_t outlen;
123
+ unsigned long long opslimit;
124
+ size_t memlimit;
125
+ } tests[] = {
126
+ { "a347ae92bce9f80f6f595a4480fc9c2fe7e7d7148d371e9487d75f5c23008ffae0"
127
+ "65577a928febd9b1973a5a95073acdbeb6a030cfc0d79caa2dc5cd011cef02c08d"
128
+ "a232d76d52dfbca38ca8dcbd665b17d1665f7cf5fe59772ec909733b24de97d6f5"
129
+ "8d220b20c60d7c07ec1fd93c52c31020300c6c1facd77937a597c7a6",
130
+ 127,
131
+ "5541fbc995d5c197ba290346d2c559dedf405cf97e5f95482143202f9e74f5c2",
132
+ 155, 64, 1397645 },
133
+ { "a347ae92bce9f80f6f595a4480fc9c2fe7e7d7148d371e9487d75f5c23008ffae0"
134
+ "65577a928febd9b1973a5a95073acdbeb6a030cfc0d79caa2dc5cd011cef02c08d"
135
+ "a232d76d52dfbca38ca8dcbd665b17d1665f7cf5fe59772ec909733b24de97d6f5"
136
+ "8d220b20c60d7c07ec1fd93c52c31020300c6c1facd77937a597c7a6",
137
+ 127,
138
+ "5541fbc995d5c197ba290346d2c559dedf405cf97e5f95482143202f9e74f5c2",
139
+ 155, 32768, 1397645 },
140
+ };
141
+ char passwd[256];
142
+ unsigned char salt[crypto_pwhash_scryptsalsa208sha256_SALTBYTES];
143
+ unsigned char out[256];
144
+ char out_hex[256 * 2 + 1];
145
+ size_t i = 0U;
146
+
147
+ do {
148
+ sodium_hex2bin((unsigned char *)passwd, sizeof passwd,
149
+ tests[i].passwd_hex, strlen(tests[i].passwd_hex), NULL,
150
+ NULL, NULL);
151
+ sodium_hex2bin(salt, sizeof salt, tests[i].salt_hex,
152
+ strlen(tests[i].salt_hex), NULL, NULL, NULL);
153
+ if (crypto_pwhash_scryptsalsa208sha256(
154
+ out, (unsigned long long) tests[i].outlen,
155
+ passwd, tests[i].passwdlen,
156
+ (const unsigned char *) salt, tests[i].opslimit,
157
+ tests[i].memlimit) != 0) {
158
+ printf("pwhash failure\n");
159
+ }
160
+ sodium_bin2hex(out_hex, sizeof out_hex, out, tests[i].outlen);
161
+ printf("%s\n", out_hex);
162
+ } while (++i < (sizeof tests) / (sizeof tests[0]));
163
+ }
164
+
165
+ static void tv3(void)
166
+ {
167
+ static struct {
168
+ const char *passwd;
169
+ const char *out;
170
+ } tests[] = {
171
+ { "^T5H$JYt39n%K*j:W]!1s?vg!:jGi]Ax?..l7[p0v:1jHTpla9;]bUN;?bWyCbtqg "
172
+ "nrDFal+Jxl3,2`#^tFSu%v_+7iYse8-cCkNf!tD=KrW)",
173
+ "$7$B6....1....75gBMAGwfFWZqBdyF3WdTQnWdUsuTiWjG1fF9c1jiSD$tc8RoB3."
174
+ "Em3/zNgMLWo2u00oGIoTyJv4fl3Fl8Tix72" },
175
+ { "bl72h6#y<':MFRZ>B IA1=NRkCKS%W8`1I.2uQxJN0g)N N aTt^4K!Iw5r "
176
+ "H6;crDsv^a55j9tsk'/GqweZn;cdk6+F_St6:#*=?ZCD_lw>.",
177
+ "$7$A6....3....Iahc6qM0.UQJHVgE4h9oa1/"
178
+ "4OWlWLm9CCtfguvz6bQD$QnXCo3M7nIqtry2WKsUZ5gQ.mY0wAlJu."
179
+ "WUhtE8vF66" },
180
+ { "Py "
181
+ ">e.5b+tLo@rL`dC2k@eJ&4eVl!W=JJ4+k&mAt@gt',FS1JjqKW3aq21:]^kna`"
182
+ "mde7kVkN5NrpKUptu)@4*b&?BE_sJMG1=&@`3GBCV]Wg7xwgo7x3El",
183
+ "$7$96..../....f6bEusKt79kK4wdYN0ki2nw4bJQ7P3rN6k3BSigsK/"
184
+ "D$Dsvuw7vXj5xijmrb/NOhdgoyK/OiSIYv88cEtl9Cik7" },
185
+ { "2vj;Um]FKOL27oam(:Uo8+UmSTvb1FD*h?jk_,S=;RDgF-$Fjk?]9yvfxe@fN^!NN("
186
+ "Cuml?+2Raa",
187
+ "$7$86....I....7XwIxLtCx4VphmFeUa6OGuGJrFaIaYzDiLNu/"
188
+ "tyUPhD$U3q5GCEqCWxMwh.YQHDJrlg7FIZgViv9pcXE3h1vg61" },
189
+ { "CT=[9uUoGav,J`kU+348tA50ue#sL:ABZ3QgF+r[#vh:tTOiL>s8tv%,Jeo]jH/"
190
+ "_4^i(*jD-_ku[9Ko[=86 06V",
191
+ "$7$A6....2....R3.bjH6YS9wz9z8Jsj.3weGQ3J80ZZElGw2oVux1TP6$"
192
+ "i5u6lFzXDHaIgYEICinLD6WNaovbiXP8SnLrDRdKgA9" },
193
+ { "J#wNn`hDgOpTHNI.w^1a70%f,.9V_m038H_JIJQln`vdWnn/"
194
+ "rmILR?9H5g(+`;@H(2VosN9Fgk[WEjaBr'yB9Q19-imNa04[Mk5kvGcSn-TV",
195
+ "$7$B6....1....Dj1y.4mF1J9XmT/6IDskYdCLaPFJTq9xcCwXQ1DpT92$92/"
196
+ "hYfZLRq1nTLyIz.uc/dC6wLqwnsoqpkadrCXusm6" },
197
+ { "j4BS38Asa;p)[K+9TY!3YDj<LK-`nLVXQw9%*QfM",
198
+ "$7$B6....1....5Ods8mojVwXJq4AywF/uI9BdMSiJ/zT8hQP/"
199
+ "4cB68VC$nk4ExHNXJ802froj51/1wJTrSZvTIyyK7PecOxRRaz0" },
200
+ { "M.R>Qw+!qJb]>pP :_.9`dxM9k [eR7Y!yL-3)sNs[R,j_/^ "
201
+ "TH=5ny'15>6UXWcQW^6D%XCsO[vN[%ReA-`tV1vW(Nt*0KVK#]45P_A",
202
+ "$7$B6....1....D/"
203
+ "eyk8N5y6Z8YVQEsw521cTx.9zzLuK7YDs1KMMh.o4$alfW8ZbsUWnXc."
204
+ "vqon2zoljVk24Tt1.IsCuo2KurvS2" },
205
+ { "K3S=KyH#)36_?]LxeR8QNKw6X=gFb'ai$C%29V* "
206
+ "tyh^Wo$TN-#Q4qkmtTCf0LLb.^E$0uykkP",
207
+ "$7$B6....1....CuBuU97xgAage8whp/"
208
+ "JNKobo0TFbsORGVbfcQIefyP8$aqalP."
209
+ "XofGViB8EPLONqHma8vs1xc9uTIMYh9CgE.S8" },
210
+ { "Y0!?iQa9M%5ekffW(`",
211
+ "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
212
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
213
+
214
+ /* Invalid pwhash strings */
215
+
216
+ { "Y0!?iQa9M%5ekffW(`",
217
+ "$7$A6....1....$TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4"
218
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
219
+ { "Y0!?iQa9M%5ekffW(`",
220
+ "$7$.6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
221
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
222
+ { "Y0!?iQa9M%5ekffW(`",
223
+ "$7$A.....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
224
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
225
+ { "Y0!?iQa9M%5ekffW(`",
226
+ "$7$A6.........TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
227
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
228
+ { "Y0!?iQa9M%5ekffW(`",
229
+ "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i44269$"
230
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AH" },
231
+ { "Y0!?iQa9M%5ekffW(`",
232
+ "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
233
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx54269" },
234
+ { "Y0!?iQa9M%5ekffW(`",
235
+ "$7^A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
236
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
237
+ { "Y0!?iQa9M%5ekffW(`",
238
+ "$7$!6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
239
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
240
+ { "Y0!?iQa9M%5ekffW(`",
241
+ "$7$A!....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
242
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
243
+ { "Y0!?iQa9M%5ekffW(`",
244
+ "$7$A6....!....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
245
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
246
+ { "",
247
+ "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
248
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
249
+ { "Y0!?iQa9M%5ekffW(`",
250
+ "$7fA6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4#"
251
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
252
+ { "Y0!?iQa9M%5ekffW(`",
253
+ "$7$AX....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
254
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
255
+ { "Y0!?iQa9M%5ekffW(`",
256
+ "$7$A6....1!...TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
257
+ "a4ik5hGDN7foMuHOW.cp.CtX01UyCeO0.JAG.AHPpx5" },
258
+ { "Y0!?iQa9M%5ekffW(`",
259
+ "$7$A6....1" },
260
+ { "Y0!?iQa9M%5ekffW(`",
261
+ "$7$" },
262
+ { "Y0!?iQa9M%5ekffW(`",
263
+ "" },
264
+ { "Y0!?iQa9M%5ekffW(`",
265
+ "$7$A6....1....TrXs5Zk6s8sWHpQgWDIXTR8kUU3s6Jc3s.DtdS8M2i4$"
266
+ "" },
267
+ };
268
+ char *out;
269
+ char *passwd;
270
+ size_t i = 0U;
271
+
272
+ do {
273
+ out = (char *) sodium_malloc(strlen(tests[i].out) + 1U);
274
+ assert(out != NULL);
275
+ memcpy(out, tests[i].out, strlen(tests[i].out) + 1U);
276
+ passwd = (char *) sodium_malloc(strlen(tests[i].passwd) + 1U);
277
+ assert(passwd != NULL);
278
+ memcpy(passwd, tests[i].passwd, strlen(tests[i].passwd) + 1U);
279
+ if (crypto_pwhash_scryptsalsa208sha256_str_verify
280
+ (out, passwd, strlen(passwd)) != 0) {
281
+ printf("pwhash_str failure: [%u]\n", (unsigned int)i);
282
+ }
283
+ sodium_free(out);
284
+ sodium_free(passwd);
285
+ } while (++i < (sizeof tests) / (sizeof tests[0]));
286
+ }
287
+
288
+ int main(void)
289
+ {
290
+ char *str_out;
291
+ char *str_out2;
292
+ char *salt;
293
+ const char *passwd = "Correct Horse Battery Staple";
294
+
295
+ tv();
296
+ tv2();
297
+ tv3();
298
+ salt = (char *)
299
+ sodium_malloc(crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
300
+ str_out = (char *)
301
+ sodium_malloc(crypto_pwhash_scryptsalsa208sha256_STRBYTES);
302
+ str_out2 = (char *)
303
+ sodium_malloc(crypto_pwhash_scryptsalsa208sha256_STRBYTES);
304
+ memcpy(salt, "[<~A 32-bytes salt for scrypt~>]",
305
+ crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
306
+ if (crypto_pwhash_scryptsalsa208sha256_str(str_out, passwd, strlen(passwd),
307
+ OPSLIMIT, MEMLIMIT) != 0) {
308
+ printf("pwhash_str failure\n");
309
+ }
310
+ if (crypto_pwhash_scryptsalsa208sha256_str(str_out2, passwd, strlen(passwd),
311
+ OPSLIMIT, MEMLIMIT) != 0) {
312
+ printf("pwhash_str(2) failure\n");
313
+ }
314
+ if (strcmp(str_out, str_out2) == 0) {
315
+ printf("pwhash_str doesn't generate different salts\n");
316
+ }
317
+ if (crypto_pwhash_scryptsalsa208sha256_str_verify(str_out, passwd,
318
+ strlen(passwd)) != 0) {
319
+ printf("pwhash_str_verify failure\n");
320
+ }
321
+ if (crypto_pwhash_scryptsalsa208sha256_str_verify(str_out, passwd,
322
+ strlen(passwd)) != 0) {
323
+ printf("pwhash_str_verify failure\n");
324
+ }
325
+ str_out[14]++;
326
+ if (crypto_pwhash_scryptsalsa208sha256_str_verify(
327
+ str_out, passwd, strlen(passwd)) == 0) {
328
+ printf("pwhash_str_verify(2) failure\n");
329
+ }
330
+ str_out[14]--;
331
+
332
+ assert(str_out[crypto_pwhash_scryptsalsa208sha256_STRBYTES - 1U] == 0);
333
+ assert(crypto_pwhash_scryptsalsa208sha256_saltbytes() > 0U);
334
+ assert(crypto_pwhash_scryptsalsa208sha256_strbytes() > 1U);
335
+ assert(crypto_pwhash_scryptsalsa208sha256_strbytes() >
336
+ strlen(crypto_pwhash_scryptsalsa208sha256_strprefix()));
337
+ assert(crypto_pwhash_scryptsalsa208sha256_opslimit_interactive() > 0U);
338
+ assert(crypto_pwhash_scryptsalsa208sha256_memlimit_interactive() > 0U);
339
+ assert(crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive() > 0U);
340
+ assert(crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive() > 0U);
341
+
342
+ sodium_free(salt);
343
+ sodium_free(str_out);
344
+ sodium_free(str_out2);
345
+
346
+ printf("OK\n");
347
+
348
+ return 0;
349
+ }
@@ -0,0 +1,31 @@
1
+ 8d40f5f8c6a1791204f03e19a98cd74f918b6e331b39cfc2415e5014d7738b7bb0a83551fb14a035e07fdd4dc0c60c1a6822ac253918979f6324ff0c87cba75d3b91f88f41ca5414a0f152bdc4d636f42ab2250afd058c19ec31a3374d1bd7133289bf21513ff67cbf8482e626aee9864c58fd05f9ea02e508a10182b7d838157119866f072004987ef6c56683ed207705923921af9d76444a331a
2
+ d985d4c278343a46d82af0c4268b7ae6b6d1d2dd289675ef45bfb6d0648bffe5bab8c91228f3a31b091154a9c1142670a07b92e70a298333066de07db9300e046fd7cacc99780804683df7babdfc9d019047178400b2875bde0a1ad824dda7a422d9ed48475af9a3876378dd3a2f206e34984e223afb82c0c1e4644c9a458f4666379fdd3e2d9206d87e3c32c3977f35826a27590baaa1ec1a3bd7d15a92bc84c95dcfc56c14fca7c4c9810162dfdf9dc08a191e79fe40250b7e07d3a9317d9a5cb56e1062c419a6cd6a9b73128e8ad79ab7efffbb3cc52c1f49f86d2ebb46e6e4846aecdb14c2d046f5380517ff8cc794e4a772a58b93083dad
3
+ ee7e9e1369267ec555981f0ea088ff6f93953abfcb767d88ec3c46393d24cfbaba5e4e26e0f35b5d5259647748476d65cd8881c96f8cda049d9c877b2d33d932e67f4c0df2cb434b4b4900e0c49c3f8ba9663795420577e65d0b456201ad9162fbc485c7b44f2b34e6673aa3692c123021ee3b624c3bb22b808b89613d8ecc7b87da47f57152eb3f7b10ad206f6b09cb6935b347b5e42bc3b8c9c9bcd8d7b7c44929b367fc279dec48ea78e6ee3e2620d7459700bd0aedb1c9aa5a323ca94403927f5e5c2b73bda7c5c3287b62fe51874cfeb1dc3151cd886b26d83ece68833229d2d432798c602d85b0505947207d8430febbe901164b12ce
4
+ 1828b82997
5
+ bcc5c2fd785e4781d1201ed43d84925537e2a540d3de55f5812f29e9dd0a4a00451a5c8ddbb4862c03d45c75bf91b7fb49265feb667ad5c899fdbf2ca19eac67aa5e48595d5b02f8183ab07f71b1ce0d76e5df54919f63810ad0893ded7d1ca18fc956ec06ffd4c3d1f77a00ed53608947b25eea5df6bea02272be15815f974c321a2a9208674fdf59d1d798c2a12f1889df68b0c222b37ee9ef0d6391fc160b0281ec53073cb3a3706ce1d71c3af2f5237a1b3d8545d99012eecc0b4abb
6
+ 82765c040c58c1810f8c053ef5c248556299385476bde44bdd91a0d9a239f24e9b1717fd8b23209ffa45b7aa7937296c601b79e77da99e8d2fda0ea4459be2d0900f5bc5a269b5488d873d4632d1baf75965e509ee24b12501a9ce3bbbd8b7d759987d545a1c221a363195e5802d768b3b9e00ebe5ac0ed8ad2362c1c4157b910a40f94adf2561a2b0d3e65dbb06f244e5ac44d362103df54c9b9175777b3db1cdadb03e977ab8a79baf1e1e18ec9f5d0f25c487ddc53d7e81910f83576b44e9caeece26e2eb376569ad3a8cdccbde8bc355210e
7
+ ca9216d4127e2e4a6ee3584b49be106217bb61cc807016d46d0cfbb1fd722e2bbac33541386bdfeac41a299ead22790993fcaa8e1d23bd1c8426afa5ff4c08e731dc476ef834f142c32dfb2c1be12b9978802e63b2cd6f226b1a8df59f0c79154d7ef4296a68ec654538d987104f9a11aca1b7c83ab2ed8fd69da6b88f0bcbd27d3fea01329cecf10c57ec3ba163d57b38801bd6c3b31ce527b33717bb56a46f78fb96be9f2424a21b3284232388cbba6a74
8
+ 2732a7566023c8db90a5fdd08dbe6c1b5e70c046d50c5735c8d86a589ba177f69db12d6cc3596319fa27c9e063ed05b8a31970a07dc905
9
+ d7b1ef464be03ce9050b5108e25f0b8e821299986fe0ff89e17fbae65ba9fad167fbd265866ac03efc86ab0b50d46d6740a59adf5949b44f7f9f3ac3f3d4cc9f128966db9099deb1b6b78505242b2401a193820408eb0780b27162ebafb7c505b0e7c32ce66c6efc0be487008c1201454680498a2fc06e00b454e0b20933906bbb0e43b399b9ee46d882f107df1ebdd1e7cd867c9cdba6015b7e80064ae8b3417d969524bec046e782a13b125f058cd36b5d1ae65886ae7caab45a6d98651ada435b8ee11d5c1224232f5f515df974138dd6cf347b730481d4b073af8ff0394fe9f0b8cdfd99f5
10
+ 1839be14287053bfcd4ea60db82777fad1a6e9535c388b770743e61235449e668717199defd516c438b3ebd79b3529eb32482ef414525292ea1bbec09da10790a2330a4399f2fe6dd63d80954e3c547a5f1c619db5a30bde495b23f2214b4fa7572851d75246f2817775f0b521acc6efbc7832c9a76de7465e3c65cade88e86c973f85a882bb54f92b983977c6e937c88f083ba68c70fb49497065b158e2e789809b1d4cc9ec2d
11
+ d54916748076b9d9f72198c8fbef563462dc8c706e1ad38abd1fac570016721acd0a7659ab49a47299a996b43597690c0c947143069f35d83e606273dbf2d622321393949b8ed5a68315362c4f84804384d05e0e0e86bc00e3641233f9f975ab46b60ba185c5e5fe47f78efd207e69fd8f6390730828b93b9b3763ea1283caa03bc36726763715de811915681dd214524f5ad4dd386608cac6c7f2
12
+ d54916748076b9d9f72198c8fbef563462dc8c706e1ad38abd1fac570016721acd0a7659ab49a47299a996b43597690c0c947143069f35d83e606273dbf2d622321393949b8ed5a68315362c4f84804384d05e0e0e86bc00e3641233f9f975ab46b60ba185c5e5fe47f78efd207e69fd8f6390730828b93b9b3763ea1283caa03bc36726763715de811915681dd214524f5ad4dd386608cac6c7f2
13
+ pwhash_str failure: [10]
14
+ pwhash_str failure: [11]
15
+ pwhash_str failure: [12]
16
+ pwhash_str failure: [13]
17
+ pwhash_str failure: [14]
18
+ pwhash_str failure: [15]
19
+ pwhash_str failure: [16]
20
+ pwhash_str failure: [17]
21
+ pwhash_str failure: [18]
22
+ pwhash_str failure: [19]
23
+ pwhash_str failure: [20]
24
+ pwhash_str failure: [21]
25
+ pwhash_str failure: [22]
26
+ pwhash_str failure: [23]
27
+ pwhash_str failure: [24]
28
+ pwhash_str failure: [25]
29
+ pwhash_str failure: [26]
30
+ pwhash_str failure: [27]
31
+ OK
@@ -12,7 +12,7 @@ static unsigned char nonce[24]
12
12
  0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6,
13
13
  0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 };
14
14
 
15
- // API requires first 32 bytes to be 0
15
+ /* API requires first 32 bytes to be 0 */
16
16
  static unsigned char m[163]
17
17
  = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18
18
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -12,7 +12,7 @@ static unsigned char nonce[24]
12
12
  0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6,
13
13
  0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 };
14
14
 
15
- // API requires first 16 bytes to be 0
15
+ /* API requires first 16 bytes to be 0 */
16
16
  static unsigned char c[163]
17
17
  = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18
18
  0, 0, 0, 0, 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5,
@@ -1101,10 +1101,17 @@ int main(void)
1101
1101
  continue;
1102
1102
  }
1103
1103
  add_l(sm + 32);
1104
+ #ifndef ED25519_COMPAT
1105
+ if (crypto_sign_open(m, &mlen, sm, smlen, test_data[i].pk) != -1) {
1106
+ printf("crypto_sign_open(): signature [%u] is malleable\n", i);
1107
+ continue;
1108
+ }
1109
+ #else
1104
1110
  if (crypto_sign_open(m, &mlen, sm, smlen, test_data[i].pk) != 0) {
1105
1111
  printf("crypto_sign_open(): signature [%u] is not malleable\n", i);
1106
1112
  continue;
1107
1113
  }
1114
+ #endif
1108
1115
  if (memcmp(test_data[i].m, m, (size_t)mlen) != 0) {
1109
1116
  printf("message verification failure: [%u]\n", i);
1110
1117
  continue;
@@ -1174,6 +1181,14 @@ int main(void)
1174
1181
  printf("detached signature verification should have failed\n");
1175
1182
  }
1176
1183
 
1184
+ memset(sig, 0xff, 32);
1185
+ sig[0] = 0xdb;
1186
+ if (crypto_sign_verify_detached(sig,
1187
+ (const unsigned char *)test_data[i].m,
1188
+ i, pk) != -1) {
1189
+ printf("detached signature verification should have failed\n");
1190
+ }
1191
+
1177
1192
  if (crypto_sign_keypair(pk, sk) != 0) {
1178
1193
  printf("crypto_sign_keypair() failure\n");
1179
1194
  }