Struct solana_zk_token_sdk::encryption::discrete_log::DiscreteLog
source · pub struct DiscreteLog {
pub generator: RistrettoPoint,
pub target: RistrettoPoint,
/* private fields */
}
Expand description
Type that captures a discrete log challenge.
The goal of discrete log is to find x such that x * generator = target.
Fields§
§generator: RistrettoPoint
Generator point for discrete log
target: RistrettoPoint
Target point for discrete log
Implementations§
source§impl DiscreteLog
impl DiscreteLog
Solves the discrete log instance using a 16/16 bit offline/online split
sourcepub fn new(generator: RistrettoPoint, target: RistrettoPoint) -> Self
pub fn new(generator: RistrettoPoint, target: RistrettoPoint) -> Self
Discrete log instance constructor.
Default number of threads set to 1.
sourcepub fn num_threads(
&mut self,
num_threads: usize
) -> Result<(), DiscreteLogError>
pub fn num_threads( &mut self, num_threads: usize ) -> Result<(), DiscreteLogError>
Adjusts number of threads in a discrete log instance.
sourcepub fn set_compression_batch_size(
&mut self,
compression_batch_size: usize
) -> Result<(), DiscreteLogError>
pub fn set_compression_batch_size( &mut self, compression_batch_size: usize ) -> Result<(), DiscreteLogError>
Adjusts inversion batch size in a discrete log instance.
sourcepub fn decode_u32(self) -> Option<u64>
pub fn decode_u32(self) -> Option<u64>
Solves the discrete log problem under the assumption that the solution is a positive 32-bit number.
Trait Implementations§
source§impl Clone for DiscreteLog
impl Clone for DiscreteLog
source§fn clone(&self) -> DiscreteLog
fn clone(&self) -> DiscreteLog
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DiscreteLog
impl Debug for DiscreteLog
source§impl<'de> Deserialize<'de> for DiscreteLog
impl<'de> Deserialize<'de> for DiscreteLog
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for DiscreteLog
impl PartialEq for DiscreteLog
source§fn eq(&self, other: &DiscreteLog) -> bool
fn eq(&self, other: &DiscreteLog) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DiscreteLog
impl Serialize for DiscreteLog
impl Copy for DiscreteLog
impl Eq for DiscreteLog
impl StructuralEq for DiscreteLog
impl StructuralPartialEq for DiscreteLog
Auto Trait Implementations§
impl RefUnwindSafe for DiscreteLog
impl Send for DiscreteLog
impl Sync for DiscreteLog
impl Unpin for DiscreteLog
impl UnwindSafe for DiscreteLog
Blanket Implementations§
§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester ) -> Result<AbiDigester, DigestError>
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more