rbnacl-libsodium 1.0.13 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +5 -0
  3. data/lib/rbnacl/libsodium.rb +1 -0
  4. data/lib/rbnacl/libsodium/version.rb +1 -1
  5. data/vendor/libsodium/AUTHORS +2 -2
  6. data/vendor/libsodium/ChangeLog +64 -0
  7. data/vendor/libsodium/Makefile.am +1 -0
  8. data/vendor/libsodium/README.markdown +1 -3
  9. data/vendor/libsodium/THANKS +13 -3
  10. data/vendor/libsodium/builds/Makefile.am +65 -0
  11. data/vendor/libsodium/builds/msvc/resource.rc +2 -2
  12. data/vendor/libsodium/builds/msvc/version.h +3 -3
  13. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +168 -173
  14. data/vendor/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +382 -394
  15. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +168 -173
  16. data/vendor/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +382 -394
  17. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +168 -173
  18. data/vendor/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +382 -394
  19. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +168 -173
  20. data/vendor/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +382 -394
  21. data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj +168 -173
  22. data/vendor/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +382 -394
  23. data/vendor/libsodium/configure.ac +59 -10
  24. data/vendor/libsodium/contrib/Findsodium.cmake +2 -0
  25. data/vendor/libsodium/dist-build/emscripten-symbols.def +72 -32
  26. data/vendor/libsodium/dist-build/emscripten.sh +33 -6
  27. data/vendor/libsodium/dist-build/generate-emscripten-symbols.sh +52 -38
  28. data/vendor/libsodium/dist-build/ios.sh +2 -2
  29. data/vendor/libsodium/libsodium.vcxproj +168 -173
  30. data/vendor/libsodium/libsodium.vcxproj.filters +220 -235
  31. data/vendor/libsodium/m4/ax_check_catchable_abrt.m4 +57 -0
  32. data/vendor/libsodium/m4/ax_check_gnu_make.m4 +2 -2
  33. data/vendor/libsodium/m4/ax_pthread.m4 +2 -2
  34. data/vendor/libsodium/msvc-scripts/process.bat +3 -3
  35. data/vendor/libsodium/packaging/dotnet-core/README.md +5 -5
  36. data/vendor/libsodium/packaging/dotnet-core/libsodium.props +5 -2
  37. data/vendor/libsodium/packaging/dotnet-core/prepare.py +13 -31
  38. data/vendor/libsodium/packaging/dotnet-core/recipes/linux-x64 +4 -0
  39. data/vendor/libsodium/packaging/nuget/package.config +1 -1
  40. data/vendor/libsodium/src/libsodium/Makefile.am +11 -12
  41. data/vendor/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +11 -4
  42. data/vendor/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +17 -4
  43. data/vendor/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c +8 -1
  44. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box.c +6 -0
  45. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box_easy.c +5 -4
  46. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c +11 -4
  47. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c +6 -0
  48. data/vendor/libsodium/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c +78 -17
  49. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +74 -64
  50. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +2 -0
  51. data/vendor/libsodium/src/libsodium/crypto_kx/crypto_kx.c +7 -0
  52. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +1 -1
  53. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +1 -0
  54. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +17 -17
  55. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c +53 -48
  56. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h +37 -11
  57. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c +23 -179
  58. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c +4 -12
  59. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c +244 -0
  60. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +3 -12
  61. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +4 -12
  62. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +1 -5
  63. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h +1 -1
  64. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx512f.h +145 -0
  65. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +91 -14
  66. data/vendor/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +35 -14
  67. data/vendor/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c +41 -4
  68. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +31 -17
  69. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +4 -0
  70. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +5 -1
  71. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +30 -1
  72. data/vendor/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +8 -0
  73. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +3 -3
  74. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c +6 -0
  75. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +5 -4
  76. data/vendor/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c +11 -4
  77. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c +6 -0
  78. data/vendor/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c +311 -0
  79. data/vendor/libsodium/src/libsodium/crypto_sign/crypto_sign.c +6 -0
  80. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ed25519_ref10.h +3 -0
  81. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +9 -2
  82. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +1 -1
  83. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +6 -5
  84. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c +6 -0
  85. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c +3 -2
  86. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c +3 -2
  87. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h +1 -1
  88. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c +3 -2
  89. data/vendor/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c +12 -0
  90. data/vendor/libsodium/src/libsodium/crypto_stream/crypto_stream.c +6 -0
  91. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c +7 -1
  92. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h +1 -1
  93. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c +6 -0
  94. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c +6 -0
  95. data/vendor/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c +6 -0
  96. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c +6 -0
  97. data/vendor/libsodium/src/libsodium/crypto_verify/sodium/verify.c +66 -29
  98. data/vendor/libsodium/src/libsodium/include/Makefile.am +1 -1
  99. data/vendor/libsodium/src/libsodium/include/sodium.h +2 -2
  100. data/vendor/libsodium/src/libsodium/include/sodium/core.h +9 -0
  101. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +26 -0
  102. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +16 -4
  103. data/vendor/libsodium/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h +10 -4
  104. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +4 -0
  105. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h +6 -0
  106. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +24 -15
  107. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h +8 -4
  108. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash.h +40 -18
  109. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +8 -2
  110. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +8 -2
  111. data/vendor/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +11 -3
  112. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +4 -0
  113. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h +6 -0
  114. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +17 -8
  115. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h +102 -0
  116. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +4 -0
  117. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +4 -0
  118. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +1 -0
  119. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +4 -0
  120. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h +10 -0
  121. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h +4 -0
  122. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +4 -0
  123. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +15 -5
  124. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xchacha20.h +4 -0
  125. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +4 -0
  126. data/vendor/libsodium/src/libsodium/include/sodium/export.h +9 -0
  127. data/vendor/libsodium/src/libsodium/include/sodium/private/common.h +11 -0
  128. data/vendor/libsodium/src/libsodium/include/sodium/private/curve25519_ref10.h +2 -30
  129. data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +2 -0
  130. data/vendor/libsodium/src/libsodium/include/sodium/runtime.h +12 -9
  131. data/vendor/libsodium/src/libsodium/include/sodium/utils.h +36 -0
  132. data/vendor/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c +3 -2
  133. data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +18 -14
  134. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +11 -10
  135. data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +20 -8
  136. data/vendor/libsodium/src/libsodium/sodium/codecs.c +333 -0
  137. data/vendor/libsodium/src/libsodium/sodium/core.c +36 -4
  138. data/vendor/libsodium/src/libsodium/sodium/runtime.c +18 -0
  139. data/vendor/libsodium/src/libsodium/sodium/utils.c +87 -100
  140. data/vendor/libsodium/test/constcheck.sh +19 -0
  141. data/vendor/libsodium/test/default/Makefile.am +39 -7
  142. data/vendor/libsodium/test/default/aead_aes256gcm.c +6 -0
  143. data/vendor/libsodium/test/default/aead_chacha20poly1305.c +16 -0
  144. data/vendor/libsodium/test/default/aead_xchacha20poly1305.c +25 -15
  145. data/vendor/libsodium/test/default/auth.c +13 -0
  146. data/vendor/libsodium/test/default/auth.exp +8 -0
  147. data/vendor/libsodium/test/default/box.c +3 -0
  148. data/vendor/libsodium/test/default/box2.c +2 -0
  149. data/vendor/libsodium/test/default/box_easy.c +1 -4
  150. data/vendor/libsodium/test/default/box_easy2.c +7 -3
  151. data/vendor/libsodium/test/default/chacha20.c +9 -2
  152. data/vendor/libsodium/test/default/cmptest.h +47 -1
  153. data/vendor/libsodium/test/default/codecs.c +226 -0
  154. data/vendor/libsodium/test/default/codecs.exp +28 -0
  155. data/vendor/libsodium/test/default/core3.c +42 -15
  156. data/vendor/libsodium/test/default/ed25519_convert.c +17 -0
  157. data/vendor/libsodium/test/default/kdf.c +8 -4
  158. data/vendor/libsodium/test/default/keygen.c +5 -2
  159. data/vendor/libsodium/test/default/kx.c +30 -0
  160. data/vendor/libsodium/test/default/metamorphic.c +187 -0
  161. data/vendor/libsodium/test/default/metamorphic.exp +1 -0
  162. data/vendor/libsodium/test/default/misuse.c +145 -0
  163. data/vendor/libsodium/test/default/misuse.exp +0 -0
  164. data/vendor/libsodium/test/default/onetimeauth.c +2 -0
  165. data/vendor/libsodium/test/default/{pwhash.c → pwhash_argon2i.c} +133 -106
  166. data/vendor/libsodium/test/default/{pwhash.exp → pwhash_argon2i.exp} +0 -1
  167. data/vendor/libsodium/test/default/pwhash_argon2id.c +254 -144
  168. data/vendor/libsodium/test/default/pwhash_argon2id.exp +2 -3
  169. data/vendor/libsodium/test/default/pwhash_scrypt.c +61 -18
  170. data/vendor/libsodium/test/default/pwhash_scrypt.exp +6 -0
  171. data/vendor/libsodium/test/default/randombytes.c +8 -3
  172. data/vendor/libsodium/test/default/secretbox.c +8 -0
  173. data/vendor/libsodium/test/default/secretbox2.c +5 -0
  174. data/vendor/libsodium/test/default/secretbox_easy.c +19 -1
  175. data/vendor/libsodium/test/default/secretbox_easy.exp +2 -0
  176. data/vendor/libsodium/test/default/secretbox_easy2.c +4 -0
  177. data/vendor/libsodium/test/default/secretstream.c +280 -0
  178. data/vendor/libsodium/test/default/secretstream.exp +1 -0
  179. data/vendor/libsodium/test/default/sign.c +31 -0
  180. data/vendor/libsodium/test/default/sodium_core.c +23 -1
  181. data/vendor/libsodium/test/default/sodium_core.exp +1 -1
  182. data/vendor/libsodium/test/default/sodium_utils.c +45 -56
  183. data/vendor/libsodium/test/default/sodium_utils.exp +0 -8
  184. data/vendor/libsodium/test/default/stream.c +2 -0
  185. data/vendor/libsodium/test/default/stream2.c +1 -0
  186. data/vendor/libsodium/test/default/xchacha20.c +58 -7
  187. metadata +21 -18
  188. data/vendor/libsodium/dist-build/emscripten-wasm.sh +0 -132
  189. data/vendor/libsodium/m4/pkg.m4 +0 -214
  190. data/vendor/libsodium/packaging/dotnet-core/desktop.targets +0 -16
  191. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c +0 -174
  192. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c +0 -66
  193. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/common.h +0 -766
  194. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/consts.h +0 -28
  195. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c +0 -28
  196. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/int128.h +0 -50
  197. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c +0 -149
  198. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c +0 -31
  199. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c +0 -195
  200. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/stream_aes128ctr.c +0 -19
  201. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +0 -65
@@ -0,0 +1,145 @@
1
+
2
+ #define TEST_NAME "misuse"
3
+ #include "cmptest.h"
4
+
5
+ #ifdef HAVE_CATCHABLE_ABRT
6
+ # include <signal.h>
7
+
8
+ static void
9
+ sigabrt_handler_13(int sig)
10
+ {
11
+ (void) sig;
12
+ exit(0);
13
+ }
14
+
15
+ static void
16
+ sigabrt_handler_12(int sig)
17
+ {
18
+ (void) sig;
19
+ signal(SIGABRT, sigabrt_handler_13);
20
+ assert(crypto_pwhash_str_alg(NULL, "", 0U, 1U, 1U, -1) == -1);
21
+ exit(1);
22
+ }
23
+
24
+ static void
25
+ sigabrt_handler_11(int sig)
26
+ {
27
+ (void) sig;
28
+ signal(SIGABRT, sigabrt_handler_12);
29
+ assert(crypto_box_easy(NULL, NULL, crypto_stream_xsalsa20_MESSAGEBYTES_MAX,
30
+ NULL, NULL, NULL) == -1);
31
+ exit(1);
32
+ }
33
+
34
+ static void
35
+ sigabrt_handler_10(int sig)
36
+ {
37
+ (void) sig;
38
+ signal(SIGABRT, sigabrt_handler_11);
39
+ assert(crypto_box_easy_afternm(NULL, NULL, crypto_stream_xsalsa20_MESSAGEBYTES_MAX,
40
+ NULL, NULL) == -1);
41
+ exit(1);
42
+ }
43
+
44
+ static void
45
+ sigabrt_handler_9(int sig)
46
+ {
47
+ (void) sig;
48
+ signal(SIGABRT, sigabrt_handler_10);
49
+ assert(sodium_base642bin(NULL, 1, NULL, 1, NULL, NULL, NULL, -1) == -1);
50
+ exit(1);
51
+ }
52
+
53
+ static void
54
+ sigabrt_handler_8(int sig)
55
+ {
56
+ (void) sig;
57
+ signal(SIGABRT, sigabrt_handler_9);
58
+ assert(sodium_bin2base64(NULL, 1, NULL, 1, sodium_base64_VARIANT_ORIGINAL) == NULL);
59
+ exit(1);
60
+ }
61
+
62
+ static void
63
+ sigabrt_handler_7(int sig)
64
+ {
65
+ (void) sig;
66
+ signal(SIGABRT, sigabrt_handler_8);
67
+ assert(sodium_bin2base64(NULL, 1, NULL, 1, -1) == NULL);
68
+ exit(1);
69
+ }
70
+
71
+ static void
72
+ sigabrt_handler_6(int sig)
73
+ {
74
+ (void) sig;
75
+ signal(SIGABRT, sigabrt_handler_7);
76
+ assert(sodium_pad(NULL, NULL, SIZE_MAX, 16, 1) == -1);
77
+ exit(1);
78
+ }
79
+
80
+ static void
81
+ sigabrt_handler_5(int sig)
82
+ {
83
+ (void) sig;
84
+ signal(SIGABRT, sigabrt_handler_6);
85
+ assert(crypto_aead_xchacha20poly1305_ietf_encrypt(NULL, NULL, NULL, UINT64_MAX,
86
+ NULL, 0, NULL, NULL, NULL) == -1);
87
+ exit(1);
88
+ }
89
+
90
+ static void
91
+ sigabrt_handler_4(int sig)
92
+ {
93
+ (void) sig;
94
+ signal(SIGABRT, sigabrt_handler_5);
95
+ assert(crypto_aead_chacha20poly1305_ietf_encrypt(NULL, NULL, NULL, UINT64_MAX,
96
+ NULL, 0, NULL, NULL, NULL) == -1);
97
+ exit(1);
98
+ }
99
+
100
+ static void
101
+ sigabrt_handler_3(int sig)
102
+ {
103
+ (void) sig;
104
+ signal(SIGABRT, sigabrt_handler_4);
105
+ assert(crypto_aead_chacha20poly1305_encrypt(NULL, NULL, NULL, UINT64_MAX,
106
+ NULL, 0, NULL, NULL, NULL) == -1);
107
+ exit(1);
108
+ }
109
+
110
+ static void
111
+ sigabrt_handler_2(int sig)
112
+ {
113
+ (void) sig;
114
+ signal(SIGABRT, sigabrt_handler_3);
115
+ #if SIZE_MAX > 0x4000000000ULL
116
+ randombytes_buf_deterministic(NULL, 0x4000000001ULL, NULL);
117
+ #else
118
+ abort();
119
+ #endif
120
+ exit(1);
121
+ }
122
+
123
+ static void
124
+ sigabrt_handler_1(int sig)
125
+ {
126
+ (void) sig;
127
+ signal(SIGABRT, sigabrt_handler_2);
128
+ assert(crypto_kx_server_session_keys(NULL, NULL, NULL, NULL, NULL) == -1);
129
+ exit(1);
130
+ }
131
+
132
+ int
133
+ main(void)
134
+ {
135
+ signal(SIGABRT, sigabrt_handler_1);
136
+ assert(crypto_kx_client_session_keys(NULL, NULL, NULL, NULL, NULL) == -1);
137
+ return 1;
138
+ }
139
+ #else
140
+ int
141
+ main(void)
142
+ {
143
+ return 0;
144
+ }
145
+ #endif
@@ -56,6 +56,8 @@ main(void)
56
56
  assert(crypto_onetimeauth_poly1305_bytes() == crypto_onetimeauth_bytes());
