static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
{
    return constant_time_msb(~a & (a - 1));
}
['int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,\n                                   const unsigned char *from, int flen,\n                                   int num)\n{\n    int i;\n    unsigned char *em = NULL;\n    unsigned int good, found_zero_byte, mask;\n    int zero_index = 0, msg_index, mlen = -1;\n    if (tlen <= 0 || flen <= 0)\n        return -1;\n    if (flen > num || num < 11) {\n        RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2,\n               RSA_R_PKCS_DECODING_ERROR);\n        return -1;\n    }\n    em = OPENSSL_malloc(num);\n    if (em == NULL) {\n        RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2, ERR_R_MALLOC_FAILURE);\n        return -1;\n    }\n    for (from += flen, em += num, i = 0; i < num; i++) {\n        mask = ~constant_time_is_zero(flen);\n        flen -= 1 & mask;\n        from -= 1 & mask;\n        *--em = *from & mask;\n    }\n    good = constant_time_is_zero(em[0]);\n    good &= constant_time_eq(em[1], 2);\n    found_zero_byte = 0;\n    for (i = 2; i < num; i++) {\n        unsigned int equals0 = constant_time_is_zero(em[i]);\n        zero_index = constant_time_select_int(~found_zero_byte & equals0,\n                                              i, zero_index);\n        found_zero_byte |= equals0;\n    }\n    good &= constant_time_ge(zero_index, 2 + 8);\n    msg_index = zero_index + 1;\n    mlen = num - msg_index;\n    good &= constant_time_ge(tlen, mlen);\n    tlen = constant_time_select_int(constant_time_lt(num - 11, tlen),\n                                    num - 11, tlen);\n    msg_index = constant_time_select_int(good, msg_index, num - tlen);\n    mlen = num - msg_index;\n    for (mask = good, i = 0; i < tlen; i++) {\n        unsigned int equals = constant_time_eq(msg_index, num);\n        msg_index -= tlen & equals;\n        mask &= ~equals;\n        to[i] = constant_time_select_8(mask, em[msg_index++], to[i]);\n    }\n    OPENSSL_clear_free(em, num);\n    RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2, RSA_R_PKCS_DECODING_ERROR);\n    err_clear_last_constant_time(1 & good);\n    return constant_time_select_int(good, mlen, -1);\n}', 'static ossl_inline unsigned int constant_time_is_zero(unsigned int a)\n{\n    return constant_time_msb(~a & (a - 1));\n}']