diff --git a/include/cryb/mpi.h b/include/cryb/mpi.h index 8020a09..e9553e4 100644 --- a/include/cryb/mpi.h +++ b/include/cryb/mpi.h @@ -53,5 +53,7 @@ int mpi_lshift(cryb_mpi *, unsigned int); int mpi_rshift(cryb_mpi *, unsigned int); int mpi_add_abs(cryb_mpi *, cryb_mpi *, cryb_mpi *); int mpi_sub_abs(cryb_mpi *, cryb_mpi *, cryb_mpi *); +int mpi_cmp_abs(cryb_mpi *, cryb_mpi *); +int mpi_cmp(cryb_mpi *, cryb_mpi *); #endif diff --git a/t/t_mpi.c b/t/t_mpi.c index 27f06f1..e818a5d 100644 --- a/t/t_mpi.c +++ b/t/t_mpi.c @@ -586,6 +586,12 @@ static struct t_cmp_case { size_t blen; int cmpabs, cmp; } t_cmp_cases[] = { + { + "0 == 0", + { 0x00, }, 1, + { 0x00, }, 1, + 0, 0, + }, }; static int @@ -597,8 +603,8 @@ t_mpi_cmp(char **desc CRYB_UNUSED, void *arg) mpi_load(&a, tc->a, tc->alen); mpi_load(&b, tc->b, tc->blen); - ret &= t_compare_int(tc->cmpabs, mpi_cmp_abs(&a, &b)); - ret &= t_compare_int(tc->cmp, mpi_cmp(&a, &b)); + ret &= t_compare_i(tc->cmpabs, mpi_cmp_abs(&a, &b)); + ret &= t_compare_i(tc->cmp, mpi_cmp(&a, &b)); mpi_destroy(&a); mpi_destroy(&b); return (ret);