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

Functions

template<domain D :shared3p >
uint oramPrepareRead (uint srcLen, D uint[[1]] indices, D uint8[[1]] shuffleSeed)
 

Detailed Description

Prepares a sort permutation for oblivious read function oramPerformRead.

Note
D - shared3p protection domain
See supported types for oramPerformRead
Parameters
srcLen- length of the vector to read from
indices- indices (in the src vector) to read from
shuffleSeed- random seed (32 bytes)
Returns
sorting permutation, used as sortperm in oramPerformRead
Note
Note that the output sorting permutation is a public value. Based on its input data, oramPrepareRead computes a secret permutation that is represented as combination of a public output permutation and a secret shuffleSeed. Therefore, the public permutation alone does not leak anything as it is masked by the secret permutation. This works similarly to one-time-pad. However, for the same reason the shuffleSeed value must not be reused for other prepare* (or shuffle) calls.
Leakage
None

Function Documentation

◆ oramPrepareRead()

uint oramPrepareRead ( uint  srcLen,
D uint[[1]]  indices,
D uint8[[1]]  shuffleSeed 
)