summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_asm.c')
-rw-r--r--src/lib/libcrypto/bn/bn_asm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/libcrypto/bn/bn_asm.c b/src/lib/libcrypto/bn/bn_asm.c
index 3329cc18e6..44e52a40db 100644
--- a/src/lib/libcrypto/bn/bn_asm.c
+++ b/src/lib/libcrypto/bn/bn_asm.c
@@ -227,7 +227,7 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
227 227
228#else 228#else
229 229
230/* Divide h-l by d and return the result. */ 230/* Divide h,l by d and return the result. */
231/* I need to test this some more :-( */ 231/* I need to test this some more :-( */
232BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) 232BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
233 { 233 {
@@ -237,13 +237,8 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
237 if (d == 0) return(BN_MASK2); 237 if (d == 0) return(BN_MASK2);
238 238
239 i=BN_num_bits_word(d); 239 i=BN_num_bits_word(d);
240 if ((i != BN_BITS2) && (h > (BN_ULONG)1<<i)) 240 assert((i == BN_BITS2) || (h > (BN_ULONG)1<<i));
241 { 241
242#if !defined(NO_STDIO) && !defined(WIN16)
243 fprintf(stderr,"Division would overflow (%d)\n",i);
244#endif
245 abort();
246 }
247 i=BN_BITS2-i; 242 i=BN_BITS2-i;
248 if (h >= d) h-=d; 243 if (h >= d) h-=d;
249 244