# lab-vdsse **Repository Path**: lihx666/lab-vdsse ## Basic Information - **Project Name**: lab-vdsse - **Description**: 对四篇关于可验证的对称可搜索加密论文方案做的实验验证 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2022-05-24 - **Last Updated**: 2025-03-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ``` bash sudo apt update # sudo apt upgrade sudo apt install build-essential -y sudo apt install make cmake -y sudo apt install flex -y sudo apt install bison -y sudo apt install lzip # m4 可能要自己找资源安装 # 到网址 http://ftp.gnu.org/gnu/m4/ 下载自己需要的版本 wget http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz tar xzvf ./m4-latest.tar.gz cd m4-1.4.19/ sudo ./configure sudo make sudo make install # 安装 gmp # 官网下载源文件 https://gmplib.org/ wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz lzip -d gmp-6.2.1.tar.lz tar -xvf gmp-6.2.1.tar cd ./gmp-6.2.1 ./configure --enable-cxx make -j8 sudo make install sudo ldconfig # 安装 pbc 库 # http://crypto.stanford.edu/pbc/download.html 下载源文件 wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz sudo ./configure sudo make -j8 sudo make install # 可通过命令行进行测试 cd pbc ./pbc g := rnd(G1); g; ``` 对 gmp 库的安装测试 ``` c // test.cpp #include #include #include using namespace std; int main() { mpz_t a, b, c; mpz_inits(a, b, c, NULL); mpz_set_str(a, "123456789", 10); mpz_set_str(b, "987654321", 10); mpz_mul(c, a, b); cout << "123456789 * 987654321 = "; gmp_printf("%Zd\n", c); mpz_class x, y, z; x = 123456789; y = 987654321; z = x * y; cout << "123456789 * 987654321 = " << z << endl; return 0; } ``` 编译时要求链接库顺序在最后 ``` bash # 测试 g++ ./test.cpp -o test -lgmp -lgmpxx ``` 还要求安装 openssl ,这台电脑已经安装了,所以先不写了 下载并安装 relic 库 ``` bash unzip ./relic-main.zip cd ./relic-main mkdir relic-target cd ./relic-target cmake .. make -j8 sudo make install sudo ldconfig ``` 之后就可以使用这几个库开发了