同态排序算法

参考文献:

  1. Batcher68\] Batcher K E. Sorting networks and their applications\[C\]//Proceedings of the April 30--May 2, 1968, spring joint computer conference. 1968: 307-314.

    tology ePrint Archive 2011, 133 (2011)

  2. CKS13\] Chatterjee A, Kaushal M, Sengupta I. Accelerating sorting of fully homomorphic encrypted data\[C\]//Progress in Cryptology--INDOCRYPT 2013: 14th International Conference on Cryptology in India, Mumbai, India, December 7-10, 2013. Proceedings 14. Springer International Publishing, 2013: 262-273.

  3. EGNS15\] Emmadi N, Gauravaram P, Narumanchi H, et al. Updates on sorting of fully homomorphic encrypted data\[C\]//2015 International Conference on Cloud Computing Research and Innovation (ICCCRI). IEEE, 2015: 19-24.

  4. Cha\&Sen17\] Chatterjee A, Sengupta I. Sorting of fully homomorphic encrypted cloud data: Can partitioning be effective?\[J\]. IEEE Transactions on Services Computing, 2017, 13(3): 545-558.

  5. CSS20\] Cetin G S, Savaş E, Sunar B. Homomorphic sorting with better scalability\[J\]. IEEE Transactions on Parallel and Distributed Systems, 2020, 32(4): 760-771.

文章目录

  • 最初方案
    • [Swap Circuit](#Swap Circuit)
    • [Lazy Sort](#Lazy Sort)
    • [Sorting Network](#Sorting Network)
  • 深度最优化
    • [Comparison Matrix](#Comparison Matrix)
    • [Direct Sort](#Direct Sort)
    • [Greedy Sort](#Greedy Sort)
  • 减少乘法数量
    • [Polynomial Rank Sort](#Polynomial Rank Sort)
    • [Frobenius Maps](#Frobenius Maps)

最初方案

Swap Circuit

CKS13\] 给出了第一个同态排序方案。它基于明文空间是 G F ( 2 ) GF(2) GF(2) 的 FHE 方案(full 版本,而非 level 版本),构建了 **Swap 电路** ,然后用 Swap 电路搭建**冒泡排序** 、**插入排序** 。令 a , b a,b a,b 是带符号整数,最高位是符号位;令 β \\beta β 表示 M S B ( a − b ) MSB(a-b) MSB(a−b),于是 a \< b    ⟺    β = 1 a\ o i e_{i+1}\>o_i ei+1\>oi,那么序列 e 0 , o 0 , e 1 , o 1 , ⋯   , e n − 1 , o n − 1 e_0,o_0,e_1,o_1,\\cdots,e_{n-1},o_{n-1} e0,o0,e1,o1,⋯,en−1,on−1 就是一个有序数组。 ![在这里插入图片描述](https://file.jishuzhan.net/article/1694501860343287809/a51811cc2f7349b59f8c6eb14e5b2a11.png) \[EGNS15\] 观察到**基于 Swap 的同态排序算法总是以最坏复杂度运行** ,或者说它的效率与输入数据无关。\[EGNS15\] 简单地用 FHE Swap 电路搭建出了 Bitonic Sort 和 Odd-Even Merge Sort 同态排序网络,计算复杂度固定为 O ( n log ⁡ 2 n ) O(n \\log\^2 n) O(nlog2n)。 # 深度最优化 ## Comparison Matrix \[CDSS\] 使用了 LHE 而非 FHE 来实现同态排序,只要支持的 Level 级别够高,就可以完全忽略开销极高的 Recrypt 运算。由于 **LHE** 是以**电路** 的形式执行的,排序算法需要先通过**算术化** 消除条件分支,然后再通过**循环展开** 得到无环的排序电路。但是 \[EGNS15\] 使用的 Sorting Network 迭代了 O ( log ⁡ 2 n ) O(\\log\^2 n) O(log2n) 层,每一层的 Swap 输入都依赖于上一层的 Swap 结果,所以同态乘法深度较高,直接用 LHE 实例化将导致极高的参数规模。 为了降低乘法深度,最直观的思路就是只进行深度为 O ( 1 ) O(1) O(1) 的比较。输入密文 X 0 , ⋯   , X N − 1 X_0,\\cdots,X_{N-1} X0,⋯,XN−1,预计算 **comparison matrix** , M : = \[ m 0 , 0 m 0 , 1 ⋯ m 0 , N − 1 m 1 , 0 m 1 , 1 ⋯ m 1 , N − 1 ⋮ ⋱ m N − 1 , 0 m N − 1 , 1 ⋯ m N − 1 , N − 1 \] m i j : = L T ( X i , X j ) = { E n c ( 1 ) , x i \< x j E n c ( 0 ) , o t h e r w i s e M := \\begin{bmatrix} m_{0,0} \& m_{0,1} \& \\cdots \& m_{0,N-1}\\\\ m_{1,0} \& m_{1,1} \& \\cdots \& m_{1,N-1}\\\\ \\vdots \&\& \\ddots\\\\ m_{N-1,0} \& m_{N-1,1} \& \\cdots \& m_{N-1,N-1}\\\\ \\end{bmatrix}\\\\ m_{ij} := LT(X_i, X_j) = \\left\\{\\begin{aligned} Enc(1), \&\& x_i \< x_j\\\\ Enc(0), \&\& otherwise\\\\ \\end{aligned}\\right. M:= m0,0m1,0⋮mN−1,0m0,1m1,1mN−1,1⋯⋯⋱⋯m0,N−1m1,N−1mN−1,N−1 mij:=LT(Xi,Xj)={Enc(1),Enc(0),xi\

相关推荐
success_a13 分钟前
大故障:阿里云核心域名爆炸了
数据库·阿里云·云计算
@小红花3 小时前
MySQL数据库从0到1
数据库·mysql·oracle
[听得时光枕水眠]3 小时前
MySQL基础(三)DQL(Data Query Language,数据查询语言)
数据库·mysql·oracle
我科绝伦(Huanhuan Zhou)3 小时前
深入解析Oracle SQL调优健康检查工具(SQLHC):从原理到实战优化
数据库·sql·oracle
木子.李3474 小时前
排序算法总结(C++)
c++·算法·排序算法
Gyoku Mint6 小时前
机器学习×第二卷:概念下篇——她不再只是模仿,而是开始决定怎么靠近你
人工智能·python·算法·机器学习·pandas·ai编程·matplotlib
寒山李白7 小时前
MySQL安装与配置详细讲解
数据库·mysql·配置安装
猛犸MAMMOTH7 小时前
Python打卡第46天
开发语言·python·机器学习
文牧之8 小时前
PostgreSQL 的扩展pg_freespacemap
运维·数据库·postgresql
deriva8 小时前
某水表量每15分钟一报,然后某天示数清0了,重新报示值了 ,如何写sql 计算每日水量
数据库·sql