cryb-to/t
Dag-Erling Smørgrav a09cdc6318 Fix equality predicates.
The count we passed to memcmp() in mpi_eq() and mpi_eq_abs() was actually the number of significant words in the MPI, rather than the number of bytes we wanted to compare.  Multiply by 4 to get the correct value.

To make the intent of the code more apparent, introduce a private MPI_MSW() macro which evaluates to the number of significant words (or 1-based index of the most significant word).  This also comes in handy in mpi_{add,sub,mul}_abs().

Add a couple of test cases which not only demonstrate the bug we fixed here but also demonstrate why we must compare whole words: on a big-endian machine, we would be comparing the unused upper bytes of the first and only word instead of the lower bytes which actually hold a value...
2017-04-22 05:32:25 +02:00
..
.gitignore Implement GCD using Stein's binary algorithm. 2017-04-06 19:51:47 +02:00
Makefile.am Implement GCD using Stein's binary algorithm. 2017-04-06 19:51:47 +02:00
t__string.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
t_adler.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_aes.c Use CAVP test vectors for AES and DES. 2017-04-06 19:51:45 +02:00
t_assert.c Rename t_verbose*() to t_printv*(). 2017-03-14 14:36:52 +01:00
t_chacha.c Remove incorrect and unnecessary casts. 2017-04-06 19:51:45 +02:00
t_cipher.c Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
t_core.c Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
t_ctype.c Rename t_verbose*() to t_printv*(). 2017-03-14 14:36:52 +01:00
t_cxx.cc Disable coverage analysis of the C++ test. 2017-02-19 17:33:42 +01:00
t_des.c Use CAVP test vectors for AES and DES. 2017-04-06 19:51:45 +02:00
t_digest.c Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
t_enc.c Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
t_endian.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
t_fletcher.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_hash.c Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
t_hmac_sha1.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_hmac_sha224.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_hmac_sha256.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_hmac_sha384.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_hmac_sha512.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_mac.c Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
t_md2.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
t_md4.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
t_md5.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
t_memset_s.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_mpi.c Cosmetic fixups. 2017-04-06 19:51:47 +02:00
t_mpi.h Print words in the correct order, and tack on the MSB. 2017-04-06 19:52:23 +02:00
t_mpi_addsub.c Clear a vector that was supposed to be zero. 2017-04-06 19:52:23 +02:00
t_mpi_compar.c Fix equality predicates. 2017-04-22 05:32:25 +02:00
t_mpi_gcd.c Implement GCD using Stein's binary algorithm. 2017-04-06 19:51:47 +02:00
t_mpi_muldiv.c Implement MPI division. 2017-04-06 19:52:23 +02:00
t_murmur3_32.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_oath.c Add version tests for libcryb-oath and libcryb-rand. 2016-11-21 13:52:19 +01:00
t_pearson.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_rand.c Add version tests for libcryb-oath and libcryb-rand. 2016-11-21 13:52:19 +01:00
t_rc4.c Use the keystream function like we do for other stream ciphers. 2017-04-06 19:51:45 +02:00
t_rfc3986.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_rfc4648.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_salsa.c Correct information about Joachim Strömbergson's contributions. 2017-04-06 19:51:46 +02:00
t_sha1.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_sha224.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_sha256.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_sha384.c Major cleanup of the MD and SHA digests. 2017-04-06 19:51:46 +02:00
t_sha512.c Major cleanup of the MD and SHA digests. 2017-04-06 19:51:46 +02:00
t_string.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00
t_strlcat.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_strlcmp.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_strlcpy.c Annotate t_add_test() as printf()-like and fix the fallout. 2017-03-14 15:07:02 +01:00
t_wstring.c Mechanically bump copyright dates to the date of the latest commit. 2017-02-19 20:07:43 +01:00