[][src]Trait wedpr_crypto::ecies::Ecies

pub trait Ecies {
    pub fn encrypt<T: ?Sized + AsRef<[u8]>>(
        &self,
        public_key: &T,
        message: &T
    ) -> Result<Vec<u8>, WedprError>;
pub fn decrypt<T: ?Sized + AsRef<[u8]>>(
        &self,
        private_key: &T,
        ciphertext: &T
    ) -> Result<Vec<u8>, WedprError>; }

Trait of a replaceable ECIES algorithm.

Required methods

pub fn encrypt<T: ?Sized + AsRef<[u8]>>(
    &self,
    public_key: &T,
    message: &T
) -> Result<Vec<u8>, WedprError>
[src]

Encrypts a message by ECIES with a public key.

pub fn decrypt<T: ?Sized + AsRef<[u8]>>(
    &self,
    private_key: &T,
    ciphertext: &T
) -> Result<Vec<u8>, WedprError>
[src]

Decrypts a ciphertext by ECIES with a private key.

Loading content...

Implementors

impl Ecies for WedprSecp256k1Ecies[src]

Implements a ECIES instance on Secp256k1 curve.

Loading content...