Struct solana_zk_token_sdk::encryption::pedersen::Pedersen
source · [−]pub struct Pedersen;
Expand description
Algorithm handle for the Pedersen commitment scheme.
Implementations
sourceimpl Pedersen
impl Pedersen
sourcepub fn new<T: Into<Scalar>>(message: T) -> (PedersenCommitment, PedersenOpening)
pub fn new<T: Into<Scalar>>(message: T) -> (PedersenCommitment, PedersenOpening)
On input a message, the function returns a Pedersen commitment of the message and the corresponding opening.
This function is randomized. It internally samples a Pedersen opening using OsRng
.
sourcepub fn with<T: Into<Scalar>>(
amount: T,
open: &PedersenOpening
) -> PedersenCommitment
pub fn with<T: Into<Scalar>>(
amount: T,
open: &PedersenOpening
) -> PedersenCommitment
On input a message and a Pedersen opening, the function returns the corresponding Pedersen commitment.
This function is deterministic.
sourcepub fn encode<T: Into<Scalar>>(amount: T) -> PedersenCommitment
pub fn encode<T: Into<Scalar>>(amount: T) -> PedersenCommitment
On input a message, the function returns a Pedersen commitment with zero as the opening.
This function is deterministic.
Auto Trait Implementations
impl RefUnwindSafe for Pedersen
impl Send for Pedersen
impl Sync for Pedersen
impl Unpin for Pedersen
impl UnwindSafe for Pedersen
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more