mirror of
https://github.com/cryb-to/cryb-to.git
synced 2025-01-03 10:21:10 +00:00
Previous commit was incomplete. Add missing prototypes and a test case.
This commit is contained in:
parent
885c586ce9
commit
3be915b8d7
2 changed files with 10 additions and 2 deletions
|
@ -53,5 +53,7 @@ int mpi_lshift(cryb_mpi *, unsigned int);
|
||||||
int mpi_rshift(cryb_mpi *, unsigned int);
|
int mpi_rshift(cryb_mpi *, unsigned int);
|
||||||
int mpi_add_abs(cryb_mpi *, cryb_mpi *, cryb_mpi *);
|
int mpi_add_abs(cryb_mpi *, cryb_mpi *, cryb_mpi *);
|
||||||
int mpi_sub_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
|
#endif
|
||||||
|
|
10
t/t_mpi.c
10
t/t_mpi.c
|
@ -586,6 +586,12 @@ static struct t_cmp_case {
|
||||||
size_t blen;
|
size_t blen;
|
||||||
int cmpabs, cmp;
|
int cmpabs, cmp;
|
||||||
} t_cmp_cases[] = {
|
} t_cmp_cases[] = {
|
||||||
|
{
|
||||||
|
"0 == 0",
|
||||||
|
{ 0x00, }, 1,
|
||||||
|
{ 0x00, }, 1,
|
||||||
|
0, 0,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -597,8 +603,8 @@ t_mpi_cmp(char **desc CRYB_UNUSED, void *arg)
|
||||||
|
|
||||||
mpi_load(&a, tc->a, tc->alen);
|
mpi_load(&a, tc->a, tc->alen);
|
||||||
mpi_load(&b, tc->b, tc->blen);
|
mpi_load(&b, tc->b, tc->blen);
|
||||||
ret &= t_compare_int(tc->cmpabs, mpi_cmp_abs(&a, &b));
|
ret &= t_compare_i(tc->cmpabs, mpi_cmp_abs(&a, &b));
|
||||||
ret &= t_compare_int(tc->cmp, mpi_cmp(&a, &b));
|
ret &= t_compare_i(tc->cmp, mpi_cmp(&a, &b));
|
||||||
mpi_destroy(&a);
|
mpi_destroy(&a);
|
||||||
mpi_destroy(&b);
|
mpi_destroy(&b);
|
||||||
return (ret);
|
return (ret);
|
||||||
|
|
Loading…
Reference in a new issue