1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-21 02:55:10 -07:00
Commit Graph

1201 Commits

Author SHA1 Message Date
Frank Denis
184110ccc5 + crypto_box_curve25519xchacha20poly1305_* 2016-11-26 21:06:23 +01:00
Frank Denis
54a1357ce3 Indent 2016-11-26 20:24:58 +01:00
Frank Denis
2ace041fd9 Add secretbox_xchacha20poly1305_easy 2016-11-26 19:45:24 +01:00
Frank Denis
d4f384e388 Make crypto_secretbox_xsalsa20poly1305_open() as __warn_unused_result__ 2016-11-26 19:44:51 +01:00
Frank Denis
669ed597d0 Rename box_x*poly1305.c -> secretbox_x*poly1305.c for consistency 2016-11-26 14:12:47 +01:00
Frank Denis
2848984edf + secretbox_xchacha20poly1305 2016-11-26 14:04:23 +01:00
Frank Denis
a86ac590d6 Reformat to make the style more consistent 2016-11-26 13:40:34 +01:00
Frank Denis
5eed910c11 Cast the scalar instead of the coefficient 2016-10-30 01:13:22 +02:00
Frank Denis
71f0693ee7 Argon2i: fix encoding issues
For compatibility with hashes might have been encoded using other libraries.
2016-10-26 22:50:38 +02:00
Frank Denis
aff4aaeabf Change the garbage value to 0xdb
If that garbage value becomes the LSB of a pointer, the pointer is more
likely to be unaligned, an trigger more bugs.
2016-10-15 18:54:56 +02:00
Frank Denis
49741c59e8 Allows RANDOMBYTES_DEFAULT_IMPLEMENTATION to be overriden 2016-10-13 22:57:01 +02:00
Frank Denis
583c16707c + crypto_stream_xchacha20 2016-09-30 22:57:56 +02:00
Frank Denis
42dc78b38b Indent 2016-09-30 08:40:15 +02:00
Frank Denis
b20d227f37 Avoid collision with a possibly existing int128 type definition 2016-09-30 08:36:50 +02:00
Frank Denis
53ee1fe758 Remove commented out code and avoid inconsistent indentation 2016-09-30 08:30:22 +02:00
Frank Denis
f257413772 uint32 -> uint32_t 2016-09-30 08:26:24 +02:00
Robert Spychala
94ea419247 add preprocessor flag to skip blocking /dev/random during libsodium init (#429) 2016-09-20 21:13:07 +02:00
Frank Denis
26e8b0253f Argon2: check that m_cost/t_cost/lanes decode to uint32 2016-09-18 09:33:35 +02:00
Frank Denis
6035c0779b Back to dev mode 2016-08-04 02:28:21 +02:00
Frank Denis
2f4f718cd9 Remove dev flag 2016-07-31 16:34:11 +02:00
Frank Denis
19a9d18b9c _MSC_VER > 1600 -> _MSC_VER >= 1700 for consistency 2016-07-24 19:58:00 +02:00
Jan-E
6b739fc821 Fix VS2010 (and VC9) x64 build 2016-07-24 02:13:22 +02:00
Frank Denis
89918e94f1 crit_{enter,leave} can fail 2016-07-06 12:03:08 +02:00
Frank Denis
29492143ab Warn if the library is being compiled in a custom way 2016-07-02 10:07:38 +02:00
Frank Denis
2cc0bab0e3 Update comment 2016-06-29 15:31:23 +02:00
Frank Denis
648f46d22a Expose sodium_crit_enter() and sodium_crit_leave() internally 2016-06-29 15:28:15 +02:00
Frank Denis
5a3ff833fd Slightly change how the length of argon2 strings is checked 2016-06-19 23:26:08 +02:00
Frank Denis
6fad3644b5 Nits 2016-06-15 16:00:59 +02:00
Aaron Zauner
77c05fce0c document why RtlGenRandom is used 2016-06-15 21:50:33 +08:00
Frank Denis
aaf6854edf Remove extra space 2016-06-08 08:34:45 +02:00
Frank Denis
9c12da0362 Don't include <immintrin.h> if it is not needed
Some environments provide <wmmintrin.h> but not <immintrin.h>
2016-05-26 06:08:26 -07:00
Frank Denis
fa4e4bf174 Fix & simplify MADV_DO{NO}DUMP alternatives 2016-05-18 22:12:07 +02:00
Lev Serebryakov
7a4c4459f8 Support madvise() on FreeBSD
FreeBSD have madvise() behaviors equivalent to MADV_DONTDUMP and MADV_DODUMP but with its own names.
Add definitions for these behaviors used in sodium_mlock() and sodium_munlock() if FreeBSD names are found and Linux ones don't.
2016-05-18 23:04:09 +03:00
Frank Denis
f01299a91b Indent 2016-05-17 23:05:04 +02:00
Samuel Neves
998bacf375 don't crash on Win32 2016-05-17 21:40:56 +01:00
Frank Denis
efb81c7290 CRLF 2016-05-17 01:41:06 +02:00
Thomas Waldmann
b9c266181b fix avx2 feature detection, fixes #395
cpuid needed to get called with EAX = 7 to get the "extended features"
(not with EAX = 1 for the "features").
2016-05-17 01:28:03 +02:00
Frank Denis
263101cfaf sandy2x: don't mix VEX and non-VEX instructions 2016-05-17 00:24:33 +02:00
Frank Denis
080dcadb69 Merge pull request #396 from langboost/master
Fixing a small documentation typo
2016-05-16 23:42:20 +02:00
Frank Denis
f361d1ccec sandy2x: clean the upper halves of the AVX registers
On Linux, with dynamic linking, upper AVX registers are not 0, which
introduces a massive performance penalty due to state transitions.

Thanks to to Tung Chou and Samuel Neves for catching this, and to
@theakman2 for his initial report.
2016-05-16 23:34:03 +02:00
Jeff R
0b8cb8a543 Fixing a small documentation typo 2016-05-16 16:05:24 -05:00
Frank Denis
593599a11a Align loops 2016-05-16 12:25:35 +02:00
Frank Denis
c303c1f709 sandy2x: align branch targets 2016-05-16 12:20:15 +02:00
Frank Denis
c752eb55d9 On ancient Linux kernels, block on /dev/random before using /dev/urandom 2016-05-15 17:26:22 +02:00
Frank Denis
248f381404 Rewrite aesni_key256_expand() for clarity 2016-05-05 19:10:11 +02:00
Frank Denis
a37d2b87bf Rename REDUCE4 to MULREDUCE4 for clarity 2016-05-04 23:31:09 +02:00
Frank Denis
0f053aea52 Grammar 2016-05-04 23:09:07 +02:00
Frank Denis
44cd974be2 Remove extra CRLF 2016-04-30 11:20:14 +02:00
Frank Denis
7a667edbd0 NativeClient: use get_random_bytes directly instead of the wrapper 2016-04-29 10:51:13 +02:00
Frank Denis
681176e187 abort() if nacl_secure_random() ever returns 0 but the wrong size 2016-04-29 10:08:45 +02:00
Frank Denis
fbad64f6ef Disable asm on native client 2016-04-28 21:31:18 +02:00
Frank Denis
5f3b59c8b0 Tabify 2016-04-27 11:37:21 +02:00
Frank Denis
46539b9381 Indent 2016-04-27 00:11:00 +02:00
Frank Denis
ffd5987e7c Proper lock test on Windows 2016-04-26 01:43:00 +02:00
Frank Denis
d908d08b0d Simplify the fallback _sodium_crit_enter() code 2016-04-25 20:15:33 +02:00
Frank Denis
f8ff8ebf66 Add locks around sodium_init() 2016-04-25 18:33:11 +02:00
Frank Denis
14211cd7ea Update include guard 2016-04-22 12:01:56 +02:00
Frank Denis
b2586f5402 Use the same convention for include guards everywhere 2016-04-22 11:46:37 +02:00
Frank Denis
801fbde757 scrypt/sse - Note that B's layout is permuted compared to nosse 2016-04-21 20:37:11 +02:00
Frank Denis
2de4b3f514 Hand-roll zeroing instead of relying on memset() 2016-04-21 17:17:24 +02:00
Frank Denis
492d4b1dd6 Repair NativeClient support 2016-04-18 21:40:18 +02:00
Frank Denis
8ab4334945 if -> ifdef 2016-04-18 16:53:34 +02:00
Frank Denis
531ce5bd32 Do not use getrandom(2) on SLES11 service pack 4 2016-04-14 17:21:42 +02:00
Frank Denis
34aeee6ba5 Replace two more memcpy() with a local loop 2016-04-12 07:30:54 +02:00
Frank Denis
d7294320c4 sha{512,256}: use a local loop instead of if + memcpy()
Compilers can't figure out the max inlen value, so help them with an
explicit AND.

Unify the name of the input pointer by the way.
2016-04-12 02:14:45 +02:00
Frank Denis
bbf1e17983 Avoid bit shifting with signed values 2016-04-12 00:51:41 +02:00
Frank Denis
50e11be472 memcpy(): pointers must be valid even if the size is 0 2016-04-12 00:41:37 +02:00
Frank Denis
0a590b07b2 Decryption functions can now accept a NULL pointer for the output
This checks the MAC without writing the decrypted message.
2016-04-11 18:33:50 +02:00
Frank Denis
80310ef56c Set randombytes_implementation to NULL by default, to cope with Visual Studio 2008 2016-04-08 17:50:18 +02:00
Frank Denis
a53a9c98d2 Back to dev mode 2016-04-08 08:25:42 +02:00
Frank Denis
22ab28be0a Require Visual Studio 2010+ for AESNI 2016-04-07 18:57:07 +02:00
Frank Denis
292969b3b5 Argon2: initialize ctx{.pwd,.pwdlen} in the verify function
Keep initializing the length for clarity;
Compilers know how to optimize this out.
2016-04-07 08:19:50 +02:00
Frank Denis
1818267d64 Return -1 if crypto_generichash_final() is called twice 2016-04-06 01:00:49 +02:00
Frank Denis
97b09aba0b Move curve25519_ref10.h to include/sodium/private/ 2016-04-04 18:03:08 +02:00
Frank Denis
8df895b3ec include/sodium/private.h -> include/sodium/private/common.h 2016-04-04 17:16:32 +02:00
Frank Denis
3927cad829 Relocate sodium/common.h 2016-04-04 16:28:40 +02:00
Frank Denis
501ec7a679 Adjust another relative path for sodium/common.h 2016-04-04 08:44:59 +02:00
David Renshaw
c3b68c12d6 Fix up relative includes of sodium/common.h 2016-04-04 03:18:24 +00:00
Frank Denis
1550026a9a Explain why blake2b_param_set_digest_length() is not needed 2016-04-03 13:52:55 +02:00
Frank Denis
0716b7701e Initialize constant 2016-04-02 12:17:47 +02:00
Frank Denis
1853248f0a Consistency 2016-04-02 12:08:41 +02:00
Frank Denis
e50f1e95ab Reuse STORE64_LE whenever possible 2016-04-02 11:46:53 +02:00
Frank Denis
6ee06a9242 Include missing structures definitions 2016-04-02 09:01:03 +02:00
Frank Denis
698efbdc23 Consistency 2016-04-02 01:20:38 +02:00
Frank Denis
531c51e7a3 Stronger types for >= 16 bits shifts 2016-04-02 01:06:04 +02:00
Frank Denis
ca71815db3 ((unsigned long long) 1) -> 1ULL 2016-04-02 00:57:33 +02:00
Frank Denis
42535e0b40 (1 << x) -> (1UL << x) for compilers where sizeof(int) == 2 2016-04-02 00:54:17 +02:00
Frank Denis
95114d8592 l -> L 2016-04-02 00:44:41 +02:00
Frank Denis
5cdd950c5c Reformat 2016-04-01 20:51:05 +02:00
Frank Denis
d7f5877df5 Add crypto_pwhash_argon2i_ALG_ARGON2I13 2016-04-01 20:48:34 +02:00
Frank Denis
384e08b7f4 Require an algorithm identifier in crypto_pwhash() 2016-04-01 20:29:28 +02:00
Frank Denis
5d8c878ffb Remove mlen_p from the AEAD detached interface 2016-03-30 21:20:34 +02:00
Frank Denis
de22f38da2 Mark the _out_of_bounds() function as noreturn 2016-03-27 00:21:04 +01:00
Frank Denis
25faa47b46 Include blake2b_long prototype 2016-03-27 00:11:32 +01:00
Frank Denis
20bf121fcd 1.0.9 is almost ready to be tagged 2016-03-25 16:30:36 +01:00
Frank Denis
2aa703fcc7 Restore the previous sodium_malloc(0) behavior
If aligned memory cannot be obtained, allocate 1 byte
to always return a non-NULL pointer.
2016-03-25 16:26:37 +01:00
Frank Denis
811bdb2c5f Explicit cast; length is already checked by the caller 2016-03-25 16:00:52 +01:00
Frank Denis
fb865c9a5c More tests / lcov exclusions 2016-03-25 15:36:57 +01:00
Frank Denis
58e4cdf809 Make Argon2 encode/decode return codes consistent with other functions 2016-03-25 14:54:14 +01:00
Frank Denis
e9b7a71a38 Remove unused code 2016-03-25 12:29:25 +01:00