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

Functions

template<domain D :shared3p >
D int32 nthElement (D int32 data, uint64 k, bool shuffle)
 
template<domain D :shared3p >
D int64 nthElement (D int64 data, uint64 k, bool shuffle)
 

Detailed Description

Find the nth element in size from a vector.

Note
D - shared3p protection domain
Supported types - int32 / int64
Parameters
data- input vector
k- index of the value's rank (starts from 0)
shuffle- indicates if the input vector should be shuffled before running the algorithm. Shuffling is necessary to hide the execution flow but if the input vector has already been shuffled it's unnecessary.
Returns
returns the nth element in size of the input vector.
Leakage
Does not leak anything if the input is shuffled
Leaks the number of equal elements if the input is not shuffled

Function Documentation

◆ nthElement() [1/2]

template<domain D :shared3p >
D int32 nthElement ( D int32  data,
uint64  k,
bool  shuffle 
)

◆ nthElement() [2/2]

template<domain D :shared3p >
D int64 nthElement ( D int64  data,
uint64  k,
bool  shuffle 
)