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
-
安装Pbc library依赖的库:m4、flex、bison 其中在ununtu系统terminal中 M4、flex、bison均可以通过apt-get install方式安装。在Linux系统中键入如下命令即可安装相应的包。
sudo apt-get install m4 \假如第一步安装m4出错,先输入以下命令更新下源:sudo apt-get update
-
继续安装flex、bison
sudo apt-get install flex
sudo apt-get install bison -
安装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/ -
把每个安装包解压,然后./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
排错情况
-
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
-
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.