SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions
shuffleRows(key)

Functions

template<domain D :shared3p , type T>
D T shuffleRows (D T[[2]] mat, D uint8[[1]] key)
 
template<domain D :shared3p >
D fix32 shuffleRows (D fix32[[2]] mat, D uint8[[1]] key)
 
template<domain D :shared3p >
D fix64 shuffleRows (D fix64[[2]] mat, D uint8[[1]] key)
 

Detailed Description

Protocols to shuffle rows in a matrix with given key.

Note
D - shared3p protection domain
Precondition
the key is exactly 32 bytes long
Returns
a random permutation of the input matrix
Postcondition
the output matrices rows are a permutation of the input
Note
the declassified value of the key does not matter, internally only the shares are used. If two vectors are shuffled using the same key the permutation applied is the same as long as the vectors are of the same length, and the key does not get reshared.
Leakage
None

Function Documentation

◆ shuffleRows() [1/3]

D fix32 shuffleRows ( D fix32[[2]]  mat,
D uint8[[1]]  key 
)

◆ shuffleRows() [2/3]

D fix64 shuffleRows ( D fix64[[2]]  mat,
D uint8[[1]]  key 
)

◆ shuffleRows() [3/3]

D T shuffleRows ( D T[[2]]  mat,
D uint8[[1]]  key 
)
Note
T - any data type
Parameters
mat- input matrix to shuffle
key- an uint8 type key that specifies the permutation