Compute a shared symmetric key using X25519 key agreement (ECDH).
This function performs X25519 Diffie-Hellman key agreement and then
derives a symmetric key using HKDF-SHA256 with "agreement" as the salt.
This matches the Rust bc-crypto implementation for cross-platform compatibility.
Parameters
x25519Private: Uint8Array
32-byte X25519 private key
x25519Public: Uint8Array
32-byte X25519 public key from the other party
Returns Uint8Array
32-byte derived symmetric key
Throws
If private key is not 32 bytes or public key is not 32 bytes
Compute a shared symmetric key using X25519 key agreement (ECDH).
This function performs X25519 Diffie-Hellman key agreement and then derives a symmetric key using HKDF-SHA256 with "agreement" as the salt. This matches the Rust bc-crypto implementation for cross-platform compatibility.