SEAL全同态加密开源库(十一) BFV-源码浅析(2)

本文详细分析了SEAL库中BFV(Bootstrapping-free Fully Homomorphic Encryption)加密方案的源码,探讨了加密参数如poly_modulus_degree、coeff_modulus和plain_modulus的设置及其对性能和安全性的影响。通过示例展示了如何使用BFV进行多项式计算,并解释了噪声预算和重线性化等关键概念。同时,文中指出选择适当参数的重要性,以确保计算的正确性和安全性。

2021SC@SDUSC

2021-12-12

前言

从本篇开始,接上一篇的BFV分析,这里我们继续分析BFV源码。争取本篇结束战斗。
与之前的工作相比,这些代码显得更具整体性,也能更好体现出SEAL的工作原理以及流程,算是对前面的集大成者了,因此很有分析的必要。

BFV-2

本篇我们将继续分析examples/1_bfv_basics.cpp。看一看SEAL对于bfv是如何实现的。
先看整体的运行效果:
来自example.cpp,输入1即可得到BFV方案的运行示例。

Microsoft SEAL version: 3.7.1
+---------------------------------------------------------+
| The following examples should be executed while reading |
| comments in associated files in native/examples/.       |
+---------------------------------------------------------+
| Examples                   | Source Files               |
+----------------------------+----------------------------+
| 1. BFV Basics              | 1_bfv_basics.cpp           |
| 2. Encoders                | 2_encoders.cpp             |
| 3. Levels                  | 3_levels.cpp               |
| 4. CKKS Basics             | 4_ckks_basics.cpp          |
| 5. Rotation                | 5_rotation.cpp             |
| 6. Serialization           | 6_serialization.cpp        |
| 7. Performance Test        | 7_performance.cpp          |
+----------------------------+----------------------------+
[      0 MB] Total allocation from the memory pool

> Run example (1 ~ 7) or exit (0): 1

+-------------------------------------+
|         Example: BFV Basics         |
+-------------------------------------+
Line 132 --> Set encryption parameters and print
/
| Encryption parameters :
|   scheme: BFV
|   poly_modulus_degree: 4096
|   coeff_modulus size: 109 (36 + 36 + 37) bits
|   plain_modulus: 1024
\
Parameter validation (success): valid

~~~~~~ A naive way to calculate 4(x^2+1
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值