summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 14817629aa..e4085c9d67 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.49 2021/12/04 15:48:23 tb Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.50 2021/12/04 15:53:01 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -137,6 +137,30 @@ BN_get_params(int which)
137} 137}
138#endif 138#endif
139 139
140void
141BN_set_flags(BIGNUM *b, int n)
142{
143 b->flags |= n;
144}
145
146int
147BN_get_flags(const BIGNUM *b, int n)
148{
149 return b->flags & n;
150}
151
152void
153BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
154{
155 int dest_flags;
156
157 dest_flags = (dest->flags & BN_FLG_MALLOCED) |
158 (b->flags & ~BN_FLG_MALLOCED) | BN_FLG_STATIC_DATA | flags;
159
160 *dest = *b;
161 dest->flags = dest_flags;
162}
163
140const BIGNUM * 164const BIGNUM *
141BN_value_one(void) 165BN_value_one(void)
142{ 166{