Open yimingqincs opened 1 week ago
When I use permutation = sint.get_secure_shuffle(len(G))
, I want to sort the permutation to get a new one. I can use the new permutation to perform G.secure_permute(permutation, reverse=False, n_threads=None)
to get a new matrix
You can convert the internal representation to a secret vector representation as follows: k = sint(regint.inc(n)).secure_permute(permutation)
. k
can then be used in sorting.reveal_sort()
to permute arrays and matrices.
Thanks for your quick reply! This is helpful for me.
if I perform k = sint(regint.inc(len(G)))
to get the k
. then I use the k
in reveal_sort(k,b)
to permute a matrix b = sfix.Matrix(4,4)
. But I fail to run. Could I perform this?
I want to use the permutation of sorting matrix G
to sort other matrix b
.
Could you please give me some advice?
G = Matrix(4, 4, sfix)
G[0][0] = 1
G[0][1] = 4
G[0][2] = 3
G[0][3] = 10
G[1][0] = 2
G[1][1] = 5
G[1][2] = 1
G[1][3] = 11
G[2][0] = 3
G[2][1] = 6
G[2][2] = 2
G[2][3] = 12.1
G[3][0] = 0
G[3][1] = 0
G[3][2] = 0
G[3][3] = 0
permutation = sint.get_secure_shuffle(len(G))
G.sort((0,))
k = sint(regint.inc(len(G))).secure_permute(permutation, reverse=True)
when I run above the code, can I get k
is the permutaion of sorting G? And then we set the value of matrix b
is the same as the value of matrix G
.
when I perform reveal_sort(k,b)
, I can't get the same permutation between b
with G
.
This is currently not implemented.