pub trait PlaintextOps<Plaintext = <Self as Reconstructible>::Value>: Reconstructible {
// Required methods
fn add_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self;
fn sub_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self;
}Expand description
Operates a secret share with a public plaintext (addition/subtraction). These are often
asymmetric (e.g., only the first peer folds the constant into its share). Scaling a share by a
public constant is expressed directly through Mul where needed, so it is not part of this
trait.
Required Methods§
Sourcefn add_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self
fn add_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self
Add a plaintext to the share, consuming the share and returning a new one.
Sourcefn sub_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self
fn sub_plaintext(self, ptx: &Plaintext, 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".
Implementors§
impl<F: FieldExtension> PlaintextOps<SubfieldElement<F>> for SubfieldElement<F>
Adding a public constant to an unauthenticated additive share: only the first peer folds the
constant into its share (x_0 ± c); every other peer’s share is unchanged, so the sum shifts
by exactly c.
This is the batched counterpart of the blanket PlaintextOps impl: where that one adds a
full-width HeapArray<V, M> plaintext, this adds a single V to all M columns at once.