[−][src]Struct elgamal_curve25519::PublicKey
PublicKey
is an ElGamal public key. It's just a
wrapper around CompressedRistretto
.
The key is computed as g^x, where g is the generator
of the group G of order q, and x a PrivateKey
.
Methods
impl PublicKey
[src]
pub fn new(private: PrivateKey) -> PublicKey
[src]
new
creates a new PublicKey
from a PrivateKey
.
pub fn from_private(private: PrivateKey) -> PublicKey
[src]
from_private
creates a new PublicKey
from a PrivateKey
.
pub fn random() -> Result<PublicKey, String>
[src]
random
creates a new random PublicKey
.
pub fn from_point(point: CompressedRistretto) -> PublicKey
[src]
from_point
creates a new PublicKey
from a CompressedRistretto
.
pub fn to_point(&self) -> CompressedRistretto
[src]
to_point
returns the inner CompressedRistretto
of the PublicKey
.
pub fn from_hash<D>(digest: D) -> PublicKey where
D: Digest<OutputSize = U64> + Default,
[src]
D: Digest<OutputSize = U64> + Default,
from_hash
creates a new PublicKey
from a 64 bytes hash.
pub fn from_bytes(buf: [u8; 32]) -> PublicKey
[src]
from_bytes
creates a new PublicKey
from a slice of bytes.
pub fn to_bytes(&self) -> [u8; 32]
[src]
to_bytes
returns the PublicKey
as an array of bytes.
Trait Implementations
impl Copy for PublicKey
[src]
impl Clone for PublicKey
[src]
fn clone(&self) -> PublicKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<PublicKey> for PublicKey
[src]
impl Eq for PublicKey
[src]
impl Debug for PublicKey
[src]
impl Add<PublicKey> for PublicKey
[src]
type Output = Option<PublicKey>
The resulting type after applying the +
operator.
fn add(self, other: PublicKey) -> Option<PublicKey>
[src]
impl Mul<PrivateKey> for PublicKey
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self