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

Functions

template<domain D, type T, dim N>
D T choose (bool cond, D T first, D T second)
 
template<domain D, dim N>
D bool choose (D bool cond, D bool first, D bool second)
 
template<domain D, dim N>
D uint8 choose (D bool cond, D uint8 first, D uint8 second)
 
template<domain D, dim N>
D uint16 choose (D bool cond, D uint16 first, D uint16 second)
 
template<domain D, dim N>
D uint32 choose (D bool cond, D uint32 first, D uint32 second)
 
template<domain D, dim N>
D uint choose (D bool cond, D uint first, D uint second)
 
template<domain D, dim N>
D int8 choose (D bool cond, D int8 first, D int8 second)
 
template<domain D, dim N>
D int16 choose (D bool cond, D int16 first, D int16 second)
 
template<domain D, dim N>
D int32 choose (D bool cond, D int32 first, D int32 second)
 
template<domain D, dim N>
D int choose (D bool cond, D int first, D int second)
 
template<domain D, dim N>
D float32 choose (D bool cond, D float32 first, D float32 second)
 
template<domain D, dim N>
D float64 choose (D bool cond, D float64 first, D float64 second)
 

Detailed Description

Function for obliviously choosing one of the inputs.

Note
D - all protection domains
T - any data type
Parameters
cond- a boolean scalar
first- values for true case
second- values for false case
Returns
one of the input arrays that was obliviously chosen with the condition. if true, array first is returned else second is returned
Leakage
None

Function Documentation

◆ choose() [1/12]

template<domain D, type T, dim N>
D T choose ( bool  cond,
D T  first,
D T  second 
)

◆ choose() [2/12]

template<domain D, dim N>
D bool choose ( D bool  cond,
D bool  first,
D bool  second 
)

◆ choose() [3/12]

template<domain D, dim N>
D float32 choose ( D bool  cond,
D float32  first,
D float32  second 
)

◆ choose() [4/12]

template<domain D, dim N>
D float64 choose ( D bool  cond,
D float64  first,
D float64  second 
)

◆ choose() [5/12]

template<domain D, dim N>
D int choose ( D bool  cond,
D int  first,
D int  second 
)

◆ choose() [6/12]

template<domain D, dim N>
D int16 choose ( D bool  cond,
D int16  first,
D int16  second 
)

◆ choose() [7/12]

template<domain D, dim N>
D int32 choose ( D bool  cond,
D int32  first,
D int32  second 
)

◆ choose() [8/12]

template<domain D, dim N>
D int8 choose ( D bool  cond,
D int8  first,
D int8  second 
)

◆ choose() [9/12]

template<domain D, dim N>
D uint choose ( D bool  cond,
D uint  first,
D uint  second 
)

◆ choose() [10/12]

template<domain D, dim N>
D uint16 choose ( D bool  cond,
D uint16  first,
D uint16  second 
)

◆ choose() [11/12]

template<domain D, dim N>
D uint32 choose ( D bool  cond,
D uint32  first,
D uint32  second 
)

◆ choose() [12/12]

template<domain D, dim N>
D uint8 choose ( D bool  cond,
D uint8  first,
D uint8  second 
)