Elliptic Curve Integrated Encryption Scheme for secp256k1 in Rust, based on pure Rust implementation of secp256k1.
This is the Rust version of eciespy.
rust
pub fn encrypt(receiver_pub: &[u8], msg: &[u8]) -> Result<Vec<u8>, SecpError>
rust
pub fn decrypt(receiver_sec: &[u8], msg: &[u8]) -> Result<Vec<u8>, SecpError>
```rust const MSG: &str = "helloworld"; let (sk, pk) = generate_keypair(); let (sk, pk) = (&sk.serialize(), &pk.serialize());
let msg = MSG.asbytes(); asserteq!( msg, decrypt(sk, &encrypt(pk, msg).unwrap()).unwrap().as_slice() ); ```