diff options
-rw-r--r-- | mpi/mpi-cmp.c | 5 | ||||
-rw-r--r-- | mpi/mpiutil.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/mpi/mpi-cmp.c b/mpi/mpi-cmp.c index 66e09612..8927fa0e 100644 --- a/mpi/mpi-cmp.c +++ b/mpi/mpi-cmp.c @@ -89,8 +89,11 @@ do_mpi_cmp (gcry_mpi_t u, gcry_mpi_t v, int absmode) usign = absmode? 0 : u->sign; vsign = absmode? 0 : v->sign; - /* Compare sign bits. */ + /* Special treatment for +0 == -0 */ + if (!usize && !vsize) + return 0; + /* Compare sign bits. */ if (!usign && vsign) return 1; if (usign && !vsign) diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index a9e812e2..86b8361e 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -561,7 +561,7 @@ _gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u) * int so that the value can be used with the bit test functions; in * contrast the other _ui functions take an unsigned long so that on * some platforms they may accept a larger value. On error the value - * at U is not changed. */ + * at W is not changed. */ gcry_err_code_t _gcry_mpi_get_ui (unsigned int *w, gcry_mpi_t u) { |