From: jsing Date: Wed, 19 Apr 2023 10:54:49 +0000 (+0000) Subject: Move BN_options() from bn_convert.c to bn_lib.c X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=104ba9f76109c2e1543fe70ea6bc809f29f90f1e;p=openbsd Move BN_options() from bn_convert.c to bn_lib.c --- diff --git a/lib/libcrypto/bn/bn_convert.c b/lib/libcrypto/bn/bn_convert.c index ab6c7924f19..20bea922185 100644 --- a/lib/libcrypto/bn/bn_convert.c +++ b/lib/libcrypto/bn/bn_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_convert.c,v 1.2 2023/04/17 12:36:59 jsing Exp $ */ +/* $OpenBSD: bn_convert.c,v 1.3 2023/04/19 10:54:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -465,22 +465,3 @@ end: return (ret); } #endif - -char * -BN_options(void) -{ - static int init = 0; - static char data[16]; - - if (!init) { - init++; -#ifdef BN_LLONG - snprintf(data,sizeof data, "bn(%d,%d)", - (int)sizeof(BN_ULLONG) * 8, (int)sizeof(BN_ULONG) * 8); -#else - snprintf(data,sizeof data, "bn(%d,%d)", - (int)sizeof(BN_ULONG) * 8, (int)sizeof(BN_ULONG) * 8); -#endif - } - return (data); -} diff --git a/lib/libcrypto/bn/bn_lib.c b/lib/libcrypto/bn/bn_lib.c index 89664fbb97b..cd06563a5d2 100644 --- a/lib/libcrypto/bn/bn_lib.c +++ b/lib/libcrypto/bn/bn_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lib.c,v 1.82 2023/04/19 10:51:22 jsing Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.83 2023/04/19 10:54:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -900,6 +900,25 @@ BN_is_negative(const BIGNUM *a) return a->neg != 0; } +char * +BN_options(void) +{ + static int init = 0; + static char data[16]; + + if (!init) { + init++; +#ifdef BN_LLONG + snprintf(data,sizeof data, "bn(%d,%d)", + (int)sizeof(BN_ULLONG) * 8, (int)sizeof(BN_ULONG) * 8); +#else + snprintf(data,sizeof data, "bn(%d,%d)", + (int)sizeof(BN_ULONG) * 8, (int)sizeof(BN_ULONG) * 8); +#endif + } + return (data); +} + /* * Bits of security, see SP800-57, section 5.6.11, table 2. */