add CYASSL prefix to WORD/BIT enums

This commit is contained in:
toddouska 2013-03-13 16:49:20 -07:00
parent e515638503
commit 2dfec3c6f1
4 changed files with 9 additions and 9 deletions

View File

@ -1911,7 +1911,7 @@ static word32 BytePrecision(word32 value)
{
word32 i;
for (i = sizeof(value); i; --i)
if (value >> ((i - 1) * BIT_SIZE))
if (value >> ((i - 1) * CYASSL_BIT_SIZE))
break;
return i;
@ -1928,7 +1928,7 @@ static word32 SetLength(word32 length, byte* output)
output[i++] = (byte)(BytePrecision(length) | ASN_LONG_LENGTH);
for (j = BytePrecision(length); j; --j) {
output[i] = (byte)(length >> ((j - 1) * BIT_SIZE));
output[i] = (byte)(length >> ((j - 1) * CYASSL_BIT_SIZE));
i++;
}
}

View File

@ -83,8 +83,8 @@ static word32 DiscreteLogWorkFactor(word32 n)
static void GeneratePrivate(DhKey* key, RNG* rng, byte* priv, word32* privSz)
{
word32 sz = mp_unsigned_bin_size(&key->p);
sz = min(sz, 2 * DiscreteLogWorkFactor(sz * BIT_SIZE) / BIT_SIZE + 1);
sz = min(sz, 2 * DiscreteLogWorkFactor(sz * CYASSL_BIT_SIZE) /
CYASSL_BIT_SIZE + 1);
RNG_GenerateBlock(rng, priv, sz);
priv[0] |= 0x0C;

View File

@ -163,8 +163,8 @@ STATIC INLINE void XorWords(word* r, const word* a, word32 n)
STATIC INLINE void xorbuf(byte* buf, const byte* mask, word32 count)
{
if (((word)buf | (word)mask | count) % WORD_SIZE == 0)
XorWords( (word*)buf, (const word*)mask, count / WORD_SIZE);
if (((word)buf | (word)mask | count) % CYASSL_WORD_SIZE == 0)
XorWords( (word*)buf, (const word*)mask, count / CYASSL_WORD_SIZE);
else {
word32 i;
for (i = 0; i < count; i++) buf[i] ^= mask[i];

View File

@ -97,9 +97,9 @@
enum {
WORD_SIZE = sizeof(word),
BIT_SIZE = 8,
WORD_BITS = WORD_SIZE * BIT_SIZE
CYASSL_WORD_SIZE = sizeof(word),
CYASSL_BIT_SIZE = 8,
CYASSL_WORD_BITS = CYASSL_WORD_SIZE * CYASSL_BIT_SIZE
};
#define CYASSL_MAX_16BIT 0xffffU