a09cdc6318
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... |
||
---|---|---|
debian | ||
freebsd | ||
include | ||
lib | ||
m4 | ||
t | ||
tools | ||
.gitignore | ||
.travis.yml | ||
autogen.des | ||
autogen.sh | ||
configure.ac | ||
CREDITS | ||
HISTORY | ||
INSTALL | ||
LICENSE | ||
Makefile.am | ||
README | ||
README.md | ||
RELNOTES |
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.