summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2021-09-10 09:08:03 +0000
committertb <>2021-09-10 09:08:03 +0000
commitd17eb2a4cbcb7c76bb5dd38f9d1c26044d64118f (patch)
tree6ca74f244b3f08830b06d9bc44a44f70ee8afc70 /src/lib
parenta357ad8885ef643d07e2a6e6f4ccdf007d2d32b8 (diff)
downloadopenbsd-d17eb2a4cbcb7c76bb5dd38f9d1c26044d64118f.tar.gz
openbsd-d17eb2a4cbcb7c76bb5dd38f9d1c26044d64118f.tar.bz2
openbsd-d17eb2a4cbcb7c76bb5dd38f9d1c26044d64118f.zip
Prepare to provide BN_RAND_* flags for BN_rand_range()
ok beck jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/bn/bn.h13
1 files changed, 12 insertions, 1 deletions
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 @@
1/* $OpenBSD: bn.h,v 1.40 2021/09/08 12:19:17 tb Exp $ */ 1/* $OpenBSD: bn.h,v 1.41 2021/09/10 09:08:03 tb Exp $ */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -231,6 +231,17 @@ extern "C" {
231#define BN_set_flags(b,n) ((b)->flags|=(n)) 231#define BN_set_flags(b,n) ((b)->flags|=(n))
232#define BN_get_flags(b,n) ((b)->flags&(n)) 232#define BN_get_flags(b,n) ((b)->flags&(n))
233 233
234#if defined(LIBRESSL_INTERNAL)
235/* Values for |top| in BN_rand() */
236#define BN_RAND_TOP_ANY -1
237#define BN_RAND_TOP_ONE 0
238#define BN_RAND_TOP_TWO 1
239
240/* Values for |bottom| in BN_rand() */
241#define BN_RAND_BOTTOM_ANY 0
242#define BN_RAND_BOTTOM_ODD 1
243#endif
244
234/* get a clone of a BIGNUM with changed flags, for *temporary* use only 245/* get a clone of a BIGNUM with changed flags, for *temporary* use only
235 * (the two BIGNUMs cannot not be used in parallel!) */ 246 * (the two BIGNUMs cannot not be used in parallel!) */
236#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ 247#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \