From e7cf02f40304abbe93e12a82428950af32bcc5d5 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 26 Oct 2023 12:50:18 -0700 Subject: [PATCH] Agreement docs: Eliminate redundant nested `peer_public_key` in example. --- src/agreement.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/agreement.rs b/src/agreement.rs index 17a158da43..0c4c9af238 100644 --- a/src/agreement.rs +++ b/src/agreement.rs @@ -32,18 +32,18 @@ //! // message. //! let my_public_key = my_private_key.compute_public_key()?; //! -//! let peer_public_key = { +//! let peer_public_key_bytes = { //! // In a real application, the peer public key would be parsed out of a //! // protocol message. Here we just generate one. -//! let peer_public_key = { -//! let peer_private_key = -//! agreement::EphemeralPrivateKey::generate(&agreement::X25519, &rng)?; -//! peer_private_key.compute_public_key()? -//! }; -//! -//! agreement::UnparsedPublicKey::new(&agreement::X25519, peer_public_key) +//! let peer_private_key = +//! agreement::EphemeralPrivateKey::generate(&agreement::X25519, &rng)?; +//! peer_private_key.compute_public_key()? //! }; //! +//! let peer_public_key = agreement::UnparsedPublicKey::new( +//! &agreement::X25519, +//! peer_public_key_bytes); +//! //! agreement::agree_ephemeral( //! my_private_key, //! &peer_public_key,