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

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

1767

被折叠的 条评论
为什么被折叠?



