Commit Graph
1812 Commits
Author SHA1 Message Date
Frank Denis 899149f988 Shorten 2020-08-05 16:34:53 +02:00
Frank Denis e6d0a57061 Elligator - Faster Chi function 2020-06-15 10:41:59 +02:00
Frank Denis 2ea21b96e0 Don't even include signal.h on WASI
Since version 11, wasi-sysroot doesn't ignore it but spits out
an error instead.
2020-06-04 10:53:49 +02:00
Frank Denis c94c477f24 Faster sc25519 inversion, with one less squaring 2020-05-26 14:05:10 +02:00
Frank Denis c35437c2e5 Add extra box_seal() tests 2020-05-21 18:38:34 +02:00
Frank Denis 81a2655233 crypto_box_seal(): copy the key after encryption to support in-place encryption
Fixes #961
2020-05-21 18:25:27 +02:00
Frank Denis 5a300d6480 Remove unused code 2020-05-14 18:46:16 +02:00
Frank Denis be00e8d72b ristretto255_is_canonical(): sync with wasm-crypto
Reject string with the top bit set.
2020-04-25 12:18:19 +02:00
Frank Denis 8fbe4ceb64 Fix argument order 2020-04-23 15:40:50 +02:00
Frank Denis 9786e40501 Rename fe25519_scalar_product, use it for all multiplications by A 2020-04-23 11:16:05 +02:00
Frank Denis f931f37bb4 Replace deprecated function in test 2020-03-30 19:08:05 +02:00
Frank Denis 57e753130e Remove useless self inclusion 2020-03-28 20:38:54 +01:00
Frank Denis 3b689a6ab4 New automake version 2020-03-22 22:56:19 +01:00
Frank Denis d0ea7b549e Remove XOP stub
XOP is dead
2020-03-14 17:16:54 +01:00
Frank Denis a89940d4aa Reformat comments 2020-03-14 17:16:48 +01:00
Frank Denis a4e127567f Simplify integerify()
Make offsets 64 bit in the SSE scrypt impl
2020-03-14 17:16:37 +01:00
Loup Vaillant f1652acba2 Avoid memmove() call when buffers are already the same. (#935)
This completes the work started in commit
fbe3eb265f
2020-03-14 17:15:42 +01:00
Frank Denis 182415cb69 Remove sandy2x fixed base scalar multiplication
Thanks to precomputation, the generic implementation is faster.

Don't even define a .mult_base placeholder for sandy2x

Avoid two indirections for fixed base multiplication until another
implementation possibly exists.
2020-02-06 00:54:39 +01:00
Frank Denis d6961a93cc Set a default page size to 64K (wasm/linux large pages) 2020-01-05 21:00:00 -05:00
Frank Denis 1d4017df58 Regen 2019-11-11 01:08:03 +01:00
Frank Denis bfa866e2f0 Deprecate crypto_core_ed25519_from_hash() 2019-10-13 10:03:48 +02:00
Frank Denis c210fd558e Revert "Revert "Disable AVX512 Argon2 implementation on MacOS""
This reverts commit 495ebc26f6.
2019-07-24 00:18:06 +02:00
Frank Denis 495ebc26f6 Revert "Disable AVX512 Argon2 implementation on MacOS"
This reverts commit cf59da7cd4.
2019-07-23 18:18:33 +02:00
Frank Denis cf59da7cd4 Disable AVX512 Argon2 implementation on MacOS
Fixes #848
2019-07-23 16:24:41 +02:00
Frank Denis 53e20300e9 argon2_pick_best_implementation() can be static 2019-06-10 20:22:28 +02:00
Frank Denis 95cf2e5da1 Style: remove unneeded extern 2019-06-10 20:22:22 +02:00
Frank Denis b1f0e2eb1d common.h -> private/common.h 2019-06-10 18:40:39 +02:00
Frank Denis a4c41e5c8f Rename the remaining unprefixed functions
argon2_fill_first_blocks() can be static
2019-06-10 18:40:14 +02:00
Frank Denis 557c7eafab Rename fill_segment_* to argon2_fill_segment_* 2019-06-10 18:40:06 +02:00
Frank Denis a03e6bd16d Rename a few common internal symbols 2019-06-10 18:40:01 +02:00
Frank Denis d3787c23b8 Rename PBKDF2_SHA256 to escrypt_PBKDF2_SHA256 2019-06-10 18:39:53 +02:00
Frank Denis 7c44e6a8c4 Remove useless macros hiding the actual symbol names 2019-06-10 18:39:48 +02:00
Frank Denis 7ec812b83d Use MAP_CONCEAL on OpenBSD 2019-06-06 12:06:45 +02:00
Frank Denis c322b1a63c Revert "scrypt: reject r == 0 and p == 0"
This reverts commit 00c8ecd1c4.
2019-06-01 15:33:51 +02:00
Frank Denis 940ef42797 1.0.18 2019-05-30 21:57:51 +02:00
Frank Denis 575babb389 Comment 2019-05-30 17:33:59 +02:00
Frank Denis a53fbe4d48 10% speedup on AVX2 for BLAKE2b
Thanks to Shunsuke Shimizu (@grafi-tt)
2019-05-30 17:32:45 +02:00
Frank Denis eefb1cd79e Nits 2019-05-30 17:32:40 +02:00
Ilya Maykov 6bece9c8c4 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.

Only memset() may have issues with a zero length.

Fix tests, use guard page instead of NULL because of Wasm
2019-04-26 15:36:58 +02:00
Frank Denis daa6cb3e78 raise() may not be available 2019-03-26 14:38:55 +01:00
Frank Denis b347bcfa89 Remove unnecessary brackets 2019-03-26 13:45:28 +01:00
Frank Denis 01ed4737af Trust another safe arc4random() implementation 2019-03-26 13:44:28 +01:00
Frank Denis be509424e9 Typo 2019-02-09 20:49:52 +01:00
Luca Boccassi ecdcf55173 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

AC_SUBST doesn't require explicit values

Regen autoconf

Fixes #800
2019-01-15 00:29:20 +01:00
Frank Denis 59f55cd420 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:07:41 +01:00
Frank Denis 10ac185647 Merge branch 'master' into stable-1.0.17
* master: (190 commits)
  fileinput is not used any more
  2019
  local-dynamic is enough
  Set tls-model only if TLS is supported
  Enable -ftls-model=global-dynamic if available
  Set nonce in randombytes_salsa20_random_stir() instead of random_init()
  Bump .NET version examples
  Add another test
  Avoid memory leak and overflow in addition test
  Avoid partial array initialization
  Bump SODIUM_LIBRARY_VERSION_MINOR
  More tests
  More tests
  Improve clarity
  ALLOW_MEMORY_GROWTH is now enabled
  AVX512 detection has been improved
  Add a conditional to enable retpoline support
  must -> should
  Add comments, avoid implicit array initialization
  Add comments
  ...
2019-01-06 15:43:38 +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 531b545578 Avoid partial array initialization 2019-01-05 22:58:07 +01:00
Frank Denis 48852da7cd Improve clarity 2019-01-05 14:31:44 +01:00
Frank Denis 3ab71f873f must -> should 2019-01-04 11:55:17 +01:00