SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions
choose(multiple conditions)

Functions

template<domain D, dim N>
D bool choose (D bool[[N]] cond, D bool[[N]] first, D bool[[N]] second)
 
template<domain D, dim N>
D uint8 choose (D bool[[N]] cond, D uint8[[N]] first, D uint8[[N]] second)
 
template<domain D, dim N>
D uint16 choose (D bool[[N]] cond, D uint16[[N]] first, D uint16[[N]] second)
 
template<domain D, dim N>
D uint32 choose (D bool[[N]] cond, D uint32[[N]] first, D uint32[[N]] second)
 
template<domain D, dim N>
D uint choose (D bool[[N]] cond, D uint[[N]] first, D uint[[N]] second)
 
template<domain D, dim N>
D int8 choose (D bool[[N]] cond, D int8[[N]] first, D int8[[N]] second)
 
template<domain D, dim N>
D int16 choose (D bool[[N]] cond, D int16[[N]] first, D int16[[N]] second)
 
template<domain D, dim N>
D int32 choose (D bool[[N]] cond, D int32[[N]] first, D int32[[N]] second)
 
template<domain D, dim N>
D int choose (D bool[[N]] cond, D int[[N]] first, D int[[N]] second)
 

Detailed Description

Function for obliviously choosing pointwise from the inputs.

Note
D - all protection domains
Supported types - bool / uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / float32 / float64
Parameters
cond- a boolean array
first- values for true case
second- values for false case
Returns
pointwise check if cond at a certain position is true or false. if true the element of first at that position is returned else the element of second at that position is returned
Leakage
None

Function Documentation

◆ choose() [1/9]

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

◆ choose() [2/9]

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

◆ choose() [3/9]

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

◆ choose() [4/9]

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

◆ choose() [5/9]

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

◆ choose() [6/9]

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

◆ choose() [7/9]

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

◆ choose() [8/9]

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

◆ choose() [9/9]

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