Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed: update VerifyingKey::from_bytes with ZIP-215 info #704

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ed25519-dalek/src/verifying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,8 @@ 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.
/// Verifies the point is valid under [ZIP-215] rules. RFC 8032 / NIST point validation criteria
/// are currently unsupported (see [dalek-cryptography/curve25519-dalek#626]).
///
/// # Example
///
Expand Down Expand Up @@ -156,6 +153,9 @@ impl VerifyingKey {
///
/// A `Result` whose okay value is an EdDSA `VerifyingKey` or whose error value
/// is a `SignatureError` describing the error that occurred.
///
/// [ZIP-215]: https://zips.z.cash/zip-0215
/// [dalek-cryptography/curve25519-dalek#626]: https://github.com/dalek-cryptography/curve25519-dalek/issues/626
#[inline]
pub fn from_bytes(bytes: &[u8; PUBLIC_KEY_LENGTH]) -> Result<VerifyingKey, SignatureError> {
let compressed = CompressedEdwardsY(*bytes);
Expand Down
Loading