Merge pull request #7260 from daverodgman/test-macro-cleanup

Remove duplicate test macros
This commit is contained in:
Dave Rodgman 2023-03-13 11:34:38 +00:00 committed by GitHub
commit 6c9cea8feb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 24 deletions

View file

@ -253,27 +253,4 @@
*/ */
#define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y))
/*
* 32-bit integer manipulation macros (big endian)
*/
#ifndef GET_UINT32_BE
#define GET_UINT32_BE(n, b, i) \
{ \
(n) = ((uint32_t) (b)[(i)] << 24) \
| ((uint32_t) (b)[(i) + 1] << 16) \
| ((uint32_t) (b)[(i) + 2] << 8) \
| ((uint32_t) (b)[(i) + 3]); \
}
#endif
#ifndef PUT_UINT32_BE
#define PUT_UINT32_BE(n, b, i) \
{ \
(b)[(i)] = (unsigned char) ((n) >> 24); \
(b)[(i) + 1] = (unsigned char) ((n) >> 16); \
(b)[(i) + 2] = (unsigned char) ((n) >> 8); \
(b)[(i) + 3] = (unsigned char) ((n)); \
}
#endif
#endif /* TEST_MACROS_H */ #endif /* TEST_MACROS_H */

View file

@ -36,6 +36,7 @@
#include <string.h> #include <string.h>
#include <mbedtls/entropy.h> #include <mbedtls/entropy.h>
#include "../../library/alignment.h"
int mbedtls_test_rnd_std_rand(void *rng_state, int mbedtls_test_rnd_std_rand(void *rng_state,
unsigned char *output, unsigned char *output,
@ -137,7 +138,7 @@ int mbedtls_test_rnd_pseudo_rand(void *rng_state,
+ info->v0) ^ (sum + k[(sum>>11) & 3]); + info->v0) ^ (sum + k[(sum>>11) & 3]);
} }
PUT_UINT32_BE(info->v0, result, 0); MBEDTLS_PUT_UINT32_BE(info->v0, result, 0);
memcpy(out, result, use_len); memcpy(out, result, use_len);
len -= use_len; len -= use_len;
out += 4; out += 4;