int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
                           const BIGNUM *order, const BIGNUM *cofactor)
{
    if (generator == NULL) {
        ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER);
        return 0;
    }
    if (group->generator == NULL) {
        group->generator = EC_POINT_new(group);
        if (group->generator == NULL)
            return 0;
    }
    if (!EC_POINT_copy(group->generator, generator))
        return 0;
    if (order != NULL) {
        if (!BN_copy(group->order, order))
            return 0;
    } else
        BN_zero(group->order);
    if (cofactor != NULL) {
        if (!BN_copy(group->cofactor, cofactor))
            return 0;
    } else
        BN_zero(group->cofactor);
    ec_precompute_mont_data(group);
    return 1;
}
['int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,\n                           const BIGNUM *order, const BIGNUM *cofactor)\n{\n    if (generator == NULL) {\n        ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER);\n        return 0;\n    }\n    if (group->generator == NULL) {\n        group->generator = EC_POINT_new(group);\n        if (group->generator == NULL)\n            return 0;\n    }\n    if (!EC_POINT_copy(group->generator, generator))\n        return 0;\n    if (order != NULL) {\n        if (!BN_copy(group->order, order))\n            return 0;\n    } else\n        BN_zero(group->order);\n    if (cofactor != NULL) {\n        if (!BN_copy(group->cofactor, cofactor))\n            return 0;\n    } else\n        BN_zero(group->cofactor);\n    ec_precompute_mont_data(group);\n    return 1;\n}', 'EC_POINT *EC_POINT_new(const EC_GROUP *group)\n{\n    EC_POINT *ret;\n    if (group == NULL) {\n        ECerr(EC_F_EC_POINT_NEW, ERR_R_PASSED_NULL_PARAMETER);\n        return NULL;\n    }\n    if (group->meth->point_init == 0) {\n        ECerr(EC_F_EC_POINT_NEW, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);\n        return NULL;\n    }\n    ret = OPENSSL_malloc(sizeof(*ret));\n    if (ret == NULL) {\n        ECerr(EC_F_EC_POINT_NEW, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    ret->meth = group->meth;\n    if (!ret->meth->point_init(ret)) {\n        OPENSSL_free(ret);\n        return NULL;\n    }\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src)\n{\n    if (dest->meth->point_copy == 0) {\n        ECerr(EC_F_EC_POINT_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);\n        return 0;\n    }\n    if (dest->meth != src->meth) {\n        ECerr(EC_F_EC_POINT_COPY, EC_R_INCOMPATIBLE_OBJECTS);\n        return 0;\n    }\n    if (dest == src)\n        return 1;\n    return dest->meth->point_copy(dest, src);\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    bn_check_top(a);\n    return (1);\n}']