summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2016-01-28 10:13:21 -0500
committerRich Salz <rsalz@openssl.org>2016-01-30 16:54:35 -0500
commit94af0cd7f3a8130bbc23feb743b176a74eec7e10 (patch)
treebcbcf406c23c84a27b73c90392830299720f6fbc /test
parent98ab57644f44d2d83595c2d0f69138a284d6096b (diff)
Move more BN internals to bn_lcl.h
There was an unused macro in ssl_locl.h that used an internal type, so I removed it. Move bio_st from bio.h to ossl_type.h Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'test')
-rw-r--r--test/bntest.c29
-rw-r--r--test/exptest.c2
2 files changed, 19 insertions, 12 deletions
diff --git a/test/bntest.c b/test/bntest.c
index 6b62c05050..d315ad8432 100644
--- a/test/bntest.c
+++ b/test/bntest.c
@@ -502,18 +502,25 @@ int test_div(BIO *bp, BN_CTX *ctx)
static void print_word(BIO *bp, BN_ULONG w)
{
-#ifdef SIXTY_FOUR_BIT
- if (sizeof(w) > sizeof(unsigned long)) {
- unsigned long h = (unsigned long)(w >> 32), l = (unsigned long)(w);
-
- if (h)
- BIO_printf(bp, "%lX%08lX", h, l);
+ int i = sizeof(w) * 8;
+ char *fmt = NULL;
+ unsigned char byte;
+
+ do {
+ i -= 8;
+ byte = (unsigned char)(w >> i);
+ if (fmt == NULL)
+ fmt = byte ? "%X" : NULL;
else
- BIO_printf(bp, "%lX", l);
- return;
- }
-#endif
- BIO_printf(bp, BN_HEX_FMT1, w);
+ fmt = "%02X";
+
+ if (fmt != NULL)
+ BIO_printf(bp, fmt, byte);
+ } while (i);
+
+ /* If we haven't printed anything, at least print a zero! */
+ if (fmt == NULL)
+ BIO_printf(bp, "0");
}
int test_div_word(BIO *bp)
diff --git a/test/exptest.c b/test/exptest.c
index 7a155f957d..0acdacced7 100644
--- a/test/exptest.c
+++ b/test/exptest.c
@@ -66,7 +66,7 @@
#include <openssl/rand.h>
#include <openssl/err.h>
-#define NUM_BITS (BN_BITS*2)
+#define NUM_BITS (BN_BITS2 * 4)
static const char rnd_seed[] =
"string to make the random number generator think it has entropy";