Skip to main content

Mode

Enum Mode 

Source
pub enum Mode {
    Ed25519,
    Dsig,
    UbftEd25519,
    UbftDsig,
}
Expand description

Which paper the chip is planned for.

Variants§

§

Ed25519

Ed25519 alone.

§

Dsig

DSig with the Ed25519 signing and verification it needs.

§

UbftEd25519

Ed25519 as a service beside a uBFT replica: the uBFT modules only (Component::ubft), headline idle latency rather than rate.

§

UbftDsig

DSig (with its Ed25519 work) as a service beside a uBFT replica.

Implementations§

Source§

impl Mode

What each paper’s chip contains and needs.

Source

pub const ALL: [Mode; 4]

Every mode, in the order the TUI offers them.

Source

pub fn name(self) -> &'static str

Display name.

Source

pub fn short(self) -> &'static str

Short name for the headline.

Source

pub fn paper(self) -> Mode

The paper whose needs and splits this mode follows: a uBFT mode signs and verifies like the paper of its scheme.

Source

pub fn is_ubft(self) -> bool

A uBFT mode: only uBFT modules take part.

Source

pub fn op(self, side: Side) -> &'static str

What one delivered operation of the side is called.

Source

pub fn need(self, role: Role, cx: &Context, batch: f64) -> f64

Operations of role needed per delivered operation of its side (0: the role takes no part). batch is DSig’s batch size K.

  • Ed25519 paper: one Ed25519 signature per signature, one Ed25519 verification per verification.
  • DSig paper: one DSig signature and 1/K Ed25519 signature per signature; one DSig verification and 1 − h Ed25519 verification per verification, h = (b/100)·(K − 1)/K (Context::cache_hit).
  • A uBFT mode: as its paper; one uBFT certificate share is one signature, checking a peer’s share one verification.
Source

pub fn uses(self, role: Role) -> bool

Whether components of role belong in this mode’s chip.

Source

pub fn admits(self, c: &dyn Component) -> bool

Whether c belongs in this mode’s chip: its role is used and it is a uBFT module exactly when this is a uBFT mode. So the papers never plan a uBFT service, and a uBFT chip holds only the replica and its services (each with its own SHA-512, no shared line).

Trait Implementations§

Source§

impl Clone for Mode

Source§

fn clone(&self) -> Mode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Mode

Source§

fn eq(&self, other: &Mode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Mode

Source§

impl Eq for Mode

Source§

impl StructuralPartialEq for Mode

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnsafeUnpin for Mode

§

impl UnwindSafe for Mode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.