Make sure EC_window_bits_for_scalar_size() returns a size_t
[openssl.git] / crypto / ec / ec_mult.c
index c71a69ac0d45676304cb3b0b2ce0e4ee557c4a8e..236b66c18a6be7f747f63cf0361abb1782e1ce76 100644 (file)
@@ -307,12 +307,13 @@ static signed char *compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
  *       (thus the boundaries should be increased)
  */
 #define EC_window_bits_for_scalar_size(b) \
-               ((b) >= 2000 ? 6 : \
-                (b) >=  800 ? 5 : \
-                (b) >=  300 ? 4 : \
-                (b) >=   70 ? 3 : \
-                (b) >=   20 ? 2 : \
-                 1)
+               ((size_t) \
+                ((b) >= 2000 ? 6 : \
+                 (b) >=  800 ? 5 : \
+                 (b) >=  300 ? 4 : \
+                 (b) >=   70 ? 3 : \
+                 (b) >=   20 ? 2 : \
+                 1))
 
 /* Compute
  *      \sum scalars[i]*points[i],