[][src]Enum haybale_pitchfork::secret::BV

pub enum BV {
    Public(BV<Rc<Btor>>),
    Secret {
        btor: BtorRef,
        width: u32,
        symbol: Option<String>,
    },
    PartiallySecret {
        secret_mask: Vec<bool>,
        data: BV<Rc<Btor>>,
        symbol: Option<String>,
    },
}

A wrapper around boolector::BV which can represent either public or secret data.

Variants

Public(BV<Rc<Btor>>)
Secret

Secret values are opaque because we don't care about their actual value, only how they are used.

Fields of Secret

btor: BtorRefwidth: u32symbol: Option<String>
PartiallySecret

PartiallySecret values have some secret and some not-secret bits. Currently we make just a best-effort attempt to handle these; for now, some functions may just fall back on treating the entire value as Secret.

Fields of PartiallySecret

secret_mask: Vec<bool>

A vector the length of the PartiallySecret value's bitwidth, where each true indicates that the corresponding position in the PartiallySecret is secret, and likewise false indicates public. secret_mask[0] corresponds to the bit at position 0, which is the rightmost (least-significant) bit.

data: BV<Rc<Btor>>

A BV, which must have bitwidth exactly equal to the length of secret_mask. In positions where secret_mask is false, this gives the value of the public bits. In positions where secret_mask is true, the data here is invalid and should not be used for anything.

symbol: Option<String>

Methods

impl BV[src]

pub fn is_secret(&self) -> bool[src]

pub fn as_public(&self) -> &BV<Rc<Btor>>[src]

Gets the value out of a BV::Public, panicking if it is instead a BV::Secret

Trait Implementations

impl BV for BV[src]

type SolverRef = BtorRef

impl Clone for BV[src]

impl Debug for BV[src]

impl Eq for BV[src]

impl PartialEq<BV> for BV[src]

impl StructuralEq for BV[src]

impl StructuralPartialEq for BV[src]

Auto Trait Implementations

impl !RefUnwindSafe for BV

impl !Send for BV

impl !Sync for BV

impl Unpin for BV

impl UnwindSafe for BV

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.