diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index cfdf46906b..20212bf171 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.45 2021/12/04 15:48:23 tb Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.46 2021/12/04 15:53:01 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 | * |
@@ -228,8 +228,14 @@ extern "C" { | |||
228 | #ifndef OPENSSL_NO_DEPRECATED | 228 | #ifndef OPENSSL_NO_DEPRECATED |
229 | #define BN_FLG_FREE 0x8000 /* used for debugging */ | 229 | #define BN_FLG_FREE 0x8000 /* used for debugging */ |
230 | #endif | 230 | #endif |
231 | #if defined(LIBRESSL_OPAQUE_BN) || defined(LIBRESSL_CRYPTO_INTERNAL) | ||
232 | void BN_set_flags(BIGNUM *b, int n); | ||
233 | int BN_get_flags(const BIGNUM *b, int n); | ||
234 | void BN_with_flags(BIGNUM *dest, const BIGNUM *src, int flags); | ||
235 | #else | ||
231 | #define BN_set_flags(b,n) ((b)->flags|=(n)) | 236 | #define BN_set_flags(b,n) ((b)->flags|=(n)) |
232 | #define BN_get_flags(b,n) ((b)->flags&(n)) | 237 | #define BN_get_flags(b,n) ((b)->flags&(n)) |
238 | #endif | ||
233 | 239 | ||
234 | /* Values for |top| in BN_rand() */ | 240 | /* Values for |top| in BN_rand() */ |
235 | #define BN_RAND_TOP_ANY -1 | 241 | #define BN_RAND_TOP_ANY -1 |
@@ -240,6 +246,7 @@ extern "C" { | |||
240 | #define BN_RAND_BOTTOM_ANY 0 | 246 | #define BN_RAND_BOTTOM_ANY 0 |
241 | #define BN_RAND_BOTTOM_ODD 1 | 247 | #define BN_RAND_BOTTOM_ODD 1 |
242 | 248 | ||
249 | #if !defined(LIBRESSL_OPAQUE_BN) && !defined(LIBRESSL_CRYPTO_INTERNAL) | ||
243 | /* get a clone of a BIGNUM with changed flags, for *temporary* use only | 250 | /* get a clone of a BIGNUM with changed flags, for *temporary* use only |
244 | * (the two BIGNUMs cannot not be used in parallel!) */ | 251 | * (the two BIGNUMs cannot not be used in parallel!) */ |
245 | #define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ | 252 | #define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ |
@@ -250,6 +257,7 @@ extern "C" { | |||
250 | | ((b)->flags & ~BN_FLG_MALLOCED) \ | 257 | | ((b)->flags & ~BN_FLG_MALLOCED) \ |
251 | | BN_FLG_STATIC_DATA \ | 258 | | BN_FLG_STATIC_DATA \ |
252 | | (n))) | 259 | | (n))) |
260 | #endif | ||
253 | 261 | ||
254 | struct bignum_st { | 262 | struct bignum_st { |
255 | BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ | 263 | BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ |