summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_shift.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_shift.c')
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index e2612d1e9d..6dbaffb194 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.15 2022/11/24 01:30:01 jsing Exp $ */ 1/* $OpenBSD: bn_shift.c,v 1.16 2022/11/26 13:56:33 jsing 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 *
@@ -69,8 +69,6 @@ BN_lshift1(BIGNUM *r, const BIGNUM *a)
69 BN_ULONG *ap, *rp, t, c; 69 BN_ULONG *ap, *rp, t, c;
70 int i; 70 int i;
71 71
72 bn_check_top(r);
73 bn_check_top(a);
74 72
75 if (r != a) { 73 if (r != a) {
76 r->neg = a->neg; 74 r->neg = a->neg;
@@ -93,7 +91,6 @@ BN_lshift1(BIGNUM *r, const BIGNUM *a)
93 *rp = 1; 91 *rp = 1;
94 r->top++; 92 r->top++;
95 } 93 }
96 bn_check_top(r);
97 return (1); 94 return (1);
98} 95}
99 96
@@ -103,8 +100,6 @@ BN_rshift1(BIGNUM *r, const BIGNUM *a)
103 BN_ULONG *ap, *rp, t, c; 100 BN_ULONG *ap, *rp, t, c;
104 int i, j; 101 int i, j;
105 102
106 bn_check_top(r);
107 bn_check_top(a);
108 103
109 if (BN_is_zero(a)) { 104 if (BN_is_zero(a)) {
110 BN_zero(r); 105 BN_zero(r);
@@ -129,7 +124,6 @@ BN_rshift1(BIGNUM *r, const BIGNUM *a)
129 c = (t & 1) ? BN_TBIT : 0; 124 c = (t & 1) ? BN_TBIT : 0;
130 } 125 }
131 r->top = j; 126 r->top = j;
132 bn_check_top(r);
133 return (1); 127 return (1);
134} 128}
135 129
@@ -145,8 +139,6 @@ BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
145 return 0; 139 return 0;
146 } 140 }
147 141
148 bn_check_top(r);
149 bn_check_top(a);
150 142
151 r->neg = a->neg; 143 r->neg = a->neg;
152 nw = n / BN_BITS2; 144 nw = n / BN_BITS2;
@@ -171,7 +163,6 @@ BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
171 t[i]=0;*/ 163 t[i]=0;*/
172 r->top = a->top + nw + 1; 164 r->top = a->top + nw + 1;
173 bn_correct_top(r); 165 bn_correct_top(r);
174 bn_check_top(r);
175 return (1); 166 return (1);
176} 167}
177 168
@@ -187,8 +178,6 @@ BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
187 return 0; 178 return 0;
188 } 179 }
189 180
190 bn_check_top(r);
191 bn_check_top(a);
192 181
193 nw = n / BN_BITS2; 182 nw = n / BN_BITS2;
194 rb = n % BN_BITS2; 183 rb = n % BN_BITS2;
@@ -225,6 +214,5 @@ BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
225 if ((l = (l >> rb) & BN_MASK2)) 214 if ((l = (l >> rb) & BN_MASK2))
226 *(t) = l; 215 *(t) = l;
227 } 216 }
228 bn_check_top(r);
229 return (1); 217 return (1);
230} 218}