Commit Graph

2438 Commits

Author SHA1 Message Date
Frank Denis
a3d7bc065e Reuse macros 2017-02-23 09:24:15 +01:00
Frank Denis
c06418a382 Indent 2017-02-23 09:05:47 +01:00
Frank Denis
05349aa14d Avoid multiple definitions of ROTL/ROTR macros 2017-02-23 09:01:50 +01:00
Frank Denis
9fdca4a8c9 There's pretty much nothing left from the original code 2017-02-20 21:13:59 +01:00
Frank Denis
f5673c7cc0 Avoid negating unsigned values 2017-02-20 21:12:33 +01:00
Frank Denis
40b4462239 Version bump [not released yet] 2017-02-20 11:35:14 +01:00
Frank Denis
0877b14c68 Correct array size check in xchacha20 test 2017-02-20 11:35:13 +01:00
ektrah
7901b1ce75 Add scripts and files to package libsodium for .NET Core (#477) 2017-02-20 10:34:42 +01:00
Frank Denis
76e8776839 Merge a couple more files 2017-02-20 10:32:23 +01:00
Frank Denis
bb67b383ef Drop the _api suffixes 2017-02-20 09:50:34 +01:00
Frank Denis
5957e2c735 C++ compat 2017-02-19 21:23:34 +01:00
Frank Denis
8af252bf87 use crypto_*_keygen() in tests 2017-02-19 21:20:45 +01:00
Frank Denis
7e5d64834c untab 2017-02-19 21:17:42 +01:00
Frank Denis
7f7e7235c5 Add a keygen function to all the primitives 2017-02-19 21:15:54 +01:00
Frank Denis
93d02019da Trigger randombytes_seedbytes() 2017-02-19 19:10:08 +01:00
Frank Denis
fe3e60392c C++ compat 2017-02-19 19:03:18 +01:00
Frank Denis
eb5ff7270e Use the IETF ChaCha20 version for randombytes_buf_deterministic()
It doesn't make any difference except by limiting the maximum
length to 256 Gb. But the code for the IETF version has a higher
probability to already be used by something else than the original
version.
Enforcing a 256 Gb limit can also prevent surprises from happening
in other implementations.
2017-02-19 18:55:32 +01:00
Frank Denis
4c6b0ac762 Add aliases for stream_chacha20 sizes, similar to chacha20poly1305 2017-02-19 18:54:25 +01:00
Frank Denis
cafb0a695b Add randombytes_buf_deterministic() 2017-02-19 18:40:29 +01:00
Frank Denis
70c2796ae5 + crypto_kdf high-level API
This is a common need, and people end up reimplementing HKDF.

So, add a crypto_kdf() API similiar to libhydrogen's. The later has a
higher limit for the output length using BLAKE2X if required.

We can implement the same strategy later in libsodium if needed.
2017-02-19 18:13:10 +01:00
Frank Denis
49916e5a82 Ignore *.wasm *.wast 2017-02-19 18:10:50 +01:00
Frank Denis
45127e7bb9 sort 2017-02-19 17:49:27 +01:00
Frank Denis
7555ae37f0 blake2 -> blake2b 2017-02-19 17:15:41 +01:00
Frank Denis
e0150faf56 Always zero the argon2 output buffer prior to doing anything
This is consistent with what we are doing with scrypt.
On error/misuse, the buffer is zeroed; this may prevent bugs with
reused/invalid buffers.
2017-02-19 12:40:28 +01:00
Frank Denis
2c6fb87708 Set crypto_pwhash_scryptsalsa208sha256_BYTES_MIN to 128 bits 2017-02-19 12:31:05 +01:00
Frank Denis
2e4e1c66a0 Complete 08c0e03f83 2017-02-19 12:23:37 +01:00
Emil Bay
08c0e03f83 WIP: crypto_pwhash constants (#464)
* Test exposed constraint constants on crypto_pwhash

This includes the following constants for crypto_pwhash, crypto_pwhash_argon2i,
and crypto_pwhash_scryptsalsa208sha256:

- crypto_pwhash_BYTES_MIN
- crypto_pwhash_BYTES_MAX
- crypto_pwhash_PASSWD_MIN
- crypto_pwhash_PASSWD_MAX
- crypto_pwhash_OPSLIMIT_MIN
- crypto_pwhash_OPSLIMIT_MAX
- crypto_pwhash_MEMLIMIT_MIN
- crypto_pwhash_MEMLIMIT_MAX

* Expose constraint constants for crypto_pwhash

* Expose constant methods for crypto_pwhash
2017-02-19 11:19:01 +01:00
Frank Denis
532ea6bd95 + test for aead_xchacha20poly1305 2017-02-18 22:10:30 +01:00
Frank Denis
20d1d048fd Merge a couple files
These are unlikely to have multiple implementations ever, unlike their
underlying primitives, so move them one folder up instead and take it
as an opportunity to merge small files.
2017-02-18 21:53:32 +01:00
Frank Denis
a329340d90 Remove the NaCl-like APIs from *xchacha20 additions
These APIs were useful with the salsa20 constructions for compatibility
with NaCl, but they are tricky to use and don't provide any benefits over
the _easy APIs.

Having them around was good for consistency with the salsa20-based ones,
but this is code that is unlikely to be used in actual projects.

So, don't include them, unless people actually ask for them.
2017-02-18 21:22:39 +01:00
Frank Denis
eb5c17d3ec Add tests for box_xchacha20poly1305 2017-02-18 20:31:39 +01:00
Frank Denis
99e6c94739 C++ compat 2017-02-16 09:57:01 +01:00
Frank Denis
4c2cf071f8 Include <intrin.h> on Visual Studio for __cpuid() 2017-02-16 09:24:33 +01:00
Frank Denis
b146082d68 More tests for *xchacha20* 2017-02-14 15:41:59 +01:00
Frank Denis
071a1afde3 C++ compat 2017-02-12 22:34:15 +01:00
Frank Denis
b209a7c0af Add a test for HChaCha20 2017-02-12 22:28:35 +01:00
Frank Denis
727dae49e2 Back out locks in randombytes_salsa20
These functions were not supposed to be thread-safe, and we can't
use crit_*() in the randombytes implementations anyway.
2017-02-10 18:01:06 +01:00
Frank Denis
d5fc01b317 Merge branch 'master' of https://github.com/jedisct1/libsodium
* 'master' of https://github.com/jedisct1/libsodium:
  C++ compat
2017-02-04 11:41:49 +01:00
Frank Denis
5095fc9afa Reorder 2017-02-04 11:40:20 +01:00
Frank DENIS
e59bfee281 C++ compat 2017-01-31 17:14:12 +01:00
Frank Denis
8439df646b Favor the Windows API over pthreads on mingw 2017-01-26 20:34:46 +01:00
Frank Denis
865a4a48ca Merge branch 'master' of https://github.com/jedisct1/libsodium
* 'master' of https://github.com/jedisct1/libsodium:
  Compile with -Wno-type-limits
2017-01-21 01:42:50 +01:00
Frank Denis
8b961fb1bd Trim TOTAL_MEMORY_SUMO to a 64k multiple 2017-01-21 01:42:28 +01:00
Frank Denis
3965574d3b Merge branch 'master' of https://github.com/jedisct1/libsodium 2017-01-19 21:27:28 +01:00
Frank Denis
9f489f0794 Compile with -Wno-type-limits 2017-01-19 21:26:46 +01:00
Frank Denis
de3c0ff85e Indent 2017-01-18 20:03:26 +01:00
Frank Denis
f053b98b64 Use getrandom() on dietlibc -- via Felix von Leitner 2017-01-18 20:00:25 +01:00
Henrik Gaßmann
a81cea2366 FindSodium.cmake MAKE VS FOLDER SELECTION GENERIC (#471) 2017-01-15 14:12:57 +01:00
Frank Denis
3633726d56 Indent 2017-01-13 19:28:18 +01:00
Frank Denis
1686da3d3c Remove the non-IETF versions of crypto_aead_xchacha20poly1305 2017-01-13 19:24:48 +01:00