}
/* Now need to zero any data between b->top and b->max */
+ /* XXX Why? */
A= &(a[b->top]);
for (i=(words - b->top)>>3; i>0; i--,A+=8)
return(1);
}
-/* ignore negative */
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
{
unsigned int i,m;
return(NULL);
i=((n-1)/BN_BYTES)+1;
m=((n-1)%(BN_BYTES));
- ret->top=i-1;
+ ret->top=i;
+ ret->neg=0;
while (n-- > 0)
{
l=(l<<8L)| *(s++);
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);
+ }