diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_shift.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_shift.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c index 5fd6687076..eee3436702 100644 --- a/src/lib/libcrypto/bn/bn_shift.c +++ b/src/lib/libcrypto/bn/bn_shift.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_shift.c,v 1.20 2023/01/11 04:26:24 jsing Exp $ */ | 1 | /* $OpenBSD: bn_shift.c,v 1.21 2023/02/13 04:25:37 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -83,10 +83,10 @@ bn_lshift(BIGNUM *r, const BIGNUM *a, int n) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | r->top = count; | 85 | r->top = count; |
86 | r->neg = a->neg; | ||
87 | |||
88 | bn_correct_top(r); | 86 | bn_correct_top(r); |
89 | 87 | ||
88 | BN_set_negative(r, a->neg); | ||
89 | |||
90 | return 1; | 90 | return 1; |
91 | } | 91 | } |
92 | 92 | ||
@@ -139,10 +139,10 @@ bn_rshift(BIGNUM *r, const BIGNUM *a, int n) | |||
139 | *dst = *src >> rshift; | 139 | *dst = *src >> rshift; |
140 | 140 | ||
141 | r->top = count; | 141 | r->top = count; |
142 | r->neg = a->neg; | ||
143 | |||
144 | bn_correct_top(r); | 142 | bn_correct_top(r); |
145 | 143 | ||
144 | BN_set_negative(r, a->neg); | ||
145 | |||
146 | return 1; | 146 | return 1; |
147 | } | 147 | } |
148 | 148 | ||