Commit Graph
1445 Commits
Author SHA1 Message Date
Frank Denis c72ef48f01 Static-ify what we currently don't need in crypto_core/curve25519_ref10 2017-08-31 21:08:59 +02:00
Frank Denis 5c8b8ea01c Simplify 2017-08-31 20:14:16 +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 e236df63e1 Trim empty lines 2017-08-26 17:56:18 +02:00
Frank Denis 75cfcf208c Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium:
  Do not clear the padding (for alignment) section of a blake2b state
2017-08-26 17:48:13 +02:00
Frank Denis e40e0f6ddb Adjust secretstream_..._rekey() after e84336ac 2017-08-26 17:47:41 +02:00
Frank Denis 514150d8b3 Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium:
  Remove RUNNING_JS_OPTS for WebAssembly
  chmod +x *.sh
  chmod +x *.sh
  One more compiler assertion
  secretstream: assume the internal nonce is little endian
  Test sodium_pad() with a NULL pointer
  Regen emscripten symbols
  messagesbytes -> messagebytes
  Have generate-emscripten-symbols.sh automatically update the js/wasm build script
  Add secretstream constants
  salsa208: messagebyte -> messagebytes
  constcheck: grab a few more constants
  Update emscripten symbols list
  Update emscripten symbols list
  Bump
  Accept a NULL pointer for the padded length in sodium_pad()
2017-08-26 08:25:27 +02:00
Frank Denis 394e21884c Do not clear the padding (for alignment) section of a blake2b state
So that it's acceptable for an application to provide a state that
doesn't include padding.
2017-08-26 08:19:58 +02:00
Frank Denis ce2ecc5966 One more compiler assertion 2017-08-25 16:21:20 +02:00
Frank Denis e84336ac48 secretstream: assume the internal nonce is little endian
Put the counter before the random part of the nonce instead of after
2017-08-25 16:03:07 +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 49f1d87cfe salsa208: messagebyte -> messagebytes
Spotted by constcheck
2017-08-25 14:50:24 +02:00
Frank Denis be58b2e666 Accept a NULL pointer for the padded length in sodium_pad() 2017-08-24 15:49:50 +02:00
Frank Denis d5574a69fa Complete sodium_pad/unpad() and add a couple tests 2017-08-17 20:54:20 +02:00
Frank Denis b9ed93fcb8 Change the sodium_pad() API to accept a maximum buffer length
Of course, this is not required. Just like `strcat()` can be used
safely. But since the cost of this extra check is negligible, better
return `-1` than potentially overwrite unrelated memory locations.
2017-08-17 17:23:53 +02:00
Frank Denis 4fd66e3ad7 Name similar things the same way in sodium_pad() and sodium_unpad() 2017-08-17 14:13:13 +02:00
Frank Denis 50c7632cc3 + sodium_pad() / sodium_unpad() 2017-08-17 14:05:23 +02:00
Frank Denis 55a578d625 Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium:
  + Firefox
  Some notes about RtlGenRandom
  Format paragraphs
  Explain that sodium_misuse() still aborts by default
  + crypto_secretstream_*()
  THANKS += PIA
2017-08-16 22:06:59 +02:00
Frank Denis b277148983 Reorder crypto_secretstream_*() prototypes in a more intuitive sequence 2017-08-16 22:06:22 +02:00
Frank Denis c3b315ec76 + Firefox 2017-08-16 21:12:48 +02:00
Frank Denis 80296be947 Some notes about RtlGenRandom 2017-08-16 20:58:22 +02:00
Frank Denis 6e8e0a93f9 Add a couple tests for crypto_secretstream_*() 2017-08-16 14:53:54 +02:00
Frank Denis 88c0b6538f Trigger sodium_misuse() if mlen > secretstream_MESSAGESBYTES_MAX 2017-08-16 13:59:56 +02:00
Frank Denis 72d5d506d5 Sort 2017-08-16 13:58:36 +02:00
Frank Denis df7ad26328 Introduce a new crypto_secretstream_*() API
No high-level API yet, since there is no high-level AEAD API.
2017-08-16 13:26:23 +02:00
Frank Denis 100a055a54 Indent 2017-08-12 16:38:11 +02:00
Frank Denis 76995c52ff Argon2: use sodium_{bin2base64,base642bin} instead of a private implementation 2017-08-09 22:41:26 +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 ad5a5232a2 Make that a size_t 2017-08-09 16:07:10 +02:00
Frank Denis cdbb43f444 base64 tests 2017-08-09 15:56:58 +02:00
Frank Denis eb84b00b75 glibc requires <stdint.h> for SIZE_MAX 2017-08-09 02:09:46 +02:00
Frank Denis 3f272cbbfc Add a base64 codec, due to popular request
I still think that base64 is awful, but users have spoken.
2017-08-09 01:54:57 +02:00
Frank Denis 308684790f Move the codecs from sodium/utils.c to a dedicated file 2017-08-09 01:38:14 +02:00
Frank Denis dd9416fd59 Doc 2017-08-08 14:28:12 +02:00
Frank Denis 5b141eb9ec Add some blank lines for readability 2017-08-06 19:17:25 +02:00
Frank Denis 7e91aa3f89 s/the// 2017-08-06 19:15:26 +02:00
Frank Denis 4baea3575b Merge branch 'master' of github.com:jedisct1/libsodium 2017-08-06 19:11:49 +02:00
Frank Denis 9b7db7c3f3 Document crypto_aead_aes256gcm_*() limitations 2017-08-06 19:11:19 +02:00
Frank Denis a894ec93f2 Add crypto_pwhash_str_alg() 2017-08-05 20:56:59 +02:00
Frank Denis e1fa9cc90c Add *_messagebytes_max() wrappers 2017-08-03 13:34:31 +02:00
Frank Denis f02770b2ad Revert "+ sodium_alloc_overhead()"
This reverts commit c5b61d8129.
2017-08-02 14:26:56 +02:00
Frank Denis c5b61d8129 + sodium_alloc_overhead() 2017-08-02 12:34:56 +02:00
Frank Denis c56fa3ccf9 Include private/common.h for COMPILER_ASSERT 2017-08-01 11:40:32 +02:00
Frank Denis 56eb70f8bb Sort 2017-08-01 10:38:23 +02:00
Frank Denis 6ac18dae42 The MESSAGEBYTES_MAX constants are to be used with the libsodium API
Projects using the legacy API are unlikely to use these new macros.
OTOH, people using the Sodium API would be puzzled about the missing
16 bytes in the secretbox and box APIs.

More importantly, these macros are designed for bindings.
Having these bindings enforce proper limits (for the *_easy API
that they all use) and yet have the underlying library call
sodium_misuse() would be sad.
2017-07-29 23:29:58 +02:00
Frank Denis 90bd94e4e4 Coverage exclusion 2017-07-29 22:31:13 +02:00
Frank Denis 3dd56fa91b Coverage exclusions 2017-07-29 22:07:36 +02:00
Frank Denis ff8bb6705a More tests for scrypt 2017-07-29 22:01:13 +02:00
Frank Denis 52bfc0325b Initialize the base&aligned addresses in argon2's allocate_memory
Also memzero() pseudo_rands, not the segments twice.
2017-07-29 18:54:52 +02:00