Commit Graph

1474 Commits

Author SHA1 Message Date
Frank Denis
a029b352af Don't generate SSE2 code if that instruction set hasn't been enabled 2017-09-17 18:23:31 +02:00
Frank Denis
09fd953fce Revert "__SSE2__ may need to be explicitly enabled"
This reverts commit 35d8aa5d3e.
2017-09-17 18:19:57 +02:00
Frank Denis
35d8aa5d3e __SSE2__ may need to be explicitly enabled 2017-09-17 18:15:18 +02:00
Frank Denis
a161dd9fa1 On 32-bit systems, the limit is SIZE_MAX 2017-09-17 16:36:01 +02:00
Frank Denis
d8a8201bb2 Avoid "in" and "out". Use "c" to represent the ciphertext. 2017-09-16 23:43:46 +02:00
Frank Denis
1181a47cb4 Proper xchacha20poly1305_MESSAGEBYTES_MAX definition 2017-09-16 23:37:52 +02:00
Frank Denis
bfab44aa40 initbytes -> headerbytes for clarity 2017-09-16 23:21:28 +02:00
Frank Denis
e8f1c0be66 secretstream: use "header" instead of "in" and "out" for clarity 2017-09-16 23:15:28 +02:00
Frank Denis
9e0ff55ebd Add the ability to use only strong symbols, even on ELF targets 2017-09-15 18:52:04 +02:00
Frank Denis
b0420b32d7 Define SODIUM_EXPORT_WEAK instead of adding __attribute__((weak)) tags 2017-09-15 18:28:42 +02:00
Frank Denis
3df3fabb87 No default clause needed 2017-09-15 15:43:16 +02:00
Frank Denis
383705ffc2 The AVX512 optimized BLAKE2B implementation hasn't been imported yet 2017-09-15 13:15:43 +02:00
Frank Denis
dcd60ba661 Force inline 2017-09-15 00:06:37 +02:00
Frank Denis
5cc334b33c Add AVX512F optimized Argon2 implementation 2017-09-15 00:04:18 +02:00
Frank Denis
6866b3d555 Use macros instead of magic numbers 2017-09-13 23:42:21 +02:00
Frank Denis
1c0677b09f Check for AVX512F support 2017-09-13 23:35:20 +02:00
Frank Denis
62c41c703e Avoid untagged unions 2017-09-13 12:42:00 +02:00
Frank Denis
5cf1de94ad Remove trailing coma 2017-09-13 12:03:24 +02:00
Frank Denis
3aa1c71de1 Don't return void 2017-09-13 11:43:39 +02:00
Frank Denis
d0a418a863 + _crypto_pwhash_scryptsalsa208sha256_str_needs_rehash() 2017-09-13 00:36:29 +02:00
Frank Denis
0ae678b0f9 Avoid multiple declarations in an EN_ASM({}) block
Some emscripten versions don't seem to support it.
2017-09-11 11:49:59 +02:00
Frank Denis
b26de68a67 Use single quotes inside EM_ASM 2017-09-11 02:13:38 +02:00
Frank Denis
1aae564da3 Avoid duplicate initializations; reorder for consistency w/ decl 2017-09-10 22:19:51 +02:00
Frank Denis
81cf1ff6d1 Use unsigned for loop counters 2017-09-10 22:15:23 +02:00
Frank Denis
e2efa6d7e0 Remove unused variable 2017-09-10 22:09:06 +02:00
Frank Denis
e06c70afe8 Use the dedicated type for the argon2 type id 2017-09-07 13:53:21 +02:00
Frank Denis
e8828eef79 Don't bother verifying hashes whose length is >= crypto_pwhash_STRBYTES 2017-09-06 20:26:36 +02:00
Frank Denis
7cc4825231 Add crypto_pwhash_str_needs_rehash() 2017-09-06 20:08:20 +02:00
Frank Denis
c65189a0cb Explicit casts 2017-09-06 16:04:28 +02:00
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