Fix bn_cmp_part_words() and move it to bn_lib.c.

This commit is contained in:
Ulf Möller
2000-12-02 07:28:43 +00:00
parent 0826c85f4c
commit 52a1bab2d9
3 changed files with 29 additions and 13 deletions

View File

@@ -777,3 +777,28 @@ int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
}
return(0);
}
int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
int cl, int dl)
{
int n,i;
n = cl-1;
if (dl < 0)
{
for (i=-dl; i>0; i++)
{
if (b[n+i] != 0)
return -1; /* a < b */
}
}
if (dl > 0)
{
for (i=dl; i>0; i--)
{
if (a[n+i] != 0)
return 1; /* a > b */
}
}
return bn_cmp_words(a,b,cl);
}