From 78dfb480173b7b0511a1fe85e55a220ccafa20d6 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Fri, 10 May 2024 12:33:48 +0200 Subject: [PATCH 1/2] Removed warning in docs for VerifyingKey::from_bytes --- ed25519-dalek/src/verifying.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ed25519-dalek/src/verifying.rs b/ed25519-dalek/src/verifying.rs index 246951b44..22321b84e 100644 --- a/ed25519-dalek/src/verifying.rs +++ b/ed25519-dalek/src/verifying.rs @@ -124,12 +124,6 @@ impl VerifyingKey { /// Construct a `VerifyingKey` from a slice of bytes. /// - /// # Warning - /// - /// The caller is responsible for ensuring that the bytes passed into this - /// method actually represent a `curve25519_dalek::curve::CompressedEdwardsY` - /// and that said compressed point is actually a point on the curve. - /// /// # Example /// /// ``` @@ -154,8 +148,8 @@ impl VerifyingKey { /// /// # Returns /// - /// A `Result` whose okay value is an EdDSA `VerifyingKey` or whose error value - /// is a `SignatureError` describing the error that occurred. + /// A `Result` whose okay value is an EdDSA `VerifyingKey` or a decompression error if the + /// provided bytes do not represent the \\(y\\)-coordinate of a curve point. #[inline] pub fn from_bytes(bytes: &[u8; PUBLIC_KEY_LENGTH]) -> Result { let compressed = CompressedEdwardsY(*bytes); From cd3ddd81731650b99f3d8e9db6f5a1d37b6ff2b8 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Fri, 10 May 2024 12:37:04 +0200 Subject: [PATCH 2/2] Tightened wording --- ed25519-dalek/src/verifying.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ed25519-dalek/src/verifying.rs b/ed25519-dalek/src/verifying.rs index 22321b84e..34865abe9 100644 --- a/ed25519-dalek/src/verifying.rs +++ b/ed25519-dalek/src/verifying.rs @@ -148,8 +148,9 @@ impl VerifyingKey { /// /// # Returns /// - /// A `Result` whose okay value is an EdDSA `VerifyingKey` or a decompression error if the - /// provided bytes do not represent the \\(y\\)-coordinate of a curve point. + /// On success, returns an EdDSA `VerifyingKey`. Returns a decompression error if the provided + /// bytes are not a valid verifying key, i.e., do not represent the \\(y\\)-coordinate of a + /// curve point. #[inline] pub fn from_bytes(bytes: &[u8; PUBLIC_KEY_LENGTH]) -> Result { let compressed = CompressedEdwardsY(*bytes);