void bn_correct_top(BIGNUM *a)
{
    BN_ULONG *ftl;
    int tmp_top = a->top;
    if (tmp_top > 0) {
        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
            ftl--;
            if (*ftl != 0)
                break;
        }
        a->top = tmp_top;
    }
    bn_pollute(a);
}
['static int ecp_nistz256_set_from_affine(EC_POINT *out, const EC_GROUP *group,\n                                               const P256_POINT_AFFINE *in,\n                                               BN_CTX *ctx)\n{\n    BIGNUM *x, *y;\n    BN_ULONG d_x[P256_LIMBS], d_y[P256_LIMBS];\n    int ret = 0;\n    x = BN_new();\n    if (x == NULL)\n        return 0;\n    y = BN_new();\n    if (y == NULL) {\n        BN_free(x);\n        return 0;\n    }\n    memcpy(d_x, in->X, sizeof(d_x));\n    bn_set_static_words(x, d_x, P256_LIMBS);\n    memcpy(d_y, in->Y, sizeof(d_y));\n    bn_set_static_words(y, d_y, P256_LIMBS);\n    ret = EC_POINT_set_affine_coordinates_GFp(group, out, x, y, ctx);\n    BN_free(x);\n    BN_free(y);\n    return ret;\n}', 'void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size)\n{\n    a->d = words;\n    a->dmax = a->top = size;\n    a->neg = 0;\n    a->flags |= BN_FLG_STATIC_DATA;\n    bn_correct_top(a);\n}', 'void bn_correct_top(BIGNUM *a)\n{\n    BN_ULONG *ftl;\n    int tmp_top = a->top;\n    if (tmp_top > 0) {\n        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {\n            ftl--;\n            if (*ftl != 0)\n                break;\n        }\n        a->top = tmp_top;\n    }\n    bn_pollute(a);\n}']