int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words)
{
    if (bn_wexpand(a, num_words) == NULL) {
        BNerr(BN_F_BN_SET_WORDS, ERR_R_MALLOC_FAILURE);
        return 0;
    }
    memcpy(a->d, words, sizeof(BN_ULONG) * num_words);
    a->top = num_words;
    bn_correct_top(a);
    return 1;
}
['static int ecp_nistz256_get_affine(const EC_GROUP *group,\n                                          const EC_POINT *point,\n                                          BIGNUM *x, BIGNUM *y, BN_CTX *ctx)\n{\n    BN_ULONG z_inv2[P256_LIMBS];\n    BN_ULONG z_inv3[P256_LIMBS];\n    BN_ULONG x_aff[P256_LIMBS];\n    BN_ULONG y_aff[P256_LIMBS];\n    BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS];\n    BN_ULONG x_ret[P256_LIMBS], y_ret[P256_LIMBS];\n    if (EC_POINT_is_at_infinity(group, point)) {\n        ECerr(EC_F_ECP_NISTZ256_GET_AFFINE, EC_R_POINT_AT_INFINITY);\n        return 0;\n    }\n    if (!ecp_nistz256_bignum_to_field_elem(point_x, point->X) ||\n        !ecp_nistz256_bignum_to_field_elem(point_y, point->Y) ||\n        !ecp_nistz256_bignum_to_field_elem(point_z, point->Z)) {\n        ECerr(EC_F_ECP_NISTZ256_GET_AFFINE, EC_R_COORDINATES_OUT_OF_RANGE);\n        return 0;\n    }\n    ecp_nistz256_mod_inverse(z_inv3, point_z);\n    ecp_nistz256_sqr_mont(z_inv2, z_inv3);\n    ecp_nistz256_mul_mont(x_aff, z_inv2, point_x);\n    if (x != NULL) {\n        ecp_nistz256_from_mont(x_ret, x_aff);\n        if (!bn_set_words(x, x_ret, P256_LIMBS))\n            return 0;\n    }\n    if (y != NULL) {\n        ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2);\n        ecp_nistz256_mul_mont(y_aff, z_inv3, point_y);\n        ecp_nistz256_from_mont(y_ret, y_aff);\n        if (!bn_set_words(y, y_ret, P256_LIMBS))\n            return 0;\n    }\n    return 1;\n}', 'int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words)\n{\n    if (bn_wexpand(a, num_words) == NULL) {\n        BNerr(BN_F_BN_SET_WORDS, ERR_R_MALLOC_FAILURE);\n        return 0;\n    }\n    memcpy(a->d, words, sizeof(BN_ULONG) * num_words);\n    a->top = num_words;\n    bn_correct_top(a);\n    return 1;\n}', 'BIGNUM *bn_wexpand(BIGNUM *a, int words)\n{\n    return (words <= a->dmax) ? a : bn_expand2(a, words);\n}']