1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 12:36:01 -07:00
Commit Graph

3695 Commits

Author SHA1 Message Date
Frank Denis
b579de9ac7 Additional salsa20 tests 2019-03-21 01:15:13 +01:00
Frank Denis
32e36af97e Move the randombytes_block_on_dev_random() function up 2019-03-17 19:40:32 +01:00
Frank Denis
e1abc1de7e Rename randombytes_salsa20 to randombytes_internal and switch to ChaCha20 2019-03-17 19:25:32 +01:00
Frank Denis
0ea9a8f0e9 Use getentropy(2) if available, cleanup salsa20/randombytes by the way 2019-03-17 18:55:40 +01:00
Frank Denis
9c6ee44d93 Check for getentropy(2) 2019-03-17 17:51:11 +01:00
Frank Denis
5f4d7a0352 Check for the presence of a couple functions even in emscripten 2019-03-17 17:50:51 +01:00
Frank Denis
5880ea6c97 Don't enable the stack protector on unknown operating systems 2019-03-16 00:21:01 +01:00
Frank Denis
b5975f97e4 Nits 2019-02-23 21:32:23 +01:00
Frank Denis
eeb1f26924 Explicit cast 2019-02-20 01:02:54 +01:00
Frank Denis
d287ef763b Nits 2019-02-19 22:46:09 +01:00
Frank Denis
411ec2de84 Update emscripten symbols for ristretto 2019-02-18 14:10:43 +01:00
Frank Denis
1e847cc60b More tests 2019-02-18 11:10:51 +01:00
Frank Denis
db0319fb8e Initial support for ristretto255 2019-02-18 00:56:48 +01:00
Frank Denis
bc5e9056eb ge25519_select() -> ge25519_cmov8() 2019-02-16 17:44:01 +01:00
Frank Denis
e6aa7e1da4 The time has come to remove support for (p)nacl 2019-02-14 14:41:09 +01:00
Frank Denis
83a873ea1b Fix tests, use guard page instead of NULL because of Wasm 2019-02-09 20:47:24 +01:00
Frank Denis
d47ded1867 Only memset() may have issues with a zero length. 2019-02-09 20:28:41 +01:00
Ilya Maykov
6934a8d0c8 Relax most __attribute__ ((nonnull)) to allow 0-length inputs to be NULL.
Justifications:
- crypto_(auth|hash|generichash|onetimeauth|shorthash)*:
  it's legal to hash or HMAC a 0-length message
- crypto_box*: it's legal to encrypt a 0-length message
- crypto_sign*: it's legal to sign a 0-length message
- utils:
  comparing two 0-length byte arrays is legal
  memzero on a 0-length byte array is a no-op
  converting an empty hex string to binary results in an empty binary string
  converting an empty binary string to hex results in an empty hex string
  converting an empty b64 string to binary results in an empty binary string
  converting an empty binary string to b64 results in an empty b64 string
  sodium_add / sodium_sub on zero-length arrays is a no-op

For the functions declared in utils.h, I moved the logic into private functions that
have the __attribute__ ((nonnull)) check, but they are only called when the
corresponding length argument is non-0. I didn't do this for the hash/box/sign
functions since it would have been a lot more work and quite a large refactor.
2019-02-09 20:26:10 +01:00
Frank Denis
be1f8b4d67 Revert "Coverity Scan is having hosting issues"
This reverts commit c999d07255.
2019-01-30 18:45:53 +01:00
Frank Denis
05413d4ad3 Format 2019-01-16 18:18:45 +01:00
Frank Denis
2b43b3a829 sierra -> mojave 2019-01-16 18:18:05 +01:00
Frank Denis
c999d07255 Coverity Scan is having hosting issues
https://community.synopsys.com/s/article/Coverity-Scan-Update
2019-01-15 00:31:58 +01:00
Frank Denis
6954be914a AC_SUBST doesn't require explicit values 2019-01-15 00:24:01 +01:00
Luca Boccassi
3933a7402c Add -pthread to pkgconfig's Libs.private if enabled
Allows static builds to correctly inherit the pthread dependency when
used with pkg-config --static --libs libsodium
2019-01-14 23:43:02 +01:00
Frank Denis
b3725dc2c9 Force clear the high bit in _noclamp variants
_noclamp variants should always be used with a scalar < L, but
if this is not the case, at least explicitly ignore the high bit.
2019-01-14 04:02:48 +01:00
Frank Denis
3946784883 Try -ftree-vectorize and -ftree-slp-vectorize for optimized builds 2019-01-07 12:22:09 +01:00
Frank Denis
7eec5b8716 Back to dev mode 2019-01-07 11:48:14 +01:00
Frank Denis
b732443c44 undef _box_curve25519xchacha20poly1305_messagebytes_max in !sumo builds 2019-01-06 20:32:54 +01:00
Frank Denis
31ccbdec96 Nits 2019-01-06 18:43:38 +01:00
Frank Denis
4adf25c39f Bump DLL version 2019-01-06 17:25:35 +01:00
Frank Denis
0b3e2e5742 Offline documentation is only available in PDF format now 2019-01-06 15:55:36 +01:00
Frank Denis
a75c137020 fileinput is not used any more 2019-01-06 15:38:24 +01:00
Frank Denis
0cf74a3104 2019 2019-01-06 14:42:47 +01:00
Frank Denis
462e9a648b local-dynamic is enough 2019-01-06 05:04:34 +01:00
Frank Denis
79d6a211b2 Set tls-model only if TLS is supported 2019-01-06 04:52:41 +01:00
Frank Denis
0157a378ca Enable -ftls-model=global-dynamic if available 2019-01-06 04:45:50 +01:00
Frank Denis
358767f238 Set nonce in randombytes_salsa20_random_stir() instead of random_init() 2019-01-06 04:31:44 +01:00
Frank Denis
ab0932bf80 Bump .NET version examples 2019-01-06 03:50:18 +01:00
Frank Denis
0cdf963799 Add another test 2019-01-05 23:11:02 +01:00
Frank Denis
909983a9d2 Avoid memory leak and overflow in addition test 2019-01-05 23:08:03 +01:00
Frank Denis
531b545578 Avoid partial array initialization 2019-01-05 22:58:07 +01:00
Frank Denis
b7cb241eb9 Bump SODIUM_LIBRARY_VERSION_MINOR 2019-01-05 22:09:32 +01:00
Frank Denis
d4eec69ef1 More tests 2019-01-05 21:17:48 +01:00
Frank Denis
0205a8035e More tests 2019-01-05 20:56:22 +01:00
Frank Denis
48852da7cd Improve clarity 2019-01-05 14:31:44 +01:00
Frank Denis
f5c14a46d0 ALLOW_MEMORY_GROWTH is now enabled 2019-01-04 18:36:15 +01:00
Frank Denis
a04f09298d AVX512 detection has been improved 2019-01-04 12:52:59 +01:00
Frank Denis
a01c5f8fd8 Add a conditional to enable retpoline support
Using retpoline in userland code that doesn't run arbitrary code is
questionable to start with.

Linux is also getting SPECTRE v2 userspace-to-userspace protection.

In addition, some platforms have a gcc version that advertises
support for retpolines, but the resulting binaries simply don't work
or cannot be linked.

So, do not enable this by default. Let builders choose if they
really want to enable this in their builds.
2019-01-04 12:43:47 +01:00
Frank Denis
3ab71f873f must -> should 2019-01-04 11:55:17 +01:00
Frank Denis
e45fadffb1 Add comments, avoid implicit array initialization 2019-01-03 22:44:58 +01:00