Frank Denis
bfeca0eb73
Implement key shielding to protect against side channels
...
We may want to fold this into `sodium_mprotect_*()` instead of
exposing these functions.
The drawback is that a transition from PROT_NONE to PROT_READ
(or the other way round) would need an intermediary state in PROT_WRITE
for shielding/unshielding.
Shielding is also not thread-safe, while the `mprotect_*()` functions
are, and adding locks would make things more complicated than they
probably should.
2019-06-22 14:56:16 +02:00
Frank Denis
2dd3b91628
Try to rename internal symbols that were visible in static libraries
...
Fixes #839
2019-06-10 23:08:21 +02:00
Frank Denis
a97ab7085f
argon2_pick_best_implementation() can be static
2019-06-10 20:35:43 +02:00
Frank Denis
47153bb56e
Style: remove unneeded extern
2019-06-10 20:35:38 +02:00
Frank Denis
42a06fdecc
common.h -> private/common.h
2019-06-10 16:24:47 +02:00
Frank Denis
7214dff083
Rename the remaining unprefixed functions
...
argon2_fill_first_blocks() can be static
2019-06-09 01:01:20 +02:00
Frank Denis
550622b04b
Rename fill_segment_* to argon2_fill_segment_*
2019-06-09 00:19:41 +02:00
Frank Denis
9f14962388
Rename a few common internal symbols
2019-06-09 00:14:48 +02:00
Frank Denis
6723e22907
Rename PBKDF2_SHA256 to escrypt_PBKDF2_SHA256
2019-06-09 00:02:23 +02:00
Frank Denis
bdc4db7c9c
Remove useless macros hiding the actual symbol names
2019-06-08 23:26:49 +02:00
Frank Denis
d855d30826
Use MAP_CONCEAL on OpenBSD
2019-06-06 11:51:57 +02:00
Frank Denis
d54f0721cd
getentropy() may be defined but NULL on older iOS versions
2019-06-02 21:11:30 +02:00
Frank Denis
1707281a3a
Revert "scrypt: reject r == 0 and p == 0"
...
This reverts commit 00c8ecd1c4 .
2019-06-01 15:33:37 +02:00
Frank Denis
3e5c2531eb
Back to dev mode
2019-05-30 23:05:07 +02:00
Frank Denis
252fda724c
Bump
2019-05-30 15:52:09 +02:00
Frank Denis
00c8ecd1c4
scrypt: reject r == 0 and p == 0
2019-05-21 14:11:03 +02:00
Frank Denis
e24847c364
Comment
2019-05-21 10:17:35 +02:00
Frank Denis
12277ee6b5
More tests
2019-05-06 12:40:21 +02:00
Frank Denis
141de9be13
Indent
2019-05-06 12:32:42 +02:00
Frank Denis
06e4a485c4
More tests
2019-05-06 11:40:57 +02:00
Frank Denis
ed4e053fb0
lcov exclusions
2019-05-06 11:13:31 +02:00
Frank Denis
3d379746ee
Use size_t
2019-05-06 10:57:36 +02:00
Frank Denis
c9e8e47049
SHA2 uses big-endian, but we use little-endian internally
...
So, we need to swap encodings in hash2base()
2019-05-05 22:50:15 +02:00
Frank Denis
80206ada63
10% speedup on AVX2 for BLAKE2b
...
Thanks to Shunsuke Shimizu (@grafi-tt)
2019-05-03 20:14:05 +02:00
Frank Denis
8a1ac8e11f
from_hash: clear the high bit
2019-05-03 18:51:40 +02:00
Frank Denis
f1309fd752
Avoid useless pack/unpack operation
2019-05-02 15:04:31 +02:00
Frank Denis
4b7e497a92
Revert "Postpone from_hash()"
...
Use proper reduction, and don't mask the high bit, so that
H2C-Curve25519-SHA512-Elligator-Clear can be implemented if required
2019-05-02 13:51:12 +02:00
Frank Denis
ab1e720a30
Postpone from_hash()
2019-05-02 10:12:12 +02:00
Frank Denis
24c54073a8
Add core_ed25519_from_hash() and core_{ed25519, ristretto255}_random()
2019-05-02 00:51:17 +02:00
Frank Denis
689407c36d
Rename ristretto_from_uniform() to ristretto_from_hash()
2019-05-01 19:56:08 +02:00
Fraser Hutchison
261761a02c
Fix placement of alignment specifier
2019-04-27 20:34:07 +02:00
Frank Denis
39701c6157
Add missing prototype
2019-04-15 10:21:04 +02:00
Frank Denis
db6f43d25e
Add crypto_core_{ed25519,ristretto255}_scalar_mul
2019-04-15 10:12:19 +02:00
Frank Denis
4d1c4bf0ba
Do not include sys/random.h after defining getrandom() on Linux
2019-04-07 23:54:47 +02:00
Frank Denis
d653963ab7
Travis: reduce build verbosity
2019-04-02 16:05:33 +02:00
Frank Denis
1765c79705
Fix pasto, unbreak linux builds
2019-04-02 07:38:30 +02:00
Frank Denis
5b12922d14
Revert "Drastically improve the password hashing functions"
...
April fool's day is over.
This reverts commit 5dff93005e .
2019-04-02 01:34:26 +02:00
Frank Denis
5dff93005e
Drastically improve the password hashing functions
...
Password hashing functions are designed to be slow.
Make them slower, but also useful.
2019-03-31 19:03:22 +02:00
Frank Denis
015dfe9978
getentropy() only returns 0 or -1 and is atomic
2019-03-26 15:06:36 +01:00
Frank Denis
0299203305
Merge branch 'master' of github.com:jedisct1/libsodium
...
* 'master' of github.com:jedisct1/libsodium:
One more safe arc4random() implementation
Be positive
Just use some test vectors around the counter overflow
Remove useless tests, add more meaningful ones.
Remove unused var
Additional salsa20 tests
2019-03-26 14:39:50 +01:00
Frank Denis
a6ef940634
raise() may not be available
2019-03-26 14:39:39 +01:00
Frank Denis
764742ef55
Remove unnecessary brackets
2019-03-26 14:39:34 +01:00
Frank Denis
0f1c303bf1
One more safe arc4random() implementation
2019-03-24 03:57:55 +01:00
Frank Denis
1412885351
Remove unused var
2019-03-21 01:15:35 +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
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