[−][src]Struct secp256k1::ecdh::SharedSecret
A tag used for recovering the public key from a compact signature
Methods
impl SharedSecret
[src]
pub fn capacity(&self) -> usize
[src]
Get the capacity of the underlying data buffer.
pub fn len(&self) -> usize
[src]
Get the len of the used data.
pub fn is_empty(&self) -> bool
[src]
True if the underlying data buffer is empty.
impl SharedSecret
[src]
pub fn new(point: &PublicKey, scalar: &SecretKey) -> SharedSecret
[src]
Creates a new shared secret from a pubkey and secret key
pub fn new_with_hash<F>(
point: &PublicKey,
scalar: &SecretKey,
hash_function: F
) -> SharedSecret where
F: FnMut([u8; 32], [u8; 32]) -> SharedSecret,
[src]
point: &PublicKey,
scalar: &SecretKey,
hash_function: F
) -> SharedSecret where
F: FnMut([u8; 32], [u8; 32]) -> SharedSecret,
Creates a new shared secret from a pubkey and secret key with applied custom hash function
The custom hash function must be in the form of fn(x: [u8;32], y: [u8;32]) -> SharedSecret
SharedSecret
can be easily created via the From
impl from arrays.
Examples
let secret = SharedSecret::new_with_hash(&public_key, &secret_key, |x,y| { let hash: [u8; 32] = sha2(&x,&y); hash.into() });
Trait Implementations
impl From<[u8; 16]> for SharedSecret
[src]
impl From<[u8; 20]> for SharedSecret
[src]
impl From<[u8; 28]> for SharedSecret
[src]
impl From<[u8; 32]> for SharedSecret
[src]
impl From<[u8; 48]> for SharedSecret
[src]
impl From<[u8; 64]> for SharedSecret
[src]
impl From<[u8; 96]> for SharedSecret
[src]
impl From<[u8; 128]> for SharedSecret
[src]
impl From<[u8; 256]> for SharedSecret
[src]
impl AsRef<[u8]> for SharedSecret
[src]
impl Clone for SharedSecret
[src]
fn clone(&self) -> SharedSecret
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<SharedSecret> for SharedSecret
[src]
fn eq(&self, other: &SharedSecret) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Copy for SharedSecret
[src]
impl Debug for SharedSecret
impl Deref for SharedSecret
[src]
Auto Trait Implementations
impl Unpin for SharedSecret
impl Sync for SharedSecret
impl Send for SharedSecret
impl UnwindSafe for SharedSecret
impl RefUnwindSafe for SharedSecret
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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,