summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiod <>2014-04-23 19:17:48 +0000
committermiod <>2014-04-23 19:17:48 +0000
commitd00940e5e20f9781f7b51788398c2bbc89795cb4 (patch)
treed835b807899fa8347e295ab57c3546d3b78a3802
parent74919198a661a79b8b1d178302a6f95d210b5faf (diff)
downloadopenbsd-d00940e5e20f9781f7b51788398c2bbc89795cb4.tar.gz
openbsd-d00940e5e20f9781f7b51788398c2bbc89795cb4.tar.bz2
openbsd-d00940e5e20f9781f7b51788398c2bbc89795cb4.zip
When I grow up, I want to write workaround for long long multiplications
under __TANDEM systems and compilers, using hardcoded octal numbers. NOT.
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c15
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_mont.c15
2 files changed, 0 insertions, 30 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 456a80bde6..6274a934bb 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -207,22 +207,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
207#endif 207#endif
208 for (carry=0, i=0; i<nl; i++, rp++) 208 for (carry=0, i=0; i<nl; i++, rp++)
209 { 209 {
210#ifdef __TANDEM
211 {
212 long long t1;
213 long long t2;
214 long long t3;
215 t1 = rp[0] * (n0 & 0177777);
216 t2 = 037777600000l;
217 t2 = n0 & t2;
218 t3 = rp[0] & 0177777;
219 t2 = (t3 * t2) & BN_MASK2;
220 t1 = t1 + t2;
221 v=bn_mul_add_words(rp,np,nl,(BN_ULONG) t1);
222 }
223#else
224 v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2); 210 v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2);
225#endif
226 v = (v+carry+rp[nl])&BN_MASK2; 211 v = (v+carry+rp[nl])&BN_MASK2;
227 carry |= (v != rp[nl]); 212 carry |= (v != rp[nl]);
228 carry &= (v <= rp[nl]); 213 carry &= (v <= rp[nl]);
diff --git a/src/lib/libssl/src/crypto/bn/bn_mont.c b/src/lib/libssl/src/crypto/bn/bn_mont.c
index 456a80bde6..6274a934bb 100644
--- a/src/lib/libssl/src/crypto/bn/bn_mont.c
+++ b/src/lib/libssl/src/crypto/bn/bn_mont.c
@@ -207,22 +207,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
207#endif 207#endif
208 for (carry=0, i=0; i<nl; i++, rp++) 208 for (carry=0, i=0; i<nl; i++, rp++)
209 { 209 {
210#ifdef __TANDEM
211 {
212 long long t1;
213 long long t2;
214 long long t3;
215 t1 = rp[0] * (n0 & 0177777);
216 t2 = 037777600000l;
217 t2 = n0 & t2;
218 t3 = rp[0] & 0177777;
219 t2 = (t3 * t2) & BN_MASK2;
220 t1 = t1 + t2;
221 v=bn_mul_add_words(rp,np,nl,(BN_ULONG) t1);
222 }
223#else
224 v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2); 210 v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2);
225#endif
226 v = (v+carry+rp[nl])&BN_MASK2; 211 v = (v+carry+rp[nl])&BN_MASK2;
227 carry |= (v != rp[nl]); 212 carry |= (v != rp[nl]);
228 carry &= (v <= rp[nl]); 213 carry &= (v <= rp[nl]);