57
57
  assert(crypto_onetimeauth_poly1305_keybytes() ==
58
58
  crypto_onetimeauth_keybytes());
59
+ assert(crypto_onetimeauth_statebytes() > 0);
60
+ assert(crypto_onetimeauth_statebytes() == crypto_onetimeauth_poly1305_statebytes());
59
61
 
60
62
  return 0;
61
63
  }
@@ -1,5 +1,5 @@
1
1
 
2
- #define TEST_NAME "pwhash"
2
+ #define TEST_NAME "pwhash_argon2i"
3
3
  #include "cmptest.h"
4
4
 
5
5
  #define OUT_LEN 128
@@ -93,7 +93,7 @@ tv(void)
93
93
  if (crypto_pwhash(out, (unsigned long long) tests[i].outlen, passwd,
94
94
  tests[i].passwd_len, (const unsigned char *) salt,
95
95
  tests[i].opslimit, tests[i].memlimit,
96
- crypto_pwhash_alg_default()) != 0) {
96
+ crypto_pwhash_alg_argon2i13()) != 0) {
97
97
  printf("[tv] pwhash failure (maybe intentional): [%u]\n",
98
98
  (unsigned int) i);
99
99
  continue;
@@ -145,7 +145,7 @@ tv2(void)
145
145
  if (crypto_pwhash(out, (unsigned long long) tests[i].outlen, passwd,
146
146
  tests[i].passwd_len, (const unsigned char *) salt,
147
147
  tests[i].opslimit, tests[i].memlimit,
148
- crypto_pwhash_alg_default()) != 0) {
148
+ crypto_pwhash_alg_argon2i13()) != 0) {
149
149
  printf("[tv2] pwhash failure: [%u]\n", (unsigned int) i);
150
150
  continue;
151
151
  }
