diff options
author | Rich Salz <rsalz@akamai.com> | 2016-01-28 16:13:21 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-01-30 22:54:35 +0100 |
commit | 94af0cd7f3a8130bbc23feb743b176a74eec7e10 (patch) | |
tree | bcbcf406c23c84a27b73c90392830299720f6fbc /test/bntest.c | |
parent | GH102: Add volatile to CRYPTO_memcmp (diff) | |
download | openssl-94af0cd7f3a8130bbc23feb743b176a74eec7e10.tar.xz openssl-94af0cd7f3a8130bbc23feb743b176a74eec7e10.zip |
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/bntest.c')
-rw-r--r-- | test/bntest.c | 29 |
1 files changed, 18 insertions, 11 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) |