summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2021-09-10 09:08:04 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2021-09-10 09:08:04 +0000
commit8e99f47642107a5da0c2addc674ef8e272946d27 (patch)
tree2cfaeb74386df45eab29d5d503f52686a9b9deb3 /lib/libcrypto
parent41aa89f10c88b968ac1b46a60c61120c32245240 (diff)
Prepare to provide BN_RAND_* flags for BN_rand_range()
ok beck jsing
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/bn/bn.h13
1 files changed, 12 insertions, 1 deletions
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, \