Commit graph

  • ed9403627f Add more AES test vectors Dag-Erling Smørgrav 2015-10-03 15:13:17 +0000
  • dd466ab29b Move some code around Dag-Erling Smørgrav 2015-10-03 14:47:59 +0000
  • 023ec74be2 Implement cipher algorithm list and rename some files. Dag-Erling Smørgrav 2015-10-03 14:44:59 +0000
  • a9e733f0ca Use an enum for encrypt / decrypt + minor cleanup Dag-Erling Smørgrav 2015-10-03 14:43:33 +0000
  • 1826bb12bf Modify the coverage build script so that it only runs "make clean" if coverage was not already enabled when the script was started. Dag-Erling Smørgrav 2015-10-03 14:30:24 +0000
  • dd18cd2995 Kick off libcryb-cipher with AES (from XySSL) and RC4 (my own). Dag-Erling Smørgrav 2015-10-03 14:24:59 +0000
  • 94471e9923 Always clear the negative flag in mpi_zero() Dag-Erling Smørgrav 2015-10-03 14:23:32 +0000
  • 9042130830 Fix ossifrage underflow error in Adler32 unit test Dag-Erling Smørgrav 2015-10-03 14:20:07 +0000
  • bf36ff7a8c Correct context length for SHA digests Dag-Erling Smørgrav 2015-10-03 13:56:07 +0000
  • 398abda6b0 Fix various bugs relating to digest algorithm registration and wrapping Dag-Erling Smørgrav 2015-10-03 09:32:44 +0000
  • 8d087eeb64 Fix endian.h includes Dag-Erling Smørgrav 2015-10-03 09:31:57 +0000
  • f99073058c Whitespace cleanup to reduce diffs between SHA-512 and SHA-384. Dag-Erling Smørgrav 2015-09-15 10:09:09 +0000
  • 17ccbb2f76 rm leftover code from a copypasto Dag-Erling Smørgrav 2015-08-28 10:44:30 +0000
  • 0961e4b2e0 Rewrite unit tests for the Fletcher and Adler checksums to exercise boundary conditions (low and high word overflow). Dag-Erling Smørgrav 2015-08-28 08:38:49 +0000
  • 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. Dag-Erling Smørgrav 2015-08-19 11:27:48 +0000
  • cbc2cd1112 If a test case triggers one of a list of signals (including SIGABRT and SIGSEGV), eat it and fail the test. Also print a summary in verbose mode. Dag-Erling Smørgrav 2015-08-19 11:17:06 +0000
  • 5e1e20c624 Add marginally useful test cases based on t_zero. Dag-Erling Smørgrav 2015-08-18 15:21:02 +0000
  • d670e3e94d Increase the sizeo of t_zero to 4096 bytes. Dag-Erling Smørgrav 2015-08-18 15:14:11 +0000
  • 531eeec36b Add a simple implementation of the Adler-32 checksum. Dag-Erling Smørgrav 2015-08-18 13:27:06 +0000
  • 1609b4e08a Cite the Fletcher paper. Dag-Erling Smørgrav 2015-08-18 10:42:41 +0000
  • 20cd7d6012 Add 16-bit endian conversion functions. Dag-Erling Smørgrav 2015-08-17 15:37:07 +0000
  • e4c5e8a9dd Fix props Dag-Erling Smørgrav 2015-08-17 15:24:50 +0000
  • aa97da3335 Add simple implementations of Fletcher's checksum. Dag-Erling Smørgrav 2015-08-17 15:21:47 +0000
  • 9103fab696 Add missing header Dag-Erling Smørgrav 2015-04-08 12:17:51 +0000
  • 0d730bd66b Don't forget to distribute and install <cryb/memset_s.h> Dag-Erling Smørgrav 2015-02-16 11:07:43 +0000
  • 110ad04333 If no SVN version is available, use today's date. Place the temporary directory in ${builddir} rather than /tmp. Dag-Erling Smørgrav 2015-02-15 09:19:25 +0000
  • dc75f2edd8 Add a memset_s() implementation (cf. C11 / WG14 N1381) Dag-Erling Smørgrav 2015-02-15 09:18:18 +0000
  • f26cbe997d There is no reason not to distribute our ctype-like macros and strl*() functions. Dag-Erling Smørgrav 2015-01-21 23:34:52 +0000
  • 342ac3fd78 Note that rand_bytes() is just a placeholder for the sake of liboath. Dag-Erling Smørgrav 2015-01-08 12:24:19 +0000
  • a33f58cad7 Fix equality predicate. Dag-Erling Smørgrav 2015-01-07 19:23:38 +0000
  • d0fb2359f1 Implement mpi_{add,sub}() in terms of mpi_{add,sub}_abs(). Dag-Erling Smørgrav 2015-01-07 18:59:44 +0000
  • cddb6c0e02 Rewrite the zero shortcut tests to avoid dropping a const qualifier. Dag-Erling Smørgrav 2014-12-30 20:03:58 +0000
  • 3904e809b2 Add two test cases for shortcut logic used when one operand is zero and the other is also the target. Dag-Erling Smørgrav 2014-12-30 19:57:07 +0000
  • 241f524238 Fix a bogus t_malloc_fail in one of the mpi_add_abs() tests. Dag-Erling Smørgrav 2014-12-30 19:48:57 +0000
  • 7a90ca7b42 Since X may point to the same MPI as either G or L (or even both), we can't set the carry flag based on the contents of G or L after having modified X. Instead, compute and stash the new carry value first. Dag-Erling Smørgrav 2014-12-30 19:14:59 +0000
  • 8d0e24dee7 Remove the "trailing garbage" version of the mpi_cmp() test. It would be better to systematically pad MPIs used in all tests with garbage. Dag-Erling Smørgrav 2014-12-30 17:00:56 +0000
  • f18b915b67 Fix the "x = a + b" allocation failure test. Since a and b were equal, mpi_sub_abs() would return early and the test would never exercise the mpi_grow() call which is intended to fail. Dag-Erling Smørgrav 2014-12-30 16:46:44 +0000
  • 0d483f20ab Fix msb calculation. We may have to backtrack quite a bit, for instance when subtracting two nearly equal large numbers. Dag-Erling Smørgrav 2014-12-30 16:45:18 +0000
  • 2027ce33e7 Add tests for the off-by-one bug we just fixed in mpi_cmp_abs(). Dag-Erling Smørgrav 2014-12-30 16:38:47 +0000
  • 1c024928f9 Fix off-by-one bug in mpi_cmp() which could cause it to read past the end of the buffer. Dag-Erling Smørgrav 2014-12-30 16:35:13 +0000
  • 43b870dc83 WIP: implement subtraction correctly. The actual result is now correct most of the time, but the MSB calculation is not. Dag-Erling Smørgrav 2014-12-30 11:23:30 +0000
  • e21452d0c7 Add a few tests for subtraction. They're not particularly well thought out, because currently subtraction does not work at all, but they work well enough in the sense that they fail with the current implementation. Dag-Erling Smørgrav 2014-12-30 11:19:02 +0000
  • 7524a14386 comment nit Dag-Erling Smørgrav 2014-12-30 11:15:28 +0000
  • c5b962387c Add mpi_eq_abs() and mpi_eq() predicates. Dag-Erling Smørgrav 2014-12-30 11:12:11 +0000
  • b6368af502 Re-add $(RT_LIBS) where needed. Dag-Erling Smørgrav 2014-12-29 23:56:22 +0000
  • 03867777c6 Add numerous tests, mostly for allocation failures and edge conditions. Add a t_compare_mpi() predicate which checks that two MPIs have the same value (but not necessarily the exact same representation). Clean up and improve existing tests. Dag-Erling Smørgrav 2014-12-29 23:54:02 +0000
  • 7b6b493509 Declare t_malloc_fail_after. Dag-Erling Smørgrav 2014-12-29 23:49:50 +0000
  • 3ec87c7a8c Introduce t_malloc_fail_after: if non-zero, it serves as a countdown to setting t_malloc_fail. Also, enforce t_malloc_fail in realloc(), but not before checking that the argument was valid. Dag-Erling Smørgrav 2014-12-29 23:49:29 +0000
  • bc8e9d67ba In both mpi_add_abs() and mpi_sub_abs(), make sure that the target is untouched if the operation fails. Also ensure that A = A +/- A works. Dag-Erling Smørgrav 2014-12-29 23:44:34 +0000
  • 98c6349d4a In mpi_zero(), save a memset() if the target is already zero. Dag-Erling Smørgrav 2014-12-29 23:22:54 +0000
  • 1412dac680 Shifting any number by zero places is a no-op, but so is shifting zero by any number of places. Dag-Erling Smørgrav 2014-12-29 23:20:26 +0000
  • 8228f19d5a In mpi_copy(), any failure should leave the target untouched. Dag-Erling Smørgrav 2014-12-29 23:18:57 +0000
  • b2ec312d9f Link each test with only the libraries it needs. This avoids rebuilding every single test whenever any of the libraries changes. Dag-Erling Smørgrav 2014-12-29 22:17:02 +0000
  • 889412ec40 Accept a -jN argument which we pass on to gmake. Delete all coverage files, not just the root one. Exit if the tests fail so we can inspect the result. Dag-Erling Smørgrav 2014-12-29 17:04:30 +0000
  • 85defb9929 Fix a cast that discards a const qualifier. Dag-Erling Smørgrav 2014-12-29 15:23:52 +0000
  • 82f5c5cf77 In mpi_load(), use be32dec() when possible. In mpi_set(), it is impossible for the value being loaded to exceed the minimum size of an mpi; thus, there is no need for mpi_grow(). Dag-Erling Smørgrav 2014-12-29 15:08:09 +0000
  • 7a09b0638f I had forgotten that t_add_test() is actually a printf()-like variadic function, which obviates the need for asprintf() in the string comparison and equality tests. Dag-Erling Smørgrav 2014-12-29 14:24:08 +0000
  • 3333bd5709 Add test cases for the static inline functions in <cryb/endian.h>. Dag-Erling Smørgrav 2014-12-29 14:20:28 +0000
  • 3e3d1f8084 Ignore test.cov Dag-Erling Smørgrav 2014-12-29 13:38:32 +0000
  • 0dae3b2417 Test string_equal() using the same test cases as for string_compare(). Improve test case descriptions. Dag-Erling Smørgrav 2014-12-29 13:36:06 +0000
  • e20e76a3f7 Recognize "on" and "off". Dag-Erling Smørgrav 2014-12-29 13:25:44 +0000
  • 82e32027af Move the decision of whether to check for memory leaks from the malloc() code to the driver and allow an environment variable to override the default (on unless coverage is enabled). Dag-Erling Smørgrav 2014-12-29 13:24:44 +0000
  • 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. Dag-Erling Smørgrav 2014-12-29 13:22:53 +0000
  • 559f6c24f7 Fix off-by-one error in TAP output: the test case number was being incremented (converted from zero-based to one-based) twice. Dag-Erling Smørgrav 2014-12-29 13:03:08 +0000
  • eb10ce6d05 If the test case changes desc, it *must* point to an allocated buffer which the driver will free after printing the result. Dag-Erling Smørgrav 2014-12-29 12:56:35 +0000
  • 79967f2844 Fix string_equal() for strings of unequal length. Dag-Erling Smørgrav 2014-12-29 12:46:44 +0000
  • 2ad45cfccf Add a string comparison function and a string equality predicate. Write test cases for the former. Dag-Erling Smørgrav 2014-12-29 12:41:39 +0000
  • 1a76a0cbb0 Get latest mkpkgng script from OpenPAM. Dag-Erling Smørgrav 2014-12-20 02:58:11 +0000
  • f82bbc1400 Catch up with OpenPAM's latest OATH changes: Dag-Erling Smørgrav 2014-12-20 01:45:01 +0000
  • 4b808bc4df Fill in. Dag-Erling Smørgrav 2014-12-20 01:38:57 +0000
  • eadeeb486c Skip memory leak checks if coverage analysis is enabled. Dag-Erling Smørgrav 2014-12-20 01:30:01 +0000
  • 75daba7501 Define CRYB_COVERAGE to 1 when building with coverage analysis. Dag-Erling Smørgrav 2014-12-20 01:09:58 +0000
  • 13bad71153 Make coverage.sh executable. Dag-Erling Smørgrav 2014-12-20 00:52:37 +0000
  • 24ae6c9434 Differentiate between the Cryb libraries and the Cryb.to project. Dag-Erling Smørgrav 2014-12-20 00:47:21 +0000
  • a98753b6ef Fix various cast-qual bugs. Dag-Erling Smørgrav 2014-12-20 00:44:24 +0000
  • dfa89d80d8 Remove bogus props. Dag-Erling Smørgrav 2014-12-20 00:40:07 +0000
  • 6ed802ddf3 Consistently use #if HAVE_FOO instead of #ifdef HAVE_FOO. The reason is that AC_CHECK_DECLS([foo]), unlike AC_CHECK_FUNCS([foo]), will always define HAVE_FOO, so #ifdef HAVE_FOO will always be true even if it is 0. This commit finally fixes the [bl]e{32,64}{enc,dec} issue on Linux. Dag-Erling Smørgrav 2014-12-20 00:38:54 +0000
  • b74f5f8588 Add -Wcast-qual to the developer warning flags. Dag-Erling Smørgrav 2014-12-20 00:27:20 +0000
  • 8ef2266a4b r103 was incomplete. It changed the checks in the configure script (and accidentally introduced a no-op line), but did not change the checks in the header, so we ended up always using our own [bl]e{32,64}{enc,dec}. Dag-Erling Smørgrav 2014-12-20 00:26:37 +0000
  • 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. Dag-Erling Smørgrav 2014-12-20 00:23:59 +0000
  • e4dd25fa79 Use wstring throughout (except internally in struct cpe_name). Add a typedef for struct cpe_name and use it throughout. Fix inverted logic in cpe_upgrade(). Dag-Erling Smørgrav 2014-11-01 20:15:45 +0000
  • a587a25d45 Ignore free(NULL) instead of treating it the same as free(malloc(0)). Dag-Erling Smørgrav 2014-10-30 16:35:54 +0000
  • 1f0fd8d9fe Create an additional test case which always runs after cleanup and checks for memory leaks. It may be necessary to make this optional at some point, but for now, none of our tests leak memory. Dag-Erling Smørgrav 2014-10-30 16:31:03 +0000
  • 44230ff5e3 Use AC_SEARCH_LIBS instead of AC_CHECK_LIB so we don't pull in librt unless we actually need it. Dag-Erling Smørgrav 2014-10-30 14:32:46 +0000
  • 86e7cd9eb1 Fix the checks for the unaligned encoding / decoding functions, as they can be macros or inline functions in either <endian.h> or <sys/endian.h>. Dag-Erling Smørgrav 2014-10-30 13:24:53 +0000
  • 14c64ec3a5 Improved checks for <sys/ktrace.h>. Dag-Erling Smørgrav 2014-10-30 13:07:16 +0000
  • 37973b8705 Use CLOCK_MONOTONIC instead of the non-standard CLOCK_MONOTONIC_PRECISE. Use librt if required for clock_gettime(2). Dag-Erling Smørgrav 2014-10-30 12:56:47 +0000
  • 75ee849080 Add missing checks for clock_gettime(2) (Linux has it in librt) and for the unaligned encoding / decoding functions in <cryb/endian.h>. Dag-Erling Smørgrav 2014-10-30 12:55:36 +0000
  • 1b84de1d0f Add <sys/types.h> for size_t / ssize_t which <cryb/wstring.h> uses. Dag-Erling Smørgrav 2014-10-30 12:52:00 +0000
  • 97e702145d Add <stdint.h> for the {,u}int*_t types. Dag-Erling Smørgrav 2014-10-30 12:51:03 +0000
  • e9bb48d9c8 Add <sys/types.h> for size_t / ssize_t which <cryb/string.h> uses. Dag-Erling Smørgrav 2014-10-30 12:50:09 +0000
  • f7bdd342dc Add our own version of <endian.h> which includes implementations of the unaligned encoding / decoding functions which Linux lacks. Dag-Erling Smørgrav 2014-10-30 12:48:21 +0000
  • 1fbf2cf156 It appears that gcc does not accept partial struct initialization. Add a CRYB_MPI_ZERO macro that expands to an all-zeroes initializer. Dag-Erling Smørgrav 2014-10-30 12:46:01 +0000
  • 46beb1adcb Various fixes for Linux and gcc portability. Dag-Erling Smørgrav 2014-10-30 12:14:05 +0000
  • cf44e01bb1 Check for <sys/ktrace.h> and utrace(2). Dag-Erling Smørgrav 2014-10-30 12:05:45 +0000
  • bd69c34a11 Emit jemalloc-compatible trace events if possible. Dag-Erling Smørgrav 2014-10-30 12:05:08 +0000
  • 277201a4bb Before we exit, explicitly call t_fcloseall() and make stdout unbuffered to reduce noise in the malloc() statistics. Dag-Erling Smørgrav 2014-10-30 12:04:29 +0000
  • bf087fd70e Gather memory allocation statistics and print them at the end if verbose. Dag-Erling Smørgrav 2014-10-30 11:05:01 +0000
  • 4a4726f9d6 Compare the result of mmap() to MAP_FAILED, not NULL. Dag-Erling Smørgrav 2014-10-18 22:01:08 +0000
  • 3be915b8d7 Previous commit was incomplete. Add missing prototypes and a test case. Dag-Erling Smørgrav 2014-08-14 18:42:52 +0000