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: RistrettoPointGenerator point for discrete log
target: RistrettoPointTarget point for discrete log
Implementations§
Source§impl DiscreteLog
Solves the discrete log instance using a 16/16 bit offline/online split
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: NonZeroUsize,
) -> Result<(), DiscreteLogError>
pub fn num_threads( &mut self, num_threads: NonZeroUsize, ) -> Result<(), DiscreteLogError>
Adjusts number of threads in a discrete log instance.
Sourcepub fn set_compression_batch_size(
&mut self,
compression_batch_size: NonZeroUsize,
) -> Result<(), DiscreteLogError>
pub fn set_compression_batch_size( &mut self, compression_batch_size: NonZeroUsize, ) -> 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§impl Serialize for DiscreteLog
impl Serialize for DiscreteLog
impl Copy for DiscreteLog
impl Eq for DiscreteLog
impl StructuralPartialEq for DiscreteLog
Auto Trait Implementations§
impl Freeze for DiscreteLog
impl RefUnwindSafe for DiscreteLog
impl Send for DiscreteLog
impl Sync for DiscreteLog
impl Unpin for DiscreteLog
impl UnwindSafe for DiscreteLog
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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