SecreC 2 language 2.9.0 (2026.10)
Language and standard library reference
Loading...
Searching...
No Matches
Functions

Functions

template<domain D :shared3p >
uint oramPrepareRead (uint srcLen, D uint indices, D uint8 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()

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