下载、编译、安装
-
事先下载好Visual Studio 17 2022
-
在GitHub上下载SEAL-4.0.0.zip并解压或者使用Git克隆SEAL源文件夹,
git clone https://github.com/microsoft/SEAL.git
-
在SEAL文件夹所在目录打开终端(PS:需使用Visual Studio下的Developer Command Prompt for VS 2022终端)
cd seal(文件夹名) cmake -S . -B build -G "Visual Studio 17 2022" -A x64 cmake --build build --config Release cmake --install . --config Release
完成以上三步,可以看到SEAL文件夹中
...\build\lib\Release\seal-4.0.lib
.lib文件,以及C:\Program Files\
目录下SEAL
本地安装库,这样我们就完成了seal库的编译和安装。
创建sealdemo.cpp对库进行简单测试(以build文件夹下的内容为主要依赖,以本地安装库C:\Program Files\SEAL为依赖同理):
- 新建
sealdemo.cpp
源文件,在测试前要设置好VS Project-Properties中的几项内容- C++ Language Standard
- C++ Language Standard
-
Additional Include Directories
-
Additional Libraries Directories
文章来源:https://www.toymoban.com/news/detail-460282.html
-
Additional Dependencies
文章来源地址https://www.toymoban.com/news/detail-460282.html
- sealdemo.cpp代码示例
#include "seal/seal.h"
#include <iostream>
using namespace std;
using namespace seal;
int main (){
EncryptionParameters parms(scheme_type::bfv);//生成方案所需参数
return 0;
}
- 编译运行前先设置运行环境
Coniguration:Release Platform:x64
- 编译运行
- 返回结果
成功,表示SEAL加密运算库成功编译并生成。
到了这里,关于关于在Win11-Visual Studio 2022环境中安装MicrosoftSEAL4.0(新支持BGV方案的版本)同态加密运算库的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!