Trait mc_oblivious_traits::CMov[][src]

pub trait CMov {
    pub fn cmov(&mut self, condition: Choice, src: &Self);
}

CMov represents types that can be (obliviously) conditionally moved.

“Conditional move” means: if condition { *dest = *src } The interesting case is when this must be side-channel resistant and the condition cannot be leaked over CPU side-channels.

This API is object-oriented, and we take self = dest. This is good in rust because then you don’t have to name the type to call the function.

These are the types that we can hope to support with ORAM, and this API allows ORAM to be written in a generic way.

Note: Types that own dynamic memory cannot be CMov by design. They also cannot be in an ORAM, by design. If your type has nontrivial Drop it is likely not reasonable to CMov it or put it in an ORAM.

Required methods

pub fn cmov(&mut self, condition: Choice, src: &Self)[src]

Loading content...

Implementations on Foreign Types

impl<N> CMov for Aligned<A64, GenericArray<u8, N>> where
    N: ArrayLength<u8>, 
[src]

impl<N> CMov for Aligned<A8, GenericArray<u8, N>> where
    N: ArrayLength<u8>, 
[src]

Loading content...

Implementors

impl CMov for bool[src]

impl CMov for u32[src]

impl CMov for u64[src]

Loading content...