crypto/ec/curve448/constant_time.h:151: error: INTEGER_OVERFLOW_L2
  ([0, `idx`] - 1):unsigned64 by call to `word_is_zero`.
Showing all 9 steps of the trace


crypto/ec/curve448/constant_time.h:133:1: Parameter `idx`
131.    * The table and output must not alias.
132.    */
133. > static __inline__ void
134.   __attribute__((unused,always_inline))
135.   constant_time_lookup (

crypto/ec/curve448/constant_time.h:142:57: Call
140.       word_t idx
141.   ) {
142.       big_register_t big_one = br_set_to_mask(1), big_i = br_set_to_mask(idx);
                                                               ^
143.       
144.       /* Can't do pointer arithmetic on void* */

crypto/ec/curve448/word.h:139:5: Parameter `x`
  137.       typedef uint32_t big_register_t;
  138.   
  139.       static ossl_inline big_register_t
             ^
  140.       br_set_to_mask(mask_t x) {
  141.           return (big_register_t)x;

crypto/ec/curve448/word.h:141:9: Assignment
  139.       static ossl_inline big_register_t
  140.       br_set_to_mask(mask_t x) {
  141.           return (big_register_t)x;
                 ^
  142.       }
  143.   #endif

crypto/ec/curve448/constant_time.h:142:5: Assignment
140.       word_t idx
141.   ) {
142.       big_register_t big_one = br_set_to_mask(1), big_i = br_set_to_mask(idx);
           ^
143.       
144.       /* Can't do pointer arithmetic on void* */

crypto/ec/curve448/constant_time.h:151:34: Call
149.       memset(out, 0, elem_bytes);
150.       for (j=0; j<n_table; j++, big_i-=big_one) {        
151.           big_register_t br_mask = br_is_zero(big_i);
                                        ^
152.           word_t mask;
153.   

crypto/ec/curve448/arch_32/arch_intrinsics.h:10:1: <LHS trace>
8.   #define ARCH_WORD_BITS 32
9.   
10. > static __inline__ __attribute((always_inline,unused))
11.   uint32_t word_is_zero(uint32_t a) {
12.       /* let's hope the compiler isn't clever enough to optimize this. */

crypto/ec/curve448/arch_32/arch_intrinsics.h:10:1: Parameter `a`
  8.   #define ARCH_WORD_BITS 32
  9.   
  10. > static __inline__ __attribute((always_inline,unused))
  11.   uint32_t word_is_zero(uint32_t a) {
  12.       /* let's hope the compiler isn't clever enough to optimize this. */

crypto/ec/curve448/arch_32/arch_intrinsics.h:13:5: Binary operation: ([0, idx] - 1):unsigned64 by call to `word_is_zero` 
  11.   uint32_t word_is_zero(uint32_t a) {
  12.       /* let's hope the compiler isn't clever enough to optimize this. */
  13.       return (((uint64_t)a)-1)>>32;
            ^
  14.   }
  15.   

static __inline__ __attribute((always_inline,unused))
uint32_t word_is_zero(uint32_t a) {
    return (((uint64_t)a)-1)>>32;
}
['static __inline__ void\n__attribute__((unused,always_inline))\nconstant_time_lookup (\n    void *__restrict__ out_,\n    const void *table_,\n    word_t elem_bytes,\n    word_t n_table,\n    word_t idx\n) {\n    big_register_t big_one = br_set_to_mask(1), big_i = br_set_to_mask(idx);\n    unsigned char *out = (unsigned char *)out_;\n    const unsigned char *table = (const unsigned char *)table_;\n    word_t j,k;\n    memset(out, 0, elem_bytes);\n    for (j=0; j<n_table; j++, big_i-=big_one) {\n        big_register_t br_mask = br_is_zero(big_i);\n        word_t mask;\n        for (k=0; k<=elem_bytes-sizeof(big_register_t); k+=sizeof(big_register_t)) {\n            if (elem_bytes % sizeof(big_register_t)) {\n                ((unaligned_br_t *)(out+k))->unaligned\n\t\t\t|= br_mask & ((const unaligned_br_t*)(&table[k+j*elem_bytes]))->unaligned;\n            } else {\n                *(big_register_t *)(out+k) |= br_mask & *(const big_register_t*)(&table[k+j*elem_bytes]);\n            }\n        }\n        mask = word_is_zero(idx^j);\n        if (elem_bytes % sizeof(big_register_t) >= sizeof(word_t)) {\n            for (; k<=elem_bytes-sizeof(word_t); k+=sizeof(word_t)) {\n                if (elem_bytes % sizeof(word_t)) {\n                    *(word_t *)(out+k) |= mask & ((const unaligned_word_t*)(&table[k+j*elem_bytes]))->unaligned;\n                } else {\n                    *(word_t *)(out+k) |= mask & *(const word_t*)(&table[k+j*elem_bytes]);\n                }\n            }\n        }\n        if (elem_bytes % sizeof(word_t)) {\n            for (; k<elem_bytes; k+=1) {\n                out[k] |= mask & table[k+j*elem_bytes];\n            }\n        }\n    }\n}', 'static ossl_inline big_register_t\n    br_set_to_mask(mask_t x) {\n        return (big_register_t)x;\n    }', 'static __inline__ __attribute((always_inline,unused))\nuint32_t word_is_zero(uint32_t a) {\n    return (((uint64_t)a)-1)>>32;\n}']