EC_KEY *EC_KEY_new_method(ENGINE *engine)
{
    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
    if (ret == NULL) {
        ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_MALLOC_FAILURE);
        return (NULL);
    }
    ret->meth = EC_KEY_get_default_method();
#ifndef OPENSSL_NO_ENGINE
    if (engine != NULL) {
        if (!ENGINE_init(engine)) {
            ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);
            OPENSSL_free(ret);
            return NULL;
        }
        ret->engine = engine;
    } else
        ret->engine = ENGINE_get_default_EC();
    if (ret->engine != NULL) {
        ret->meth = ENGINE_get_EC(ret->engine);
        if (ret->meth == NULL) {
            ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);
            ENGINE_finish(ret->engine);
            OPENSSL_free(ret);
            return NULL;
        }
    }
#endif
    ret->version = 1;
    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
    ret->references = 1;
    if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
        EC_KEY_free(ret);
        return NULL;
    }
    return ret;
}
['EC_KEY *EC_KEY_new_method(ENGINE *engine)\n{\n    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));\n    if (ret == NULL) {\n        ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->meth = EC_KEY_get_default_method();\n#ifndef OPENSSL_NO_ENGINE\n    if (engine != NULL) {\n        if (!ENGINE_init(engine)) {\n            ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);\n            OPENSSL_free(ret);\n            return NULL;\n        }\n        ret->engine = engine;\n    } else\n        ret->engine = ENGINE_get_default_EC();\n    if (ret->engine != NULL) {\n        ret->meth = ENGINE_get_EC(ret->engine);\n        if (ret->meth == NULL) {\n            ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_ENGINE_LIB);\n            ENGINE_finish(ret->engine);\n            OPENSSL_free(ret);\n            return NULL;\n        }\n    }\n#endif\n    ret->version = 1;\n    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;\n    ret->references = 1;\n    if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {\n        EC_KEY_free(ret);\n        return NULL;\n    }\n    return ret;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\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}', 'const EC_KEY_METHOD *EC_KEY_get_default_method(void)\n{\n    return default_ec_key_meth;\n}', 'int ENGINE_init(ENGINE *e)\n{\n    int ret;\n    if (e == NULL) {\n        ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER);\n        return 0;\n    }\n    CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);\n    ret = engine_unlocked_init(e);\n    CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);\n    return ret;\n}', 'void CRYPTO_lock(int mode, int type, const char *file, int line)\n{\n#ifdef LOCK_DEBUG\n    {\n        CRYPTO_THREADID id;\n        char *rw_text, *operation_text;\n        if (mode & CRYPTO_LOCK)\n            operation_text = "lock  ";\n        else if (mode & CRYPTO_UNLOCK)\n            operation_text = "unlock";\n        else\n            operation_text = "ERROR ";\n        if (mode & CRYPTO_READ)\n            rw_text = "r";\n        else if (mode & CRYPTO_WRITE)\n            rw_text = "w";\n        else\n            rw_text = "ERROR";\n        CRYPTO_THREADID_current(&id);\n        fprintf(stderr, "lock:%08lx:(%s)%s %-18s %s:%d\\n",\n                CRYPTO_THREADID_hash(&id), rw_text, operation_text,\n                CRYPTO_get_lock_name(type), file, line);\n    }\n#endif\n    if (type < 0) {\n        if (dynlock_lock_callback != NULL) {\n            struct CRYPTO_dynlock_value *pointer\n                = CRYPTO_get_dynlock_value(type);\n            OPENSSL_assert(pointer != NULL);\n            dynlock_lock_callback(mode, pointer, file, line);\n            CRYPTO_destroy_dynlockid(type);\n        }\n    } else if (locking_callback != NULL)\n        locking_callback(mode, type, file, line);\n}', 'int engine_unlocked_init(ENGINE *e)\n{\n    int to_return = 1;\n    if ((e->funct_ref == 0) && e->init)\n        to_return = e->init(e);\n    if (to_return) {\n        e->struct_ref++;\n        e->funct_ref++;\n        engine_ref_debug(e, 0, 1)\n            engine_ref_debug(e, 1, 1)\n    }\n    return to_return;\n}', 'const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e)\n{\n    return e->ec_meth;\n}']