The Cryb libraries
Find a file
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
debian Sync debian/copyright with LICENSE. 2017-04-06 19:51:46 +02:00
freebsd Use the correct variable for find(1). 2017-04-06 19:51:46 +02:00
include Implement MPI division. 2017-04-06 19:52:23 +02:00
lib Fix equality predicates. 2017-04-22 05:32:25 +02:00
m4 Update ax_gcc_builtin macros from upstream. 2017-04-06 19:51:47 +02:00
t Fix equality predicates. 2017-04-22 05:32:25 +02:00
tools Centralize most of .gitignore. 2016-09-17 21:38:54 +02:00
.gitignore Start using pkg-config / pkgconf. 2017-03-07 00:54:46 +01:00
.travis.yml Install pkg-config before building on Travis. 2017-03-07 02:14:32 +01:00
autogen.des Respect user's CC 2016-09-04 16:18:13 +02:00
autogen.sh Ensure that autogen.sh fails if any of its steps does. 2017-04-06 19:51:47 +02:00
configure.ac Implement ffs() / fls() and use the latter to compute the MSB. 2017-04-06 19:52:23 +02:00
CREDITS Implement the ChaCha family of stream ciphers. 2017-04-06 19:51:45 +02:00
HISTORY Standard files that "make dist" complains about. 2014-07-10 14:44:17 +00:00
INSTALL Standard files that "make dist" complains about. 2014-07-10 14:44:17 +00:00
LICENSE Correct information about Joachim Strömbergson's contributions. 2017-04-06 19:51:46 +02:00
Makefile.am Include pkg.m4 from the latest version of pkg-config. 2017-03-07 02:28:04 +01:00
README typo 2015-12-14 16:05:18 +01:00
README.md Prepare for moving to Github 2015-12-14 15:55:38 +01:00
RELNOTES Standard files that "make dist" complains about. 2014-07-10 14:44:17 +00:00

The Cryb libraries

The Cryb libraries are a collection of cryptography- and security-related function libraries written with the following goals in mind:

  • Comprehensive: Cryb aims to provide a rich and flexible set of building blocks for cryptographic applications.

  • Self-contained and easily embeddable: the Cryb libraries have no external dependencies (apart from the toolchain) and few internal ones. Individual modules and algorithms can easily be extracted from Cryb and integrated into other codebases.

  • Reliable: the libraries come with an extensive test suite with a long-term goal of 100% test coverage.

  • Stable: guaranteed API and ABI stability.

  • Documented: full API documentation in the form of Unix man pages.

  • Consistently and permissively licensed: the entire collection is under the 3-clause BSD license.

Caveat

We aren't there yet. The Cryb libraries are still undeniably at the experimental stage. However, significant portions are already in production use as components in other projects (cf: easily embeddable), and we have great expectations for the future of Cryb.