mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
fix compilation for 32 bits OS
This commit is contained in:
@@ -4290,7 +4290,7 @@ int mp_rand_prime(mp_int* N, int len, RNG* rng, void* heap)
|
|||||||
byte* buf;
|
byte* buf;
|
||||||
|
|
||||||
if (N == NULL || rng == NULL)
|
if (N == NULL || rng == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return MP_VAL;
|
||||||
|
|
||||||
/* get type */
|
/* get type */
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
@@ -4302,13 +4302,13 @@ int mp_rand_prime(mp_int* N, int len, RNG* rng, void* heap)
|
|||||||
|
|
||||||
/* allow sizes between 2 and 512 bytes for a prime size */
|
/* allow sizes between 2 and 512 bytes for a prime size */
|
||||||
if (len < 2 || len > 512) {
|
if (len < 2 || len > 512) {
|
||||||
return BAD_FUNC_ARG;
|
return MP_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate buffer to work with */
|
/* allocate buffer to work with */
|
||||||
buf = (byte*)XMALLOC(len, heap, DYNAMIC_TYPE_RSA);
|
buf = (byte*)XMALLOC(len, heap, DYNAMIC_TYPE_RSA);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return MEMORY_E;
|
return MP_MEM;
|
||||||
}
|
}
|
||||||
XMEMSET(buf, 0, len);
|
XMEMSET(buf, 0, len);
|
||||||
|
|
||||||
@@ -4341,7 +4341,7 @@ int mp_rand_prime(mp_int* N, int len, RNG* rng, void* heap)
|
|||||||
}
|
}
|
||||||
} while (res == MP_NO);
|
} while (res == MP_NO);
|
||||||
|
|
||||||
ForceZero(buf, len);
|
XMEMSET(buf, 0, len);
|
||||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
||||||
|
|
||||||
return MP_OKAY;
|
return MP_OKAY;
|
||||||
|
Reference in New Issue
Block a user