Struct secp256k1::ecdh::SharedSecret [−][src]
pub struct SharedSecret { /* fields omitted */ }
A tag used for recovering the public key from a compact signature
Implementations
impl SharedSecret
[src]
impl SharedSecret
[src]impl SharedSecret
[src]
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 Clone 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 Deref for SharedSecret
[src]
impl Deref for SharedSecret
[src]impl PartialEq<SharedSecret> for SharedSecret
[src]
impl PartialEq<SharedSecret> for SharedSecret
[src]