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

Functions

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

Detailed Description

Protocols to shuffle columns 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 matrixes columns 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

◆ shuffleColumns()

D T shuffleColumns ( 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