summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_shift.c
diff options
context:
space:
mode:
authorbeck <>2002-05-15 02:29:21 +0000
committerbeck <>2002-05-15 02:29:21 +0000
commitb64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch)
treefa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/bn/bn_shift.c
parente471e1ea98d673597b182ea85f29e30c97cd08b5 (diff)
downloadopenbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/bn/bn_shift.c')
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index c2608f9f4a..70f785ea18 100644
--- a/src/lib/libcrypto/bn/bn_shift.c
+++ b/src/lib/libcrypto/bn/bn_shift.c
@@ -60,7 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "bn_lcl.h" 61#include "bn_lcl.h"
62 62
63int BN_lshift1(BIGNUM *r, BIGNUM *a) 63int BN_lshift1(BIGNUM *r, const BIGNUM *a)
64 { 64 {
65 register BN_ULONG *ap,*rp,t,c; 65 register BN_ULONG *ap,*rp,t,c;
66 int i; 66 int i;
@@ -92,7 +92,7 @@ int BN_lshift1(BIGNUM *r, BIGNUM *a)
92 return(1); 92 return(1);
93 } 93 }
94 94
95int BN_rshift1(BIGNUM *r, BIGNUM *a) 95int BN_rshift1(BIGNUM *r, const BIGNUM *a)
96 { 96 {
97 BN_ULONG *ap,*rp,t,c; 97 BN_ULONG *ap,*rp,t,c;
98 int i; 98 int i;
@@ -128,8 +128,8 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
128 BN_ULONG l; 128 BN_ULONG l;
129 129
130 r->neg=a->neg; 130 r->neg=a->neg;
131 if (bn_wexpand(r,a->top+(n/BN_BITS2)+1) == NULL) return(0);
132 nw=n/BN_BITS2; 131 nw=n/BN_BITS2;
132 if (bn_wexpand(r,a->top+nw+1) == NULL) return(0);
133 lb=n%BN_BITS2; 133 lb=n%BN_BITS2;
134 rb=BN_BITS2-lb; 134 rb=BN_BITS2-lb;
135 f=a->d; 135 f=a->d;
@@ -153,7 +153,7 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
153 return(1); 153 return(1);
154 } 154 }
155 155
156int BN_rshift(BIGNUM *r, BIGNUM *a, int n) 156int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
157 { 157 {
158 int i,j,nw,lb,rb; 158 int i,j,nw,lb,rb;
159 BN_ULONG *t,*f; 159 BN_ULONG *t,*f;