int BN_set_word(BIGNUM *a, BN_ULONG w)
{
    bn_check_top(a);
    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
        return 0;
    a->neg = 0;
    a->d[0] = w;
    a->top = (w ? 1 : 0);
    a->flags &= ~BN_FLG_FIXED_TOP;
    bn_check_top(a);
    return 1;
}
['static int test_pq_diff(void)\n{\n    int ret = 0;\n    BIGNUM *tmp = NULL, *p = NULL, *q = NULL;\n    ret = TEST_ptr(tmp = BN_new())\n          && TEST_ptr(p = BN_new())\n          && TEST_ptr(q = BN_new())\n          && TEST_true(BN_set_word(p, 1))\n          && TEST_true(BN_set_word(q, 1+2))\n          && TEST_false(rsa_check_pminusq_diff(tmp, p, q, 202))\n          && TEST_true(BN_set_word(q, 1+3))\n          && TEST_true(rsa_check_pminusq_diff(tmp, p, q, 202))\n          && TEST_true(BN_set_word(p, 1+3))\n          && TEST_true(BN_set_word(q, 1))\n          && TEST_true(rsa_check_pminusq_diff(tmp, p, q, 202));\n    BN_free(p);\n    BN_free(q);\n    BN_free(tmp);\n    return ret;\n}', 'int BN_set_word(BIGNUM *a, BN_ULONG w)\n{\n    bn_check_top(a);\n    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)\n        return 0;\n    a->neg = 0;\n    a->d[0] = w;\n    a->top = (w ? 1 : 0);\n    a->flags &= ~BN_FLG_FIXED_TOP;\n    bn_check_top(a);\n    return 1;\n}', 'static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)\n{\n    if (bits > (INT_MAX - BN_BITS2 + 1))\n        return NULL;\n    if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax)\n        return a;\n    return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);\n}']