|
template<domain D :shared3p > |
D int32 | nthElement (D int32[[1]] data, uint64 k, bool shuffle) |
|
template<domain D :shared3p > |
D int64 | nthElement (D int64[[1]] data, uint64 k, bool shuffle) |
|
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
◆ nthElement() [1/2]
D int32 nthElement |
( |
D int32[[1]] |
data, |
|
|
uint64 |
k, |
|
|
bool |
shuffle |
|
) |
| |
◆ nthElement() [2/2]
D int64 nthElement |
( |
D int64[[1]] |
data, |
|
|
uint64 |
k, |
|
|
bool |
shuffle |
|
) |
| |