diff options
author | miod <> | 2015-09-12 09:04:12 +0000 |
---|---|---|
committer | miod <> | 2015-09-12 09:04:12 +0000 |
commit | 32fbd9cd51e433720fd763c2a82cc8ef2dec855c (patch) | |
tree | a6b1cd6a5a521b99d3dd74b223c76a724cb49697 /src | |
parent | 6144f48e89ae4129a0d4588a071fb1025e5211b7 (diff) | |
download | openbsd-32fbd9cd51e433720fd763c2a82cc8ef2dec855c.tar.gz openbsd-32fbd9cd51e433720fd763c2a82cc8ef2dec855c.tar.bz2 openbsd-32fbd9cd51e433720fd763c2a82cc8ef2dec855c.zip |
Remove workaround for old SIMICS toolchain.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/bn/asm/x86_64-gcc.c | 46 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c | 46 |
2 files changed, 2 insertions, 90 deletions
diff --git a/src/lib/libcrypto/bn/asm/x86_64-gcc.c b/src/lib/libcrypto/bn/asm/x86_64-gcc.c index 9deffa71f1..bd068cfb51 100644 --- a/src/lib/libcrypto/bn/asm/x86_64-gcc.c +++ b/src/lib/libcrypto/bn/asm/x86_64-gcc.c | |||
@@ -1,8 +1,5 @@ | |||
1 | /* $OpenBSD: x86_64-gcc.c,v 1.5 2015/02/25 15:39:49 bcook Exp $ */ | 1 | /* $OpenBSD: x86_64-gcc.c,v 1.6 2015/09/12 09:04:12 miod Exp $ */ |
2 | #include "../bn_lcl.h" | 2 | #include "../bn_lcl.h" |
3 | #if !(defined(__GNUC__) && __GNUC__>=2) | ||
4 | # include "../bn_asm.c" /* kind of dirty hack for Sun Studio */ | ||
5 | #else | ||
6 | /* | 3 | /* |
7 | * x86_64 BIGNUM accelerator version 0.1, December 2002. | 4 | * x86_64 BIGNUM accelerator version 0.1, December 2002. |
8 | * | 5 | * |
@@ -203,7 +200,6 @@ BN_ULONG bn_add_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int | |||
203 | return ret&1; | 200 | return ret&1; |
204 | } | 201 | } |
205 | 202 | ||
206 | #ifndef SIMICS | ||
207 | BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int n) | 203 | BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int n) |
208 | { BN_ULONG ret=0,i=0; | 204 | { BN_ULONG ret=0,i=0; |
209 | 205 | ||
@@ -225,45 +221,6 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int | |||
225 | 221 | ||
226 | return ret&1; | 222 | return ret&1; |
227 | } | 223 | } |
228 | #else | ||
229 | /* Simics 1.4<7 has buggy sbbq:-( */ | ||
230 | #define BN_MASK2 0xffffffffffffffffL | ||
231 | BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n) | ||
232 | { | ||
233 | BN_ULONG t1,t2; | ||
234 | int c=0; | ||
235 | |||
236 | if (n <= 0) return((BN_ULONG)0); | ||
237 | |||
238 | for (;;) | ||
239 | { | ||
240 | t1=a[0]; t2=b[0]; | ||
241 | r[0]=(t1-t2-c)&BN_MASK2; | ||
242 | if (t1 != t2) c=(t1 < t2); | ||
243 | if (--n <= 0) break; | ||
244 | |||
245 | t1=a[1]; t2=b[1]; | ||
246 | r[1]=(t1-t2-c)&BN_MASK2; | ||
247 | if (t1 != t2) c=(t1 < t2); | ||
248 | if (--n <= 0) break; | ||
249 | |||
250 | t1=a[2]; t2=b[2]; | ||
251 | r[2]=(t1-t2-c)&BN_MASK2; | ||
252 | if (t1 != t2) c=(t1 < t2); | ||
253 | if (--n <= 0) break; | ||
254 | |||
255 | t1=a[3]; t2=b[3]; | ||
256 | r[3]=(t1-t2-c)&BN_MASK2; | ||
257 | if (t1 != t2) c=(t1 < t2); | ||
258 | if (--n <= 0) break; | ||
259 | |||
260 | a+=4; | ||
261 | b+=4; | ||
262 | r+=4; | ||
263 | } | ||
264 | return(c); | ||
265 | } | ||
266 | #endif | ||
267 | 224 | ||
268 | /* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */ | 225 | /* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */ |
269 | /* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */ | 226 | /* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */ |
@@ -595,4 +552,3 @@ void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a) | |||
595 | r[6]=c1; | 552 | r[6]=c1; |
596 | r[7]=c2; | 553 | r[7]=c2; |
597 | } | 554 | } |
598 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c b/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c index 9deffa71f1..bd068cfb51 100644 --- a/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c +++ b/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c | |||
@@ -1,8 +1,5 @@ | |||
1 | /* $OpenBSD: x86_64-gcc.c,v 1.5 2015/02/25 15:39:49 bcook Exp $ */ | 1 | /* $OpenBSD: x86_64-gcc.c,v 1.6 2015/09/12 09:04:12 miod Exp $ */ |
2 | #include "../bn_lcl.h" | 2 | #include "../bn_lcl.h" |
3 | #if !(defined(__GNUC__) && __GNUC__>=2) | ||
4 | # include "../bn_asm.c" /* kind of dirty hack for Sun Studio */ | ||
5 | #else | ||
6 | /* | 3 | /* |
7 | * x86_64 BIGNUM accelerator version 0.1, December 2002. | 4 | * x86_64 BIGNUM accelerator version 0.1, December 2002. |
8 | * | 5 | * |
@@ -203,7 +200,6 @@ BN_ULONG bn_add_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int | |||
203 | return ret&1; | 200 | return ret&1; |
204 | } | 201 | } |
205 | 202 | ||
206 | #ifndef SIMICS | ||
207 | BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int n) | 203 | BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int n) |
208 | { BN_ULONG ret=0,i=0; | 204 | { BN_ULONG ret=0,i=0; |
209 | 205 | ||
@@ -225,45 +221,6 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int | |||
225 | 221 | ||
226 | return ret&1; | 222 | return ret&1; |
227 | } | 223 | } |
228 | #else | ||
229 | /* Simics 1.4<7 has buggy sbbq:-( */ | ||
230 | #define BN_MASK2 0xffffffffffffffffL | ||
231 | BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n) | ||
232 | { | ||
233 | BN_ULONG t1,t2; | ||
234 | int c=0; | ||
235 | |||
236 | if (n <= 0) return((BN_ULONG)0); | ||
237 | |||
238 | for (;;) | ||
239 | { | ||
240 | t1=a[0]; t2=b[0]; | ||
241 | r[0]=(t1-t2-c)&BN_MASK2; | ||
242 | if (t1 != t2) c=(t1 < t2); | ||
243 | if (--n <= 0) break; | ||
244 | |||
245 | t1=a[1]; t2=b[1]; | ||
246 | r[1]=(t1-t2-c)&BN_MASK2; | ||
247 | if (t1 != t2) c=(t1 < t2); | ||
248 | if (--n <= 0) break; | ||
249 | |||
250 | t1=a[2]; t2=b[2]; | ||
251 | r[2]=(t1-t2-c)&BN_MASK2; | ||
252 | if (t1 != t2) c=(t1 < t2); | ||
253 | if (--n <= 0) break; | ||
254 | |||
255 | t1=a[3]; t2=b[3]; | ||
256 | r[3]=(t1-t2-c)&BN_MASK2; | ||
257 | if (t1 != t2) c=(t1 < t2); | ||
258 | if (--n <= 0) break; | ||
259 | |||
260 | a+=4; | ||
261 | b+=4; | ||
262 | r+=4; | ||
263 | } | ||
264 | return(c); | ||
265 | } | ||
266 | #endif | ||
267 | 224 | ||
268 | /* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */ | 225 | /* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */ |
269 | /* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */ | 226 | /* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */ |
@@ -595,4 +552,3 @@ void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a) | |||
595 | r[6]=c1; | 552 | r[6]=c1; |
596 | r[7]=c2; | 553 | r[7]=c2; |
597 | } | 554 | } |
598 | #endif | ||