Commit graph

46 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
c73fd34d97 Implement a memcpy_s() equivalent. 2018-05-06 19:12:51 +02:00
Dag-Erling Smørgrav
fe064e41db Add missing dependency on cryb-rand for t_oath. 2018-05-05 15:37:55 +02:00
Dag-Erling Smørgrav
5c8745138e Add strchrnul(), wcschrnul(), and tests for the former. 2017-08-23 13:41:40 +02:00
Dag-Erling Smørgrav
ea5b521c61 Add a simple test case for the allocator. 2017-05-11 00:08:45 +02:00
Dag-Erling Smørgrav
35e42e7479 Really fix flags for t_cxx.
48269ce tried to fix d43a6bf2 but actually just broke it in a different way.  Restore AM_CPPFLAGS so cross-tree builds work again.
2017-05-02 13:24:08 +02:00
Dag-Erling Smørgrav
48269ce937 Fix include paths for some tests.
It was wrong to remove $(AM_CPPFLAGS) in d43a6bf2, because it is only used for code for which there is no explicit *_CPPFLAGS.  It is not entirely clear why this did not trip us (or Travis) up until now, although it is possible that it only breaks when $(builddir) != $(srcdir).

On the other hand, there is no reason to use $(INCLUDES).
2017-04-29 18:28:54 +02:00
Dag-Erling Smørgrav
d43a6bf294 Remove duplicate flags. 2017-04-26 13:07:56 +02:00
Dag-Erling Smørgrav
b69da31597 Add unit tests for {rol,ror}{8,16,32,64}. 2017-04-22 01:41:06 +02:00
Dag-Erling Smørgrav
dd57dac67f Fix typo that prevented t_mpi.h from being distributed. 2017-04-06 21:29:11 +02:00
Dag-Erling Smørgrav
b4eb918dad Implement GCD using Stein's binary algorithm. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
fc99e7973b Split up the 150+ mpi test cases into smaller groups. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
700fa0718b Implement DES (single-key ECB only for now). 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
c671da9b1c Implement the Salsa family of stream ciphers.
Note that we only have unit tests for Salsa20.
2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
cfd3951ee1 Implement the ChaCha family of stream ciphers. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
912ba9b6ff Add a test that ensures that our headers are compilable in C++. 2017-01-24 15:08:48 +01:00
Dag-Erling Smørgrav
642b34411c Alphabetize. 2016-11-21 14:02:05 +01:00
Dag-Erling Smørgrav
50fbf04eb4 Add version tests for libcryb-oath and libcryb-rand. 2016-11-21 13:52:19 +01:00
Dag-Erling Smørgrav
2d507aaee4 Implement our own assert() and, more importantly, assertf(). 2016-11-14 13:00:51 +01:00
Dag-Erling Smørgrav
a36c6ba31c Add tests for each library's cryb_foo_version() function.
This may seem stupid, but I've found bugs in the past which would have been caught by unit tests which I didn't write because they seemed stupid.
2016-09-17 16:14:00 +02:00
Dag-Erling Smørgrav
f9c8ce7c65 Build system overhaul 2015-12-14 18:08:22 +01:00
Dag-Erling Smørgrav
f8ebdbc14d Move the test framework into its own subdirectory 2015-10-04 07:49:48 +00:00
Dag-Erling Smørgrav
dd18cd2995 Kick off libcryb-cipher with AES (from XySSL) and RC4 (my own). 2015-10-03 14:24:59 +00:00
Dag-Erling Smørgrav
531eeec36b Add a simple implementation of the Adler-32 checksum. 2015-08-18 13:27:06 +00:00
Dag-Erling Smørgrav
aa97da3335 Add simple implementations of Fletcher's checksum. 2015-08-17 15:21:47 +00:00
Dag-Erling Smørgrav
dc75f2edd8 Add a memset_s() implementation (cf. C11 / WG14 N1381) 2015-02-15 09:18:18 +00:00
Dag-Erling Smørgrav
b6368af502 Re-add $(RT_LIBS) where needed. 2014-12-29 23:56:22 +00:00
Dag-Erling Smørgrav
b2ec312d9f Link each test with only the libraries it needs. This avoids rebuilding
every single test whenever any of the libraries changes.
2014-12-29 22:17:02 +00:00
Dag-Erling Smørgrav
3333bd5709 Add test cases for the static inline functions in <cryb/endian.h>. 2014-12-29 14:20:28 +00:00
Dag-Erling Smørgrav
20dab3e342 Provisionally include strlcmp(), although it is not (currently) used
anywhere.  Opinion is divided as to whether this is useful, or whether
its usefulness is outweighed by its awkwardness.  Still, we have it, so
we may as well commit it.
2014-12-20 00:23:59 +00:00
Dag-Erling Smørgrav
37973b8705 Use CLOCK_MONOTONIC instead of the non-standard CLOCK_MONOTONIC_PRECISE.
Use librt if required for clock_gettime(2).
2014-10-30 12:56:47 +00:00
Dag-Erling Smørgrav
be31515f5e Start of a multiple-precision integer arithmetic library. 2014-08-12 07:30:31 +00:00
Dag-Erling Smørgrav
ce567a72e0 Add a simple malloc() implementation which can be configured to fail
when testing error handling code.
2014-08-02 23:30:07 +00:00
Dag-Erling Smørgrav
479ffbba4a Remove author and sponsor tags; we'll deal with that some other way.
Remove $Cryb$ tags as it is likely that the code will move to git.
2014-08-01 14:31:07 +00:00
Dag-Erling Smørgrav
cc8109c760 WIP: unit tests for managed strings. 2014-08-01 13:55:01 +00:00
Dag-Erling Smørgrav
0023f57ab5 Add a library of general (non-cryptographic) hash functions, currently
consisting of the Pearson string hash function and the Murmur3-32 hash
function.
2014-07-19 06:03:57 +00:00
Dag-Erling Smørgrav
49e46f74b1 Add unit tests for strlcpy() 2014-07-13 21:35:15 +00:00
Dag-Erling Smørgrav
08208a1b3e Add unit tests for strlcat() 2014-07-13 20:40:29 +00:00
Dag-Erling Smørgrav
a4576782b2 Add generic comparison functions. 2014-07-11 22:10:09 +00:00
Dag-Erling Smørgrav
2c697a472b Implement SHA-224 and HMAC-SHA224. 2014-07-11 13:33:58 +00:00
Dag-Erling Smørgrav
6aa7f9a0e6 Implement HMAC-SHA{256,384,512} and add unit tests. Remove pre-existing
HMAC implementations from the libcperciva and XySSL code.
2014-07-11 13:01:32 +00:00
Dag-Erling Smørgrav
8e786c5a98 Introduce t_zero (a 256-byte array of zeroes) and t_seq8 (a 256-byte array
counting up from zero).  Use them to simplify the HMAC-SHA1 test vectors.
2014-07-11 12:46:23 +00:00
Dag-Erling Smørgrav
cd10966e07 Make the performance tests conditional on a run-time environment variable
rather than a build-time option.
2014-07-11 00:18:34 +00:00
Dag-Erling Smørgrav
63bcbcca20 Rename the HMAC-SHA1 code. 2014-07-10 23:57:47 +00:00
Dag-Erling Smørgrav
593125c353 Import sha256 from libcperciva
Import md2, md4, sha384 and sha512 from XySSL
2014-07-10 14:51:07 +00:00
Dag-Erling Smørgrav
601403cba3 Use custom keywords. 2014-07-04 11:20:46 +00:00
Dag-Erling Smørgrav
ae99587ba4 initial code drop 2014-07-04 11:18:53 +00:00