Skip to main content

PlaintextOps

Trait PlaintextOps 

Source
pub trait PlaintextOps: Reconstructible + Clone {
    // Required methods
    fn add_plaintext(self, ptx: &Self::Value, is_first_peer: bool) -> Self;
    fn sub_plaintext(self, ptx: &Self::Value, is_first_peer: bool) -> Self;
}
Expand description

A trait used to add a plaintext to a certain type. Commonly used to correct shares after a masked opening, or to add a public constant

Required Methods§

Source

fn add_plaintext(self, ptx: &Self::Value, is_first_peer: bool) -> Self

Add a plaintext to the share, consuming the share and returning a new one.

Source

fn sub_plaintext(self, ptx: &Self::Value, is_first_peer: bool) -> Self

Subtract a plaintext from the share, consuming the share and returning a new one.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<V, A, B> PlaintextOps for PairwiseAuthShare<V, A, B>
where PairwiseAuthShare<V, A, B>: Reconstructible<Value = V>, for<'a> V: Clone + for<'a> AddAssign<&'a V> + for<'a> SubAssign<&'a V> + Mul<&'a A, Output = B>, A: Clone, B: Clone + for<'b> AddAssign<&'b B> + for<'b> SubAssign<&'b B> + ConstantTimeEq,