liblisa::oracle

Struct VerifyOracle

pub struct VerifyOracle<A: Arch, O1: Oracle<A>, O2: Oracle<A>>(/* private fields */);
Expand description

An oracle that observes execution on two oracles, and panics if the results are not identical.

Implementations§

§

impl<A: Arch, O1: Oracle<A>, O2: Oracle<A>> VerifyOracle<A, O1, O2>

pub fn new(o1: O1, o2: O2) -> VerifyOracle<A, O1, O2>

Creates a new VerifyOracle, which verifies the observations of o1 against the observations of o2.

Trait Implementations§

§

impl<A: Arch, O1: Oracle<A>, O2: Oracle<A>> Oracle<A> for VerifyOracle<A, O1, O2>

§

const UNRELIABLE_INSTRUCTION_FETCH_ERRORS: bool = _

Set to true if the instruction fetch errors are unreliable.
§

type MappableArea = DoubleCheckedMappableArea<<O1 as Oracle<A>>::MappableArea, <O2 as Oracle<A>>::MappableArea>

The memory addresses that can be mapped by this oracle.
§

fn mappable_area(&self) -> Self::MappableArea

Returns the memory addresses that can be mapped by this oracle.
§

fn page_size(&mut self) -> u64

Returns the page size of the oracle.
§

fn observe( &mut self, before: &SystemState<A>, ) -> Result<SystemState<A>, OracleError>

Observes the output state after executing a single instruction in the before state.
§

fn scan_memory_accesses( &mut self, before: &SystemState<A>, ) -> Result<Vec<Addr>, OracleError>

Uses debugging registers to determine all memory addresses accessed by the instruction. If this is not supported, returns an empty Vec.
§

fn debug_dump(&mut self)

Prints debugging information about the oracle.
§

fn restart(&mut self)

Restart the oracle, if possible.
§

fn kill(self)

Kills the oracle, if possible.
§

fn batch_observe_iter<'a, S: AsSystemState<A> + 'a, I: IntoIterator<Item = S> + 'a>( &'a mut self, states: I, ) -> impl Iterator<Item = Observation<S, A>>

Performs many observations in one go. Behaves idential to Self::observe, but is much more efficient.
§

fn batch_observe_gpreg_only_iter<'a, S: AsSystemState<A> + 'a, I: IntoIterator<Item = S> + 'a>( &'a mut self, states: I, ) -> impl Iterator<Item = Observation<S, A>>

Performs many observations in one go. Only reads and writes the general-purpose registers. Other registers may have arbitrary values.
§

fn random_mappable_page(&self, rng: &mut impl Rng) -> Page<A>

Returns a random mappable page.
§

fn observe_carefully( &mut self, before: &SystemState<A>, ) -> Result<SystemState<A>, OracleError>

Observes the output state after executing a single instruction in the before state. If possible, uses debugging registers to exhaustively check the exact memory locations that are accessed. Returns a memory access error if a memory is accessed that is not set in before. Read more
§

fn batch_observe<'a, const N: usize, S: AsSystemState<A> + 'a>( &mut self, states: [S; N], ) -> [Observation<S, A>; N]

Performs many observations in one go. Behaves idential to Self::observe, but is much more efficient.

Auto Trait Implementations§

§

impl<A, O1, O2> Freeze for VerifyOracle<A, O1, O2>
where O1: Freeze, O2: Freeze,

§

impl<A, O1, O2> RefUnwindSafe for VerifyOracle<A, O1, O2>

§

impl<A, O1, O2> Send for VerifyOracle<A, O1, O2>
where O1: Send, O2: Send,

§

impl<A, O1, O2> Sync for VerifyOracle<A, O1, O2>
where O1: Sync, O2: Sync,

§

impl<A, O1, O2> Unpin for VerifyOracle<A, O1, O2>
where O1: Unpin, O2: Unpin, A: Unpin,

§

impl<A, O1, O2> UnwindSafe for VerifyOracle<A, O1, O2>
where O1: UnwindSafe, O2: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V