From a096d42e2ef6d92064a8ee5211e80718e4895236 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 10 Sep 2021 09:08:03 +0000 Subject: [PATCH] Prepare to provide BN_RAND_* flags for BN_rand_range() ok beck jsing --- lib/libcrypto/bn/bn.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/libcrypto/bn/bn.h b/lib/libcrypto/bn/bn.h index f03b2c7be72..8fc5e270fc1 100644 --- a/lib/libcrypto/bn/bn.h +++ b/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, \ -- 2.20.1