cryb-to/lib/mpi
Dag-Erling Smørgrav f6905c8edb Fix bugs in cryb_mpi_{add,sub}_abs() caused by assuming that the target is initally positive zero.
If its operands were identical, cryb_mpi_add_abs() would leave the target untouched.  Explicitly call mpi_zero() before returning.  While there, extend the “identical operands” shortcut to also cover equality.

Both cryb_mpi_add_abs() and cryb_mpi_sub_abs() would leave the target's negative flag untouched.  Explicitly clear it before returning.
2017-02-19 17:20:40 +01:00
..
cryb_mpi.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_add.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_add_abs.c Fix bugs in cryb_mpi_{add,sub}_abs() caused by assuming that the target is initally positive zero. 2017-02-19 17:20:40 +01:00
cryb_mpi_cmp.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_cmp_abs.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_copy.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_destroy.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_eq.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_eq_abs.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_grow.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_impl.h Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_init.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_load.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_lshift.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_negate.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_rshift.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_set.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_sub.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_sub_abs.c Fix bugs in cryb_mpi_{add,sub}_abs() caused by assuming that the target is initally positive zero. 2017-02-19 17:20:40 +01:00
cryb_mpi_swap.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
cryb_mpi_zero.c Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
Makefile.am Add dependencies on libcryb-core to all other libraries, as already enforced in the configure script. 2016-11-14 12:59:13 +01:00
README Start of a multiple-precision integer arithmetic library. 2014-08-12 07:30:31 +00:00

Portable multiple-precision integer library.

The interface is loosely based on XySSL's MPI library.  The
implementation was written from scratch based on the algorithms
described in Menezes, van Oorschot and Vanstone: _Handbook of Applied
Cryptography_, CRC Press, 1996.  The full text of the HAC is available
for personal use at http://www.cacr.math.uwaterloo.ca/hac/.

This implementation sacrifices performance for portability and
readability, but attempts have been made to structure it in such a way
that critical portions can easily be replaced with machine-dependent
optimized versions.

The code assumes a 64-bit machine or a 32-bit machine where 64-bit
integer arithmetic is supported but not necessarily efficient; 64-bit
operations are used only to simplify overflow handling.