@@ -157,24 +157,28 @@ tv2(void)
157
157
  1ULL << 12, 0) != -1) {
158
158
  printf("[tv2] pwhash should have failed (0)\n");
159
159
  }
160
+ if (crypto_pwhash_argon2i(out, sizeof out, "password", strlen("password"), salt, 3,
161
+ 1ULL << 12, 0) != -1) {
162
+ printf("[tv2] pwhash should have failed (0')\n");
163
+ }
160
164
  if (crypto_pwhash(out, sizeof out, "password", strlen("password"), salt, 3,
161
- 1, crypto_pwhash_alg_default()) != -1) {
165
+ 1, crypto_pwhash_alg_argon2i13()) != -1) {
162
166
  printf("[tv2] pwhash should have failed (1)\n");
163
167
  }
164
168
  if (crypto_pwhash(out, sizeof out, "password", strlen("password"), salt, 3,
165
- 1ULL << 12, crypto_pwhash_alg_default()) != -1) {
169
+ 1ULL << 12, crypto_pwhash_alg_argon2i13()) != -1) {
166
170
  printf("[tv2] pwhash should have failed (2)\n");
167
171
  }
168
172
  if (crypto_pwhash(out, sizeof out, "password", strlen("password"), salt, 2,
169
- 1ULL << 12, crypto_pwhash_alg_default()) != -1) {
173
+ 1ULL << 12, crypto_pwhash_alg_argon2i13()) != -1) {
170
174
  printf("[tv2] pwhash should have failed (3)\n");
171
175
  }
