Hi there,
Iam trying to understand the way get_word works and why it does what it does that why.
It seems to me that this function returns the first word of the BIGNUM struct
when it is a one word BIGNUM. But then it does a loop which seems useless for a one
word
structure. Could anyone explain (code below)?
Thanks.
--Mehmet
BN_ULONG BN_get_word(BIGNUM *a)
{
int i,n;
BN_ULONG ret=0;
n=BN_num_bytes(a);
if (n > sizeof(BN_ULONG))
return(BN_MASK2);
for (i=a->top-1; i>=0; i--)
{
#ifndef SIXTY_FOUR_BIT /* the data item > unsigned long */
ret<<=BN_BITS4; /* stops the compiler complaining */
ret<<=BN_BITS4;
#else
ret=0;
#endif
ret|=a->d[i];
}
return(ret);
}
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]