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

Functions

template<domain D :shared3p >
uint oramPrepareWrite (uint arrLen, D uint indices, D uint8 shuffleSeed1, D uint8 shuffleSeed2)
 

Detailed Description

Prepares a sort permutation for oblivious write function oramPerformWrite.

Note
D - shared3p protection domain
See supported types for oramPerformWrite
Parameters
arrLen- length of the original values vector (arr in oramPerformWrite)
indices- vector specifying where to write the corresponding value from the replacement values vector (vals in oramPerformWrite)
shuffleSeed1- random seed (32 bytes)
shuffleSeed2- random seed (32 bytes)
Returns
sorting permutation, used as sigmatau in oramPerformWrite
Note
Note that the output sorting permutation is a public value. Based on its input data, oramPrepareWrite computes a secret permutation that is represented as combination of a public output permutation and secret shuffleSeed1 and shuffleSeed2. 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 shuffleSeed1 shuffleSeed2 values must not be reused for other prepare* (or shuffle) calls.
Leakage
None

Function Documentation

◆ oramPrepareWrite()

template<domain D :shared3p >
uint oramPrepareWrite ( uint  arrLen,
D uint  indices,
D uint8  shuffleSeed1,
D uint8  shuffleSeed2 
)