From d17eb2a4cbcb7c76bb5dd38f9d1c26044d64118f Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 10 Sep 2021 09:08:03 +0000 Subject: Prepare to provide BN_RAND_* flags for BN_rand_range() ok beck jsing --- src/lib/libcrypto/bn/bn.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index f03b2c7be7..8fc5e270fc 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.40 2021/09/08 12:19:17 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.41 2021/09/10 09:08:03 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -231,6 +231,17 @@ extern "C" { #define BN_set_flags(b,n) ((b)->flags|=(n)) #define BN_get_flags(b,n) ((b)->flags&(n)) +#if defined(LIBRESSL_INTERNAL) +/* Values for |top| in BN_rand() */ +#define BN_RAND_TOP_ANY -1 +#define BN_RAND_TOP_ONE 0 +#define BN_RAND_TOP_TWO 1 + +/* Values for |bottom| in BN_rand() */ +#define BN_RAND_BOTTOM_ANY 0 +#define BN_RAND_BOTTOM_ODD 1 +#endif + /* get a clone of a BIGNUM with changed flags, for *temporary* use only * (the two BIGNUMs cannot not be used in parallel!) */ #define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ -- cgit v1.2.3-55-g6feb