charm-crypto-0.5安装

本文指导如何在Python 3.7环境下正确安装Charm-crypto 0.5库,包括修改Python版本、安装GMP、PBC、OPENSSL依赖,并解决编译过程中遇到的头文件缺失问题。务必使用Python 3.7,分享了云盘链接和正确库版本选择建议。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

charm-crypto0.5安装


前言

这个库对于python 2.x不能正常使用,跑代码会有相关函数报错的问题。一定要使用python 3.7!!!python3.7!!!python3.7!!!3.6与3.9都不可以用,泪的教训!
下面所有需要下载的包,我给个云盘
链接:https://pan.baidu.com/s/14FLFP7jMWdZ337DcrGf_lQ
提取码:zhhl

不要去相信这个官网 的链接,里面下的0.42的包不对,用GitHub上的0.50的包,就是我云盘给的包

一、修改Linux下Python的版本

https://www.cnblogs.com/shenckicc/p/5683597.html

二、安装依赖库:GMP,PBC,OPENSSL

  1. 安装Pbc library依赖的库:m4、flex、bison 其中在ununtu系统terminal中 M4、flex、bison均可以通过apt-get install方式安装。在Linux系统中键入如下命令即可安装相应的包。

    sudo apt-get install m4 \假如第一步安装m4出错,先输入以下命令更新下源:sudo apt-get update

  2. 继续安装flex、bison
    sudo apt-get install flex
    sudo apt-get install bison

  3. 安装gmp,pbc,openssl库(下载我云盘的包,就不用下下面几个链接的了)
    Pyparsing http://pyparsing.wikispaces.com/ 这个装python的时候就装了
    GMP 5.x http://gmplib.org/
    PBC (latest) http://crypto.stanford.edu/pbc/news.html
    OPENSSL http://www.openssl.org/

  4. 把每个安装包解压,然后./configure **** make **** make install 三步走
    注意:
    OpenSSL是1 ./config **** 2 make **** 3 make install
    charm-crypto是1 ./configure.sh ****2 make ****3 make install
    另注:pip install pyparsing==2.4.7

排错情况

  1. Python.h No such file or directory

    charm/core/benchmark/benchmarkmodule.h:10:10: fatal error: Python.h: No such file or directory
    

    解决办法: apt-get install python3.7-dev

  2. openssl/objects.h: No such file or directory

    charm/core/math/pairing/pairingmodule.h:44:29: fatal error: openssl/objects.h: No such file or directory compilation terminated.
    

    解决办法: apt-get install libssl-dev

三、测试及结果

sudo make test

Finally,once you see most of the items are passed, you can start programming with Charm Crypto.
Some example schemes can be found in charm/schemes directory.
在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值