mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
add CYASSL prefix to WORD/BIT enums
This commit is contained in:
@@ -1911,7 +1911,7 @@ static word32 BytePrecision(word32 value)
|
|||||||
{
|
{
|
||||||
word32 i;
|
word32 i;
|
||||||
for (i = sizeof(value); i; --i)
|
for (i = sizeof(value); i; --i)
|
||||||
if (value >> ((i - 1) * BIT_SIZE))
|
if (value >> ((i - 1) * CYASSL_BIT_SIZE))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
@@ -1928,7 +1928,7 @@ static word32 SetLength(word32 length, byte* output)
|
|||||||
output[i++] = (byte)(BytePrecision(length) | ASN_LONG_LENGTH);
|
output[i++] = (byte)(BytePrecision(length) | ASN_LONG_LENGTH);
|
||||||
|
|
||||||
for (j = BytePrecision(length); j; --j) {
|
for (j = BytePrecision(length); j; --j) {
|
||||||
output[i] = (byte)(length >> ((j - 1) * BIT_SIZE));
|
output[i] = (byte)(length >> ((j - 1) * CYASSL_BIT_SIZE));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -83,8 +83,8 @@ static word32 DiscreteLogWorkFactor(word32 n)
|
|||||||
static void GeneratePrivate(DhKey* key, RNG* rng, byte* priv, word32* privSz)
|
static void GeneratePrivate(DhKey* key, RNG* rng, byte* priv, word32* privSz)
|
||||||
{
|
{
|
||||||
word32 sz = mp_unsigned_bin_size(&key->p);
|
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);
|
RNG_GenerateBlock(rng, priv, sz);
|
||||||
priv[0] |= 0x0C;
|
priv[0] |= 0x0C;
|
||||||
|
|
||||||
|
@@ -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)
|
STATIC INLINE void xorbuf(byte* buf, const byte* mask, word32 count)
|
||||||
{
|
{
|
||||||
if (((word)buf | (word)mask | count) % WORD_SIZE == 0)
|
if (((word)buf | (word)mask | count) % CYASSL_WORD_SIZE == 0)
|
||||||
XorWords( (word*)buf, (const word*)mask, count / WORD_SIZE);
|
XorWords( (word*)buf, (const word*)mask, count / CYASSL_WORD_SIZE);
|
||||||
else {
|
else {
|
||||||
word32 i;
|
word32 i;
|
||||||
for (i = 0; i < count; i++) buf[i] ^= mask[i];
|
for (i = 0; i < count; i++) buf[i] ^= mask[i];
|
||||||
|
@@ -97,9 +97,9 @@
|
|||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
WORD_SIZE = sizeof(word),
|
CYASSL_WORD_SIZE = sizeof(word),
|
||||||
BIT_SIZE = 8,
|
CYASSL_BIT_SIZE = 8,
|
||||||
WORD_BITS = WORD_SIZE * BIT_SIZE
|
CYASSL_WORD_BITS = CYASSL_WORD_SIZE * CYASSL_BIT_SIZE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CYASSL_MAX_16BIT 0xffffU
|
#define CYASSL_MAX_16BIT 0xffffU
|
||||||
|
Reference in New Issue
Block a user