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

80 Commits

Author SHA1 Message Date
Frank Denis
42b4a295fc crypto_sign_verify(): add and match the Zig test vectors 2022-11-26 21:25:47 +01:00
Frank Denis
71c7aa0975 Add a simple test runner to zig-out/bin/ 2022-11-23 21:37:20 +01:00
Frank Denis
75bde19055 Revert "Add the shifumi128 ZKP system"
This reverts commit 6efe9ee2b5.
2022-04-02 09:32:22 +02:00
Frank Denis
6efe9ee2b5 Add the shifumi128 ZKP system 2022-03-31 20:04:51 +02:00
Frank Denis
c93662b27c Add AEGIS128L test, regen the ones for AEGIS256, sort 2021-03-15 11:00:18 +01:00
Frank Denis
28e6cc1a95 Remove unused hash2.exp 2021-02-21 00:53:18 +01:00
Frank Denis
29f098d237 Revert "Add the BlaBla2000 stream cipher - will eventually become the default"
This reverts commit a31fe2a966.
2020-04-21 13:35:29 +02:00
Frank Denis
a31fe2a966 Add the BlaBla2000 stream cipher - will eventually become the default
2000 rounds variant of the BlaBla20 cipher
for Very Post Quantum (VPQ) security.
2020-03-31 21:42:54 +02:00
Frank Denis
0cabff7a0a Move HKDF test to its own file 2020-03-31 17:42:42 +02:00
Frank Denis
c8d604e1f1 Add test vectors for the string to curve operation 2020-03-31 13:40:42 +02:00
Adrien Gallouët
019db2bc84 Make room for several secretstream
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
2019-09-16 15:38:38 +00:00
Adrien Gallouët
3c14a1581c Add tests for AEGIS-256
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
2019-09-12 14:42:19 +00:00
Frank Denis
aaa9d0d940 Include wasi-test-wrapper.sh in dist builds 2019-04-09 12:09:16 +02:00
Frank Denis
9dbf03c115 Run the WASI checks using wasmtime 2019-04-08 21:45:08 +02:00
Frank Denis
db0319fb8e Initial support for ristretto255 2019-02-18 00:56:48 +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
69a5643477 Add chacha20-poly1305 test from Project Wycheproof 2018-09-04 15:44:42 +02:00
Frank Denis
cb22446db1 Add aes256gcm tests from project wycheproof 2018-08-30 09:51:28 +02:00
Frank Denis
f8377e9818 Add x25519 test vectors from project wycheproof 2018-08-29 15:08:26 +02:00
Frank Denis
a60d877327 Add a test for crypto_scalarmult_ed25519 2017-11-15 16:57:29 +01:00
Frank Denis
1df2285362 Add a preliminary test for core_ed25519 2017-11-15 01:34:43 +01:00
Frank Denis
2f51ed3397 Rename the test/pwhash.c -> test/pwhash_argon2i.c 2017-10-01 11:09:55 +02:00
Frank Denis
ee1d5c96d8 Move the codecs tests to their own test file 2017-09-19 22:51:05 +02:00
Frank Denis
a7b75a2d7d + simple metamorphic tests for crypto_generichash()
This needs to be extended to other APIs with a streaming interface
2017-09-17 21:41:32 +02:00
Frank Denis
6e8e0a93f9 Add a couple tests for crypto_secretstream_*() 2017-08-16 14:53:54 +02:00
Frank Denis
5d56821d3d More tests, and start testing misuse cases 2017-07-17 23:09:44 +02:00
Frank Denis
28e32dd5a2 Remove scrypt from minimal builds 2017-07-11 22:08:02 +02:00
Frank Denis
f586752afe + Argon2id tests 2017-06-28 15:49:49 +02:00
Frank Denis
849a35bd82 + crypto_kx_*() API
This doesn't include a full key exchange API yet.
2017-03-12 13:15:39 +01:00
Frank Denis
617862eb5a Make aead_xchacha20_poly1305 a first-class citizen 2017-03-02 10:19:08 +01:00
Frank Denis
8fb5918fb6 Add a test for siphashx24 2017-02-24 19:23:14 +01:00
Frank Denis
7f7e7235c5 Add a keygen function to all the primitives 2017-02-19 21:15:54 +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
532ea6bd95 + test for aead_xchacha20poly1305 2017-02-18 22:10:30 +01:00
Frank Denis
b209a7c0af Add a test for HChaCha20 2017-02-12 22:28:35 +01:00
Frank Denis
79935dc918 test/pwhash_argon2i -> test/pwhash 2016-03-21 09:48:01 +01:00
Frank Denis
aafff07689 Add support for running the test suite with Valgrind 2016-03-06 01:35:06 +01:00
Frank Denis
7a95e921ac Add tests for pwhash_argon2i 2015-12-29 17:12:23 +01:00
Frank Denis
14bf02af88 Rename the pwhash test as as pwhash_scrypt 2015-12-29 16:14:19 +01:00
Frank Denis
93295855cf Add aes256gcm test vectors 2015-10-11 12:56:20 +02:00
James Robson
e119c3e502 Added .final and .nexe output files to CLEANFILES 2015-06-22 14:16:07 -05:00
James Robson
34a4931d9a Initial patch for Chrome NaCl implementation 2015-06-22 13:02:21 -05:00
Frank Denis
575ce93058 + crypto_box_seal() 2015-04-17 01:01:32 +02:00
Frank Denis
4724440492 quirks\windows\windows-quirks.h -> quirks\quirks.h 2015-01-23 10:35:20 +01:00
Frank Denis
f20ecbed94 Skip sodium_utils{2,3} tests when the target is Javascript 2015-01-15 11:12:58 +01:00
Frank Denis
61620d7e42 Make 'make check' actually run the tests on Emscripten. 2014-11-25 09:51:39 -08:00
Frank Denis
69e3674c29 Include the test pre.js script only for tests. 2014-11-24 17:19:55 -08:00
Frank Denis
b062a555da scalarmult: check that the top bit is ignored 2014-09-18 21:27:49 -07:00
Frank Denis
0ec5a25c88 More tests for randombytes 2014-09-14 12:43:53 -07:00
Frank Denis
473e1718cc Add sodium_{malloc,allocarray,free}() and sodium_mprotect_*()
ptr = sodium_malloc(size) returns a pointer from which exactly "size" bytes
can be accessed.

ptr = sodium_allocarray(count, size) allocates enough storage space for
"count" pointers or scalars of unit size "size".

In both cases, the region is immediately followed by a guard page.
As a result, any attempt to access a memory location after ptr[size - 1] will
immediately trigger a segmentation fault.

The allocated region is mlock()ed and filled with 0xd0 bytes.

A read-only page with the size, a guard page, as well as a canary are
placed before the returned pointer.

The canary is checked by sodium_free(); as a result, altering data right
before ptr is likely to cause sodium_free() to kill the process.

sodium_free() munlock()s the region and fills it with zeros before
actually calling free().

sodium_mprotect_noaccess(), sodium_mprotect_readonly() and
sodium_mprotect_readwrite() can be used to change the protection on the set
of allocated pages.

Reverting the protection to read+write is not required before calling
sodium_free().
2014-08-14 21:41:05 -07:00