公司建站花费,品牌推广的三个阶段,温州网站建设对比,滁州市重点工程建设管理局网站#x1f680; 优质资源分享 #x1f680;
学习路线指引#xff08;点击解锁#xff09;知识定位人群定位#x1f9e1; Python实战微信订餐小程序 #x1f9e1;进阶级本课程是python flask微信小程序的完美结合#xff0c;从项目搭建到腾讯云部署上线#xff0c;打造一… 优质资源分享
学习路线指引点击解锁知识定位人群定位 Python实战微信订餐小程序 进阶级本课程是python flask微信小程序的完美结合从项目搭建到腾讯云部署上线打造一个全栈订餐系统。Python量化交易实战入门级手把手带你打造一个易扩展、更安全、效率更高的量化交易系统
阈值PSI 若交集数量超过某个给定阈值时允许分布式的各个参与方在自己集合中找到交集且除了交集外得不到其他额外信息。 实现论文 Multi-Party Threshold Private Set Intersection with Sublinear Communication
源码地址https://github.com/ontanj/tpsi
其中FTPSI−intFTPSI−intF_{TPSI-int}做出部分修改因为基于TFHE无法实现自举bootstrapping技术。
用到的加密算法
TAHETAHETAHEPaillier-https://github.com/niclabs/tcpaillier
TFHETFHETFHEBFV-https://github.com/ldsec/lattigo
接口
1AHE_Cryptosystem和FHE_Cryptosystem实现同态运算
type AHE_Cryptosystem interface {// 密文密文Add(Ciphertext, Ciphertext) (sum Ciphertext, err error)// 密文^{明文}Scale(cipher Ciphertext, factor *big.Int) (product Ciphertext, err error)// 加密Encrypt(*big.Int) (Ciphertext, error)// 聚合明文CombinePartials([]Partial_decryption) (*big.Int, error)// 计算加密矩阵EvaluationSpace() gm.Space// 明文空间大小N() *big.Int
}
type FHE_Cryptosystem interface {AHE_Cryptosystem// 密文*密文Multiply(Ciphertext, Ciphertext) (Ciphertext, error)
}
2AHE_setting和FHE_setting包含参与方数量、阈值大小和通信方式
type AHE_setting interface {// 阈值Threshold() int// 参与方Parties() int// AHEAHE\_cryptosystem() AHE_Cryptosystem// central方发布消息给其他方Distribute(interface{})// 其他方给central方传递消息Send(interface{})// central方给指定方发送消息SendTo(int, interface{})// central方等待来其他方的消息并将其按顺序分组ReceiveAll() []interface{}// 接手central方的消息Receive() interface{}// 判断是否为central方IsCentral() bool
}
type FHE_setting interface {AHE_setting// FHEFHE\_cryptosystem() FHE_Cryptosystem
}
本实验是在一台机器上模拟多方通信通过goroutine实现。 goroutine在go语言中每一个并发的执行单元叫做goroutine如果一个程序中包含多个goroutine对两个函数的调用则可能发生在同一时刻。 运行
go run main/main.go diff dj 7 main/elements
其中FTPSI-diff使用的是TAHE阈值为7。
功能
1TPSIdiffWorker在交集测试下求交集和差集
2TPSIintWorker在差集测试下求交集和差集 测试
P10,3,6,9,13,16
P20,3,6,9,14,17
P30,3,6,9,14,15
P40,3,6,9,12,17
P50,3,6,9,13,15T7//交集大时用TFHE求
go run main/main.go int bfv 7 main/elements
//差集小时用TAHE求
go run main/main.go diff dj 7 main/elements
//差集小时用TFHE求
go run main/main.go diff bfv 7 main/elements
s/秒intdiffTFHE515.5320072391.952714TAHE/26.436323
总结 用FHE实现效率是显而易见的