agree

Function agree 

pub fn agree<S, P>(secret: &S, public: &P) -> Result<S, Error>
where S: SecretKey, P: AsRef<[u8]>,
Expand description

Agree on a shared secret.

Returns the raw X-coordinate of the EC-DH point (first 32 bytes of shared_secret_point). Matches the legacy parity-secp256k1 SharedSecret::new_raw()[0..32] semantics, which Conflux keystore ECIES relies on. Do NOT switch to ecdh::SharedSecret::new() — that returns SHA-256 of the compressed point, a different value that would break decryption of existing keystore files.