172
176
  if (crypto_pwhash(out, 15, "password", strlen("password"), salt, 3,
173
- 1ULL << 12, crypto_pwhash_alg_default()) != -1) {
177
+ 1ULL << 12, crypto_pwhash_alg_argon2i13()) != -1) {
174
178
  printf("[tv2] pwhash with a short output length should have failed\n");
175
179
  }
176
180
  if (crypto_pwhash(out, sizeof out, "password", 0x100000000ULL, salt, 3,
177
- 1ULL << 12, crypto_pwhash_alg_default()) != -1) {
181
+ 1ULL << 12, crypto_pwhash_alg_argon2i13()) != -1) {
178
182
  printf("[tv2] pwhash with a long password length should have failed\n");
179
183
  }
180
184
  }
@@ -220,33 +224,40 @@ tv3(void)
220
224
  } while (++i < (sizeof tests) / (sizeof tests[0]));
221
225
  }
222
226
 
223
- int
224
- main(void)
227
+ static void
228
+ str_tests(void)
225
229
  {
226
230
  char *str_out;
227
231
  char *str_out2;
228
232
  char *salt;
229
233
  const char *passwd = "Correct Horse Battery Staple";
230
234
 
231
- tv();
232
- tv2();
233
- tv3();
234
235
  salt = (char *) sodium_malloc(crypto_pwhash_SALTBYTES);
235
236
  str_out = (char *) sodium_malloc(crypto_pwhash_STRBYTES);
236
237
  str_out2 = (char *) sodium_malloc(crypto_pwhash_STRBYTES);
237
238
  memcpy(salt, ">A 16-bytes salt", crypto_pwhash_SALTBYTES);
238
- if (crypto_pwhash_str(str_out, passwd, strlen(passwd), OPSLIMIT,
239
- MEMLIMIT) != 0) {
240
- printf("pwhash_str failure\n");
241
- return 1;
239
+ if (crypto_pwhash_argon2i_str(str_out, passwd, strlen(passwd), OPSLIMIT,
240
+ MEMLIMIT) != 0) {
241
+ printf("pwhash_argon2i_str failure\n");
242
242
  }
243
- if (crypto_pwhash_str(str_out2, passwd, strlen(passwd), OPSLIMIT,
244
- MEMLIMIT) != 0) {
245
- printf("pwhash_str(2) failure\n");
246
- return 1;
243
+ if (crypto_pwhash_argon2i_str(str_out2, passwd, strlen(passwd), OPSLIMIT,
244
+ MEMLIMIT) != 0) {
245
+ printf("pwhash_argon2i_str(2) failure\n");
247
246
  }
248
247
  if (strcmp(str_out, str_out2) == 0) {
249
- printf("pwhash_str() doesn't generate different salts\n");
248
+ printf("pwhash_argon2i_str() doesn't generate different salts\n");
249
+ }
250
+ if (crypto_pwhash_argon2i_str_needs_rehash(str_out, OPSLIMIT, MEMLIMIT) != 0) {
251
+ printf("needs_rehash() false positive\n");
252
+ }
253
+ if (crypto_pwhash_argon2i_str_needs_rehash(str_out, OPSLIMIT, MEMLIMIT / 2) != 1 ||
254
+ crypto_pwhash_argon2i_str_needs_rehash(str_out, OPSLIMIT / 2, MEMLIMIT) != 1 ||
255
+ crypto_pwhash_argon2i_str_needs_rehash(str_out, OPSLIMIT, MEMLIMIT * 2) != 1 ||
256
+ crypto_pwhash_argon2i_str_needs_rehash(str_out, OPSLIMIT * 2, MEMLIMIT) != 1) {
257
+ printf("needs_rehash() false negative\n");
258
+ }
259
+ if (crypto_pwhash_argon2i_str_needs_rehash(str_out + 1, OPSLIMIT, MEMLIMIT) != -1) {
260
+ printf("needs_rehash() didn't fail with an invalid hash string\n");
250
261
  }
251
262
  if (sodium_is_zero((const unsigned char *) str_out + strlen(str_out),
252
263
  crypto_pwhash_STRBYTES - strlen(str_out)) != 1 ||
@@ -254,39 +265,37 @@ main(void)
254
265
  crypto_pwhash_STRBYTES - strlen(str_out2)) != 1) {
255
266
  printf("pwhash_str() doesn't properly pad with zeros\n");
256
267
  }
257
- if (crypto_pwhash_str_verify(str_out, passwd, strlen(passwd)) != 0) {
268
+ if (crypto_pwhash_argon2i_str_verify(str_out, passwd, strlen(passwd)) != 0) {
258
269
  printf("pwhash_str_verify(1) failure\n");
259
270
  }
260
271
  str_out[14]++;
261
- if (crypto_pwhash_str_verify(str_out, passwd, strlen(passwd)) != -1) {
272
+ if (crypto_pwhash_argon2i_str_verify(str_out, passwd, strlen(passwd)) != -1) {
262
273
  printf("pwhash_str_verify(2) failure\n");
263
274
  }
264
275
  str_out[14]--;
265
276
  assert(str_out[crypto_pwhash_STRBYTES - 1U] == 0);
266
277
 
267
- if (crypto_pwhash_str(str_out2, passwd, 0x100000000ULL, OPSLIMIT,
268
- MEMLIMIT) != -1) {
278
+ if (crypto_pwhash_argon2i_str(str_out2, passwd, 0x100000000ULL, OPSLIMIT,
279
+ MEMLIMIT) != -1) {
269
280
  printf("pwhash_str() with a large password should have failed\n");
270
- return 1;
271
281
  }
272
- if (crypto_pwhash_str(str_out2, passwd, strlen(passwd), 1, MEMLIMIT) !=
282
+ if (crypto_pwhash_argon2i_str(str_out2, passwd, strlen(passwd), 1, MEMLIMIT) !=
273
283
  -1) {
274
284
  printf("pwhash_str() with a small opslimit should have failed\n");
275
- return 1;
276
285
  }
277
- if (crypto_pwhash_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
278
- "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
279
- "password", 0x100000000ULL) != -1) {
286
+ if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
287
+ "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
288
+ "password", 0x100000000ULL) != -1) {
280
289
  printf("pwhash_str_verify(invalid(0)) failure\n");
281
290
  }
282
- if (crypto_pwhash_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
291
+ if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
283
292
  "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
284
293
  "password", strlen("password")) != -1) {
285
294
  printf("pwhash_str_verify(invalid(1)) failure %d\n", errno);
286
295
  }
287
- if (crypto_pwhash_str_verify("$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
288
- "9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
289
- "password", strlen("password")) != -1) {
296
+ if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
297
+ "9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
298
+ "password", strlen("password")) != -1) {
290
299
  printf("pwhash_str_verify(invalid(2)) failure\n");
291
300
  }
292
301
  if (crypto_pwhash_str_verify("$argon2i$m=65536,t=2,p=1$c29tZXNhbHQ"
@@ -333,85 +342,103 @@ main(void)
333
342
  "password", strlen("password")) != -1 || errno != EINVAL) {
334
343
  printf("pwhash_str_verify(invalid(9)) failure\n");
335
344
  }
336
- assert(crypto_pwhash_bytes_min() > 0U);
337
- assert(crypto_pwhash_bytes_max() > crypto_pwhash_bytes_min());
338
- assert(crypto_pwhash_passwd_max() > crypto_pwhash_passwd_min());
339
- assert(crypto_pwhash_saltbytes() > 0U);
340
- assert(crypto_pwhash_strbytes() > 1U);
341
- assert(crypto_pwhash_strbytes() > strlen(crypto_pwhash_strprefix()));
345
+ if (crypto_pwhash_str_verify(
346
+ "$argon2i$v=1$m=4096,t=3,p=2$b2RpZHVla~=mRpc29kaXNrdw"
347
+ "$TNnWIwlu1061JHrnCqIAmjs3huSxYIU+0jWipu7Kc9M",
348
+ "password", strlen("password")) != -1 || errno != EINVAL) {
349
+ printf("pwhash_str_verify(invalid(10)) failure\n");
350
+ }
351
+ if (crypto_pwhash_str_verify(
352
+ "$argon2i$v=1$m=4096,t=3,p=2$b2RpZHVlamRpc29kaXNrdw"
353
+ "$TNnWIwlu1061JHrnCqIAmjs3huSxYI~=U+0jWipu7Kc9M",
354
+ "password", strlen("password")) != -1 || errno != EINVAL) {
355
+ printf("pwhash_str_verify(invalid(11)) failure\n");
356
+ }
357
+ assert(crypto_pwhash_str_alg(str_out, "test", 4, OPSLIMIT, MEMLIMIT,
358
+ crypto_pwhash_ALG_ARGON2I13) == 0);
359
+ assert(crypto_pwhash_argon2i_str_verify(str_out, "test", 4) == 0);
360
+ assert(crypto_pwhash_argon2i_str_needs_rehash(str_out,
361
+ OPSLIMIT, MEMLIMIT) == 0);
362
+ assert(crypto_pwhash_argon2i_str_needs_rehash(str_out,
363
+ OPSLIMIT / 2, MEMLIMIT) == 1);
364
+ assert(crypto_pwhash_argon2i_str_needs_rehash(str_out,
365
+ OPSLIMIT, MEMLIMIT / 2) == 1);
366
+ assert(crypto_pwhash_argon2i_str_needs_rehash(str_out, 0, 0) == 1);
367
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out, 0, 0) == -1);
368
+ assert(crypto_pwhash_argon2i_str_needs_rehash(str_out + 1,
369
+ OPSLIMIT, MEMLIMIT) == -1);
370
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out, 0, 0) == -1);
371
+ assert(crypto_pwhash_argon2id_str_needs_rehash("", OPSLIMIT, MEMLIMIT) == -1);
372
+ assert(crypto_pwhash_str_alg(str_out, "test", 4, OPSLIMIT, MEMLIMIT,
373
+ crypto_pwhash_ALG_ARGON2ID13) == 0);
374
+ assert(crypto_pwhash_argon2id_str_verify(str_out, "test", 4) == 0);
375
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out,
376
+ OPSLIMIT, MEMLIMIT) == 0);
377
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out,
378
+ OPSLIMIT / 2, MEMLIMIT) == 1);
379
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out,
380
+ OPSLIMIT, MEMLIMIT / 2) == 1);
381
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out, 0, 0) == 1);
382
+ assert(crypto_pwhash_argon2i_str_needs_rehash(str_out, 0, 0) == -1);
383
+ assert(crypto_pwhash_argon2id_str_needs_rehash("", OPSLIMIT, MEMLIMIT) == -1);
384
+ assert(crypto_pwhash_argon2id_str_needs_rehash(str_out + 1,
385
+ OPSLIMIT, MEMLIMIT) == -1);
386
+ sodium_free(salt);
387
+ sodium_free(str_out);
388
+ sodium_free(str_out2);
389
+ }
342
390
 
343
- assert(crypto_pwhash_opslimit_min() > 0U);
344
- assert(crypto_pwhash_opslimit_max() > 0U);
345
- assert(crypto_pwhash_memlimit_min() > 0U);
346
- assert(crypto_pwhash_memlimit_max() > 0U);
347
- assert(crypto_pwhash_opslimit_interactive() > 0U);
348
- assert(crypto_pwhash_memlimit_interactive() > 0U);
349
- assert(crypto_pwhash_opslimit_moderate() > 0U);
350
- assert(crypto_pwhash_memlimit_moderate() > 0U);
351
- assert(crypto_pwhash_opslimit_sensitive() > 0U);
352
- assert(crypto_pwhash_memlimit_sensitive() > 0U);
353
- assert(strcmp(crypto_pwhash_primitive(), "argon2i") == 0);
391
+ int
392
+ main(void)
393
+ {
394
+ tv();
395
+ tv2();
396
+ tv3();
397
+ str_tests();
398
+
399
+ assert(crypto_pwhash_argon2i_bytes_min() > 0U);
400
+ assert(crypto_pwhash_argon2i_bytes_max() > crypto_pwhash_argon2i_bytes_min());
401
+ assert(crypto_pwhash_argon2i_passwd_max() > crypto_pwhash_argon2i_passwd_min());
402
+ assert(crypto_pwhash_argon2i_saltbytes() > 0U);
403
+ assert(crypto_pwhash_argon2i_strbytes() > 1U);
404
+ assert(crypto_pwhash_argon2i_strbytes() > strlen(crypto_pwhash_argon2i_strprefix()));
354
405
 
355
- assert(crypto_pwhash_bytes_min() == crypto_pwhash_BYTES_MIN);
356
- assert(crypto_pwhash_bytes_max() == crypto_pwhash_BYTES_MAX);
357
- assert(crypto_pwhash_passwd_min() == crypto_pwhash_PASSWD_MIN);
358
- assert(crypto_pwhash_passwd_max() == crypto_pwhash_PASSWD_MAX);
359
- assert(crypto_pwhash_saltbytes() == crypto_pwhash_SALTBYTES);
360
- assert(crypto_pwhash_strbytes() == crypto_pwhash_STRBYTES);
406
+ assert(crypto_pwhash_argon2i_opslimit_min() > 0U);
407
+ assert(crypto_pwhash_argon2i_opslimit_max() > 0U);
408
+ assert(crypto_pwhash_argon2i_memlimit_min() > 0U);
409
+ assert(crypto_pwhash_argon2i_memlimit_max() > 0U);
410
+ assert(crypto_pwhash_argon2i_opslimit_interactive() > 0U);
411
+ assert(crypto_pwhash_argon2i_memlimit_interactive() > 0U);
412
+ assert(crypto_pwhash_argon2i_opslimit_moderate() > 0U);
413
+ assert(crypto_pwhash_argon2i_memlimit_moderate() > 0U);
414
+ assert(crypto_pwhash_argon2i_opslimit_sensitive() > 0U);
415
+ assert(crypto_pwhash_argon2i_memlimit_sensitive() > 0U);
361
416
 
362
- assert(crypto_pwhash_opslimit_min() == crypto_pwhash_OPSLIMIT_MIN);
363
- assert(crypto_pwhash_opslimit_max() == crypto_pwhash_OPSLIMIT_MAX);
364
- assert(crypto_pwhash_memlimit_min() == crypto_pwhash_MEMLIMIT_MIN);
365
- assert(crypto_pwhash_memlimit_max() == crypto_pwhash_MEMLIMIT_MAX);
366
- assert(crypto_pwhash_opslimit_interactive() ==
367
- crypto_pwhash_OPSLIMIT_INTERACTIVE);
368
- assert(crypto_pwhash_memlimit_interactive() ==
369
- crypto_pwhash_MEMLIMIT_INTERACTIVE);
370
- assert(crypto_pwhash_opslimit_moderate() ==
371
- crypto_pwhash_OPSLIMIT_MODERATE);
372
- assert(crypto_pwhash_memlimit_moderate() ==
373
- crypto_pwhash_MEMLIMIT_MODERATE);
374
- assert(crypto_pwhash_opslimit_sensitive() ==
375
- crypto_pwhash_OPSLIMIT_SENSITIVE);
376
- assert(crypto_pwhash_memlimit_sensitive() ==
377
- crypto_pwhash_MEMLIMIT_SENSITIVE);
417
+ assert(crypto_pwhash_argon2i_bytes_min() == crypto_pwhash_argon2i_BYTES_MIN);
418
+ assert(crypto_pwhash_argon2i_bytes_max() == crypto_pwhash_argon2i_BYTES_MAX);
419
+ assert(crypto_pwhash_argon2i_passwd_min() == crypto_pwhash_argon2i_PASSWD_MIN);
420
+ assert(crypto_pwhash_argon2i_passwd_max() == crypto_pwhash_argon2i_PASSWD_MAX);
421
+ assert(crypto_pwhash_argon2i_saltbytes() == crypto_pwhash_argon2i_SALTBYTES);
422
+ assert(crypto_pwhash_argon2i_strbytes() == crypto_pwhash_argon2i_STRBYTES);
378
423
 
379
- assert(crypto_pwhash_argon2i_bytes_min() == crypto_pwhash_bytes_min());
380
- assert(crypto_pwhash_argon2i_bytes_max() == crypto_pwhash_bytes_max());
381
- assert(crypto_pwhash_argon2i_passwd_min() == crypto_pwhash_passwd_min());
382
- assert(crypto_pwhash_argon2i_passwd_max() == crypto_pwhash_passwd_max());
383
- assert(crypto_pwhash_argon2i_saltbytes() == crypto_pwhash_saltbytes());
384
- assert(crypto_pwhash_argon2i_strbytes() == crypto_pwhash_strbytes());
385
- assert(strcmp(crypto_pwhash_argon2i_strprefix(),
386
- crypto_pwhash_strprefix()) == 0);
387
- assert(crypto_pwhash_argon2i_opslimit_min() ==
388
- crypto_pwhash_opslimit_min());
389
- assert(crypto_pwhash_argon2i_opslimit_max() ==
390
- crypto_pwhash_opslimit_max());
391
- assert(crypto_pwhash_argon2i_memlimit_min() ==
392
- crypto_pwhash_memlimit_min());
393
- assert(crypto_pwhash_argon2i_memlimit_max() ==
394
- crypto_pwhash_memlimit_max());
424
+ assert(crypto_pwhash_argon2i_opslimit_min() == crypto_pwhash_argon2i_OPSLIMIT_MIN);
425
+ assert(crypto_pwhash_argon2i_opslimit_max() == crypto_pwhash_argon2i_OPSLIMIT_MAX);
426
+ assert(crypto_pwhash_argon2i_memlimit_min() == crypto_pwhash_argon2i_MEMLIMIT_MIN);
427
+ assert(crypto_pwhash_argon2i_memlimit_max() == crypto_pwhash_argon2i_MEMLIMIT_MAX);
395
428
  assert(crypto_pwhash_argon2i_opslimit_interactive() ==
396
- crypto_pwhash_opslimit_interactive());
397
- assert(crypto_pwhash_argon2i_opslimit_moderate() ==
398
- crypto_pwhash_opslimit_moderate());
399
- assert(crypto_pwhash_argon2i_opslimit_sensitive() ==
400
- crypto_pwhash_opslimit_sensitive());
429
+ crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE);
401
430
  assert(crypto_pwhash_argon2i_memlimit_interactive() ==
402
- crypto_pwhash_memlimit_interactive());
431
+ crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE);
432
+ assert(crypto_pwhash_argon2i_opslimit_moderate() ==
433
+ crypto_pwhash_argon2i_OPSLIMIT_MODERATE);
403
434
  assert(crypto_pwhash_argon2i_memlimit_moderate() ==
404
- crypto_pwhash_memlimit_moderate());
435
+ crypto_pwhash_argon2i_MEMLIMIT_MODERATE);
436
+ assert(crypto_pwhash_argon2i_opslimit_sensitive() ==
437
+ crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE);
405
438
  assert(crypto_pwhash_argon2i_memlimit_sensitive() ==
406
- crypto_pwhash_memlimit_sensitive());
407
- assert(crypto_pwhash_alg_argon2i13() ==
408
- crypto_pwhash_argon2i_alg_argon2i13());
409
- assert(crypto_pwhash_alg_argon2i13() == crypto_pwhash_ALG_ARGON2I13);
410
- assert(crypto_pwhash_alg_argon2i13() == crypto_pwhash_alg_default());
439
+ crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE);
411
440
 
412
- sodium_free(salt);
413
- sodium_free(str_out);
414
- sodium_free(str_out2);
441
+ assert(crypto_pwhash_argon2i_alg_argon2i13() == crypto_pwhash_argon2i_ALG_ARGON2I13);
415
442
 
416
443
  printf("OK\n");
417
444