Commit graph

19 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
944782f506 Remove unnecessary headers. 2017-08-23 13:19:59 +02:00
Dag-Erling Smørgrav
c6536641c5 Major cleanup of the MD and SHA digests.
- Use the new vector byte-order conversion functions where appropriate.
- Use memset_s() instead of memset() where appropriate.
- Use consistent names and types for function arguments.
- Reindent, rename and reorganize to conform to Cryb style and idiom.

SHA224 and SHA256 were left mostly unchanged.  MD2 and MD4 were completely rewritten as the previous versions (taken from XySSL) seem to have been copied from RSAREF.

This breaks the ABI as some context structures have grown or shrunk and some function arguments have been changed from int to size_t.
2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
3917a6dfd7 Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
Dag-Erling Smørgrav
f70dac496f Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
Dag-Erling Smørgrav
d8e26bc5bb Solve further asprintf() issues by sweeping them under the rug.
All further instances of asprintf() or vasprintf() in our codebase are either in libcryb-test or in individual unit tests, and in all cases, the only consequence of a failed call is that the result will say "no description" instead of either a description of the test or an explanation of how it failed.  Therefore, we can simply ignore the problem and cast the call to void to satisfy gcc.
2016-09-18 22:40:48 +02:00
Dag-Erling Smørgrav
e78c0f811b Remove unneeded #includes. 2016-09-17 16:05:31 +02:00
Dag-Erling Smørgrav
e276f2b407 Ensure that we always have off_t and ssize_t in scope.
POSIX requires <stdio.h> and <unistd.h> to define off_t and ssize_t like <sys/types.h> does, but not all platforms respect that.  Play it safe by always including <sys/types.h>.
2016-09-15 10:15:00 +02:00
Dag-Erling Smørgrav
401465d8ea Move main() from libcryb-test to the test program.
Instead of having libcryb-test provide main() and assume that the test program defines t_prepare() and t_cleanup(), have libcryb-test provide a t_main() function which the test program calls with pointers to its prepare and cleanup functions.
2016-03-15 14:29:44 +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
8351719b84 Simplify test cases by a) using C99 VLAs and b) removing error checks for
allocation failures which are either harmless (e.g. failing to allocate
the test description string) or will trigger a segfault which the driver
now catches, allowing subequent test cases to run.
2015-08-19 11:27:48 +00:00
Dag-Erling Smørgrav
56eccb99fe Add two utility functions which check if a string contains something that
can be interpreted as either true or false.  Use this instead of a basic
non-NULL test for the CRYB_PERFTEST check.
2014-12-29 13:22:53 +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
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
c9536ec04b Add tests for the carry operation in sha384 and sha512, which support
message of up to 2^128 bytes and therefore must use a high / low pair.
2014-07-12 22:12:38 +00:00
Dag-Erling Smørgrav
8c9c5f26e4 Take advantage of t_compare_mem(). 2014-07-11 22:26: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
b6578d1bd2 Fix props again again... why does this keep happening? 2014-07-10 17:59:50 +00:00
Dag-Erling Smørgrav
dff909ba65 Spell the name of the University of Oslo in English. 2014-07-10 17:15:54 +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