Struct secp256k1::ecdh::SharedSecret [−][src]
A tag used for recovering the public key from a compact signature
Implementations
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.
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 AsRef<[u8]> for SharedSecret
[src]
impl Clone for SharedSecret
[src]
fn clone(&self) -> SharedSecret
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SharedSecret
[src]
impl Debug for SharedSecret
[src]
impl Deref for SharedSecret
[src]
impl From<[u8; 128]> for SharedSecret
[src]
impl From<[u8; 16]> for SharedSecret
[src]
impl From<[u8; 20]> for SharedSecret
[src]
impl From<[u8; 256]> 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 PartialEq<SharedSecret> for SharedSecret
[src]
Auto Trait Implementations
impl RefUnwindSafe for SharedSecret
impl Send for SharedSecret
impl Sync for SharedSecret
impl Unpin for SharedSecret
impl UnwindSafe for SharedSecret
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,