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

Functions

template<domain D :shared3p , dim N>
D xor_uint8 choose (D bool[[N]] cond, D xor_uint8[[N]] first, D xor_uint8[[N]] second)
 
template<domain D :shared3p , dim N>
D xor_uint16 choose (D bool[[N]] cond, D xor_uint16[[N]] first, D xor_uint16[[N]] second)
 
template<domain D :shared3p , dim N>
D xor_uint32 choose (D bool[[N]] cond, D xor_uint32[[N]] first, D xor_uint32[[N]] second)
 
template<domain D :shared3p , dim N>
D xor_uint64 choose (D bool[[N]] cond, D xor_uint64[[N]] first, D xor_uint64[[N]] second)
 

Detailed Description

Function for obliviously choosing pointwise from the inputs.

Note
D - shared3p protection domain
Supported types - xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64
Parameters
cond- a boolean vector
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/4]

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

◆ choose() [2/4]

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

◆ choose() [3/4]

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

◆ choose() [4/4]

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