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

Functions

template<domain D :shared3p , dim N>
D float32 choose (D bool[[N]] cond, D float32[[N]] first, D float32[[N]] second)
 
template<domain D :shared3p , dim N>
D float64 choose (D bool[[N]] cond, D float64[[N]] first, D float64[[N]] second)
 
template<domain D, dim N>
D fix32 choose (D bool[[N]] cond, D fix32[[N]] first, D fix32[[N]] second)
 
template<domain D, dim N>
D fix64 choose (D bool[[N]] cond, D fix64[[N]] first, D fix64[[N]] second)
 

Detailed Description

Function for obliviously choosing one of the inputs.

Note
D - shared3p protection domain
Supported types - float32 / float64 / fix32 / fix64
Parameters
cond- a boolean array
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/4]

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

◆ choose() [2/4]

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

◆ choose() [3/4]

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

◆ choose() [4/4]

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