diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-09-10 09:08:04 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-09-10 09:08:04 +0000 |
commit | 8e99f47642107a5da0c2addc674ef8e272946d27 (patch) | |
tree | 2cfaeb74386df45eab29d5d503f52686a9b9deb3 /lib/libcrypto | |
parent | 41aa89f10c88b968ac1b46a60c61120c32245240 (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.h | 13 |
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, \ |