Commit Graph

496 Commits

Author SHA1 Message Date
Frank Denis
3e0b4dec6e Add sodium_base64_encoded_len() 2017-09-21 11:25:09 +02:00
Frank Denis
18f0fff89e More tests: verify that they key gets updated after the counter wraps 2017-09-20 17:10:10 +02:00
Frank Denis
ee1d5c96d8 Move the codecs tests to their own test file 2017-09-19 22:51:05 +02:00
Frank Denis
558355e566 Check if SIGABRT can be trapped multiple times in a row 2017-09-19 22:33:09 +02:00
Frank Denis
8ee67b1dd7 More tests 2017-09-19 22:19:50 +02:00
Frank Denis
1f72dec89d More tests 2017-09-19 22:17:10 +02:00
Frank Denis
41dc933226 More tests 2017-09-19 22:08:31 +02:00
Frank Denis
aec433cecc Additional check 2017-09-19 20:04:57 +02:00
Frank Denis
7423408cd3 Make the behavior of hex2bin() consistent with base642bin()
Return -1 on incomplete sequences and on complete sequences
with trailing, non-ignored characters if no pointers to store the
last parsed byte has been provided
2017-09-19 18:45:23 +02:00
Frank Denis
00660d79b9 secretstream test: don't pull twice if we don't test with AD 2017-09-19 17:32:15 +02:00
Frank Denis
3c8a7f17f0 Add tests for short, invalid unpadded base64 strings 2017-09-19 16:59:18 +02:00
Frank Denis
9209e89d96 More tests 2017-09-19 00:34:26 +02:00
Frank Denis
31e9a5541d More tests 2017-09-18 23:57:29 +02:00
Frank Denis
525c21ed10 Tests 2017-09-18 23:29:58 +02:00
Frank Denis
1875980d33 More tests 2017-09-18 23:18:46 +02:00
Frank Denis
5b9680ead6 More tests 2017-09-18 23:13:50 +02:00
Frank Denis
e878bc141b More keygen tests 2017-09-17 23:13:38 +02:00
Frank Denis
f244f658d6 int -> size_t 2017-09-17 23:13:27 +02:00
Frank Denis
9c53da4a6d metamorphic tests for HMAC 2017-09-17 21:55:29 +02:00
Frank Denis
bd69a3083a metamorphic tests for onetimeauth 2017-09-17 21:48:16 +02:00
Frank Denis
a7b75a2d7d + simple metamorphic tests for crypto_generichash()
This needs to be extended to other APIs with a streaming interface
2017-09-17 21:41:32 +02:00
Frank Denis
bfab44aa40 initbytes -> headerbytes for clarity 2017-09-16 23:21:28 +02:00
Frank Denis
19496bcc01 Don't try to access /usr/local on Travis CI 2017-09-15 13:08:14 +02:00
Frank Denis
ca43a12683 Old tcc versions miscompile while (++in[x])
So, let's just keep things readable, even for compilers.
2017-09-15 12:58:47 +02:00
Frank Denis
10edd16b40 Modernize the core3 test 2017-09-15 12:39:18 +02:00
Frank Denis
c6aa04108e Move #ifdef up 2017-09-15 10:19:34 +02:00
Frank Denis
4aba976d5f Explicit casts 2017-09-15 01:00:43 +02:00
Frank Denis
15ee95c64c Remove unused var 2017-09-15 00:57:44 +02:00
Frank Denis
70f66c9a6d Check for avx/avx2/avx512f linkage 2017-09-14 00:05:37 +02:00
Frank Denis
390f865e35 Add tests for scrypt rehash 2017-09-13 18:47:55 +02:00
Frank Denis
2a2b85eeea Add tests for crypto_pwhash_str_needs_rehash() 2017-09-13 18:40:14 +02:00
Frank Denis
979b21d67b Remove extra semicolumns 2017-09-13 12:45:04 +02:00
Frank Denis
0af31aeb26 Fill the max output buffer size in sodium_bin2base64()
Unlike hex encoding, due to optional padding, computing the correct size is
not straightforward. Ensuring that the string ends with `\0` is fine, but
if the size is not exact, some unrelated data might be send around by the
application. So, zero it to be safe.
2017-08-31 19:32:14 +02:00
Frank Denis
fd4478288e Test sodium_pad() with a NULL pointer 2017-08-25 15:24:46 +02:00
Frank Denis
f8e535a446 messagesbytes -> messagebytes 2017-08-25 15:12:35 +02:00
Frank Denis
aa20d2e86e Add secretstream constants 2017-08-25 14:51:02 +02:00
Frank Denis
a0b9bc46e4 constcheck: grab a few more constants 2017-08-25 14:49:47 +02:00
Frank Denis
4c93d0391c C++ compat 2017-08-17 23:27:20 +02:00
Frank Denis
0850e55808 Check that a zero blocksize returns -1 2017-08-17 21:00:02 +02:00
Frank Denis
a27c18d0e8 No need for two buffers in the padding test 2017-08-17 20:58:14 +02:00
Frank Denis
d5574a69fa Complete sodium_pad/unpad() and add a couple tests 2017-08-17 20:54:20 +02:00
Frank Denis
6e8e0a93f9 Add a couple tests for crypto_secretstream_*() 2017-08-16 14:53:54 +02:00
Frank Denis
265bdcfe07 bin2hex & bin2base64: return a null size on error
This might prevent applications that don't properly check return codes
from reusing previous data.
2017-08-09 22:41:20 +02:00
Frank Denis
a6480aec44 b64 test: intentionally overestimate sizes
overflows will be caught by the guard page, if any
2017-08-09 18:03:56 +02:00
Frank Denis
74fd8fd1ce C++ compat 2017-08-09 16:08:03 +02:00
Frank Denis
cdbb43f444 base64 tests 2017-08-09 15:56:58 +02:00
Frank Denis
8f0953b31f Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium:
  Bench: don't tie the printed result to the number of iterations
  Make the number of iterations configurable; reduce the default
  Add an interesting test case for a custom randombytes_uniform implementation
  Add a benchmark mode
  randombytes test: restore the salsa20-based rng at the end, for benchmarks
  Indent
2017-08-05 20:58:23 +02:00
Frank Denis
a894ec93f2 Add crypto_pwhash_str_alg() 2017-08-05 20:56:59 +02:00
Frank Denis
cde31281d1 Bench: don't tie the printed result to the number of iterations 2017-08-04 23:30:30 +02:00
Frank Denis
6d59a5897d Make the number of iterations configurable; reduce the default 2017-08-04 23:16:42 +02:00