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 :shared3p , dim N>
D xor_uint8 choose (D bool cond, D xor_uint8 first, D xor_uint8 second)
 
template<domain D :shared3p , dim N>
D xor_uint16 choose (D bool cond, D xor_uint16 first, D xor_uint16 second)
 
template<domain D :shared3p , dim N>
D xor_uint32 choose (D bool cond, D xor_uint32 first, D xor_uint32 second)
 
template<domain D :shared3p , dim N>
D xor_uint64 choose (D bool cond, D xor_uint64 first, D xor_uint64 second)
 

Detailed Description

Function for obliviously choosing one of the inputs.

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

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

◆ choose() [2/4]

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

◆ choose() [3/4]

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

◆ choose() [4/4]

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