SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions
choose(single condition)

Functions

template<domain D, type T, dim N>
D T choose (bool cond, D T[[N]] first, D T[[N]] second)
 
template<domain D, dim N>
D bool choose (D bool cond, D bool[[N]] first, D bool[[N]] second)
 
template<domain D, dim N>
D uint8 choose (D bool cond, D uint8[[N]] first, D uint8[[N]] second)
 
template<domain D, dim N>
D uint16 choose (D bool cond, D uint16[[N]] first, D uint16[[N]] second)
 
template<domain D, dim N>
D uint32 choose (D bool cond, D uint32[[N]] first, D uint32[[N]] second)
 
template<domain D, dim N>
D uint choose (D bool cond, D uint[[N]] first, D uint[[N]] second)
 
template<domain D, dim N>
D int8 choose (D bool cond, D int8[[N]] first, D int8[[N]] second)
 
template<domain D, dim N>
D int16 choose (D bool cond, D int16[[N]] first, D int16[[N]] second)
 
template<domain D, dim N>
D int32 choose (D bool cond, D int32[[N]] first, D int32[[N]] second)
 
template<domain D, dim N>
D int choose (D bool cond, D int[[N]] first, D int[[N]] second)
 
template<domain D, dim N>
D float32 choose (D bool cond, D float32[[N]] first, D float32[[N]] second)
 
template<domain D, dim N>
D float64 choose (D bool cond, D float64[[N]] first, D float64[[N]] 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]

D T choose ( bool  cond,
D T[[N]]  first,
D T[[N]]  second 
)

◆ choose() [2/12]

D bool choose ( D bool  cond,
D bool[[N]]  first,
D bool[[N]]  second 
)

◆ choose() [3/12]

D float32 choose ( D bool  cond,
D float32[[N]]  first,
D float32[[N]]  second 
)

◆ choose() [4/12]

D float64 choose ( D bool  cond,
D float64[[N]]  first,
D float64[[N]]  second 
)

◆ choose() [5/12]

D int16 choose ( D bool  cond,
D int16[[N]]  first,
D int16[[N]]  second 
)

◆ choose() [6/12]

D int32 choose ( D bool  cond,
D int32[[N]]  first,
D int32[[N]]  second 
)

◆ choose() [7/12]

D int8 choose ( D bool  cond,
D int8[[N]]  first,
D int8[[N]]  second 
)

◆ choose() [8/12]

D int choose ( D bool  cond,
D int[[N]]  first,
D int[[N]]  second 
)

◆ choose() [9/12]

D uint16 choose ( D bool  cond,
D uint16[[N]]  first,
D uint16[[N]]  second 
)

◆ choose() [10/12]

D uint32 choose ( D bool  cond,
D uint32[[N]]  first,
D uint32[[N]]  second 
)

◆ choose() [11/12]

D uint8 choose ( D bool  cond,
D uint8[[N]]  first,
D uint8[[N]]  second 
)

◆ choose() [12/12]

D uint choose ( D bool  cond,
D uint[[N]]  first,
D uint[[N]]  second 
)