crypto/bn/bn_exp.c:641: error: INTEGER_OVERFLOW_L2
  (0 - [0, 1]):unsigned64.
Showing all 12 steps of the trace


crypto/bn/bn_exp.c:642:40: <RHS trace>
640.               for (j = 0; j < width; j++) {
641.                   acc |= table[j] &
642.                          ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
                                              ^
643.               }
644.   

crypto/bn/bn_exp.c:642:40: Call
640.               for (j = 0; j < width; j++) {
641.                   acc |= table[j] &
642.                          ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
                                              ^
643.               }
644.   

include/internal/constant_time_locl.h:189:12: Call
  187.   static ossl_inline unsigned int constant_time_eq_int(int a, int b)
  188.   {
  189.       return constant_time_eq((unsigned)(a), (unsigned)(b));
                    ^
  190.   }
  191.   

include/internal/constant_time_locl.h:178:12: Call
    176.                                                    unsigned int b)
    177.   {
    178.       return constant_time_is_zero(a ^ b);
                      ^
    179.   }
    180.   

include/internal/constant_time_locl.h:165:1: Parameter `a`
      163.   }
      164.   
      165. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
      166.   {
      167.       return constant_time_msb(~a & (a - 1));

include/internal/constant_time_locl.h:167:12: Call
      165.   static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
      166.   {
      167.       return constant_time_msb(~a & (a - 1));
                        ^
      168.   }
      169.   

include/internal/constant_time_locl.h:136:1: Parameter `a`
        134.                                                   int b);
        135.   
        136. > static ossl_inline unsigned int constant_time_msb(unsigned int a)
        137.   {
        138.       return 0 - (a >> (sizeof(a) * 8 - 1));

include/internal/constant_time_locl.h:138:5: Assignment
        136.   static ossl_inline unsigned int constant_time_msb(unsigned int a)
        137.   {
        138.       return 0 - (a >> (sizeof(a) * 8 - 1));
                   ^
        139.   }
        140.   

include/internal/constant_time_locl.h:167:5: Assignment
      165.   static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
      166.   {
      167.       return constant_time_msb(~a & (a - 1));
                 ^
      168.   }
      169.   

include/internal/constant_time_locl.h:178:5: Assignment
    176.                                                    unsigned int b)
    177.   {
    178.       return constant_time_is_zero(a ^ b);
               ^
    179.   }
    180.   

include/internal/constant_time_locl.h:189:5: Assignment
  187.   static ossl_inline unsigned int constant_time_eq_int(int a, int b)
  188.   {
  189.       return constant_time_eq((unsigned)(a), (unsigned)(b));
             ^
  190.   }
  191.   

crypto/bn/bn_exp.c:641:17: Binary operation: (0 - [0, 1]):unsigned64
639.   
640.               for (j = 0; j < width; j++) {
641.                   acc |= table[j] &
                       ^
642.                          ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
643.               }

static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
                                          unsigned char *buf, int idx,
                                          int window)
{
    int i, j;
    int width = 1 << window;
    volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
    if (bn_wexpand(b, top) == NULL)
        return 0;
    if (window <= 3) {
        for (i = 0; i < top; i++, table += width) {
            BN_ULONG acc = 0;
            for (j = 0; j < width; j++) {
                acc |= table[j] &
                       ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
            }
            b->d[i] = acc;
        }
    } else {
        int xstride = 1 << (window - 2);
        BN_ULONG y0, y1, y2, y3;
        i = idx >> (window - 2);
        idx &= xstride - 1;
        y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);
        y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1);
        y2 = (BN_ULONG)0 - (constant_time_eq_int(i,2)&1);
        y3 = (BN_ULONG)0 - (constant_time_eq_int(i,3)&1);
        for (i = 0; i < top; i++, table += width) {
            BN_ULONG acc = 0;
            for (j = 0; j < xstride; j++) {
                acc |= ( (table[j + 0 * xstride] & y0) |
                         (table[j + 1 * xstride] & y1) |
                         (table[j + 2 * xstride] & y2) |
                         (table[j + 3 * xstride] & y3) )
                       & ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
            }
            b->d[i] = acc;
        }
    }
    b->top = top;
    bn_correct_top(b);
    return 1;
}
['static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,\n                                          unsigned char *buf, int idx,\n                                          int window)\n{\n    int i, j;\n    int width = 1 << window;\n    volatile BN_ULONG *table = (volatile BN_ULONG *)buf;\n    if (bn_wexpand(b, top) == NULL)\n        return 0;\n    if (window <= 3) {\n        for (i = 0; i < top; i++, table += width) {\n            BN_ULONG acc = 0;\n            for (j = 0; j < width; j++) {\n                acc |= table[j] &\n                       ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));\n            }\n            b->d[i] = acc;\n        }\n    } else {\n        int xstride = 1 << (window - 2);\n        BN_ULONG y0, y1, y2, y3;\n        i = idx >> (window - 2);\n        idx &= xstride - 1;\n        y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);\n        y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1);\n        y2 = (BN_ULONG)0 - (constant_time_eq_int(i,2)&1);\n        y3 = (BN_ULONG)0 - (constant_time_eq_int(i,3)&1);\n        for (i = 0; i < top; i++, table += width) {\n            BN_ULONG acc = 0;\n            for (j = 0; j < xstride; j++) {\n                acc |= ( (table[j + 0 * xstride] & y0) |\n                         (table[j + 1 * xstride] & y1) |\n                         (table[j + 2 * xstride] & y2) |\n                         (table[j + 3 * xstride] & y3) )\n                       & ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));\n            }\n            b->d[i] = acc;\n        }\n    }\n    b->top = top;\n    bn_correct_top(b);\n    return 1;\n}', 'static ossl_inline unsigned int constant_time_eq_int(int a, int b)\n{\n    return constant_time_eq((unsigned)(a), (unsigned)(b));\n}', 'static ossl_inline unsigned int constant_time_eq(unsigned int a,\n                                                 unsigned int b)\n{\n    return constant_time_is_zero(a ^ b);\n}', 'static ossl_inline unsigned int constant_time_is_zero(unsigned int a)\n{\n    return constant_time_msb(~a & (a - 1));\n}', 'static ossl_inline unsigned int constant_time_msb(unsigned int a)\n{\n    return 0 - (a >> (sizeof(a) * 8 - 1));\n}']