Commit graph

349 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
83ca8031c5 Cosmetic fixups. 2017-04-06 19:51:47 +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
a11c52e896 Refactor the comparison predicates, check for identity first. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
47a0bf838f Add functions for comparing an MPI to an integer. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
26e434d64b Add functions that return the LSB and MSB of an MPI. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
7e05fe419a Remove unused headers. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
895d1eb539 Constify where possible. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
cdd1a65e84 Fix pasto which prevented cryb-mpi from being built. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
b31223ad15 Ensure that autogen.sh fails if any of its steps does. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
82ee73e14d Update ax_gcc_builtin macros from upstream. 2017-04-06 19:51:47 +02:00
Dag-Erling Smørgrav
9ee45d4e34 Fix sign bug in special cases in mpi_{add,sub}_abs().
We failed to clear the negative flag when handling trivial cases, so if one of the terms was 0 and the other was negative, the result would be an exact copy of the non-zero term instead of its absolute value.
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
95ba4d39da Bump version. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
a176c38f8f Sync debian/copyright with LICENSE. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
1f8432f6a2 First shot at a Debian package. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
165e489017 Correct information about Joachim Strömbergson's contributions. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
f29927dfe5 Correct copyright year. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
a82671403f Use the correct variable for find(1). 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
f164c3ac6e Replace the old mkpkgng script with a true port Makefile. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
3a6ba51b86 Adjust UiO copyright. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
cdbb565482 Silence compiler warnings about operator precedence. 2017-04-06 19:51:46 +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
d96415b2c3 Define vector versions of the endianness conversion functions. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
ce5562d568 Remove unused struct member. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
6f794d4739 Fix typo, add missing declarations. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
a8f0cc2e69 Neither AES nor DES have keystream functions. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
5c98dc1084 Assert that the cipher mode and key length are valid. 2017-04-06 19:51:46 +02:00
Dag-Erling Smørgrav
e21ec8afbc Use the keystream function like we do for other stream ciphers. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
536a5a31d4 Use CAVP test vectors for AES and DES. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
239ab3a471 Implement double- and triple-DES.
Single-DES is now a special case of triple-DES with all three keys being the same.  This is significantly slower than a pure single-DES implementation, but that's fine since nobody should be using it anyway.
2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
0c06ab5330 Slight cleanup of the DES code. 2017-04-06 19:51:45 +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
43dbe1350a Forgot to add chacha.h to the build. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
94720a2fff Remove incorrect and unnecessary casts. 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
d383e7ab62 Misc cleanup after API change. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
c2f4fa524f Second iteration of the cryb-cipher API.
We now have separate encryption and decryption methods, and can process an arbitrary amount of plaintext or ciphertext per call, rounded down to the block size (if applicable).  For stream ciphers, we also have a keystream method which fills the provided buffer with an arbitrary amount of keystream (once again, rounded down if applicable).
2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
8b9a7766da Remove incorrect CRYB_USED annotations. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
2e14488de0 Add missing macro for cryb_aes_cipher. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
e66d580331 Fix copy-paste error: rc4 is a cipher, not a digest. 2017-04-06 19:51:45 +02:00
Dag-Erling Smørgrav
ebcd155011 Order by year of last contribution. 2017-03-15 10:14:24 +01:00
Dag-Erling Smørgrav
7c360e7fd8 Replace pkg-config's pkg.m4 with pkgconf's extended version. 2017-03-14 15:14:12 +01: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
52cf1f9d3c Rename t_verbose*() to t_printv*().
Not only is this a slightly more logical name, but it allows us to expose the verbose flag, previously private to cryb_t_main.c, as the equally logically named t_verbose.
2017-03-14 14:36:52 +01:00
Dag-Erling Smørgrav
7b289d622f Include pkg.m4 from the latest version of pkg-config. 2017-03-07 02:28:04 +01:00
Dag-Erling Smørgrav
aafbf63023 Install pkg-config before building on Travis. 2017-03-07 02:14:32 +01:00
Dag-Erling Smørgrav
fbf69f31cb Start using pkg-config / pkgconf. 2017-03-07 00:54:46 +01:00
Dag-Erling Smørgrav
5476b36e9a Switch to using a real version number and bump. 2017-03-07 00:49:19 +01:00
Dag-Erling Smørgrav
a0444f1b08 Fix versioning when PACKAGE_VERSION is in dotted-decimal form. 2017-03-07 00:24:52 +01:00