Skip to content

Commit

Permalink
eddsa-2022 should be named eddsa-rdfc-2022
Browse files Browse the repository at this point in the history
Fixes #580
  • Loading branch information
timothee-haudebourg committed Jul 12, 2024
1 parent 7a944d7 commit 7ff3d58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
6 changes: 3 additions & 3 deletions crates/claims/crates/data-integrity/src/any/suite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ macros::crypto_suites! {
#[cfg(all(feature = "w3c", feature = "ed25519"))]
ed25519_signature_2020: Ed25519Signature2020,

/// W3C EdDSA Cryptosuite v2022.
/// W3C `eddsa-rdfc-2022` cryptosuite.
///
/// See: <https://w3c.github.io/vc-di-eddsa/>
/// See: <https://w3c.github.io/vc-di-eddsa/#eddsa-rdfc-2022>
#[cfg(all(feature = "w3c", feature = "ed25519"))]
ed_dsa_2022: EdDsa2022,
eddsa_rdfc_2022: EdDsaRdfc2022,

/// W3C Ecdsa Secp256k1 Signature 2019.
///
Expand Down
4 changes: 2 additions & 2 deletions crates/claims/crates/data-integrity/suites/src/suites/w3c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ pub mod ed25519_signature_2020;
pub use ed25519_signature_2020::Ed25519Signature2020;

#[cfg(feature = "ed25519")]
pub mod eddsa_2022;
pub mod eddsa_rdfc_2022;
#[cfg(feature = "ed25519")]
pub use eddsa_2022::EdDsa2022;
pub use eddsa_rdfc_2022::EdDsaRdfc2022;

#[cfg(feature = "secp256k1")]
pub mod ecdsa_secp256k1_signature_2019;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
//! EdDSA Cryptosuite v2022 implementation.
//!
//! This is the successor of the EdDSA Cryptosuite v2020.
//!
//! See: <https://w3c.github.io/vc-di-eddsa/>
use k256::sha2::Sha256;
use ssi_data_integrity_core::{
canonicalization::{CanonicalizeClaimsAndConfiguration, HashCanonicalClaimsAndConfiguration},
Expand All @@ -13,22 +8,19 @@ use ssi_data_integrity_core::{
use ssi_verification_methods::Multikey;
use static_iref::iri;

/// EdDSA Cryptosuite v2020.
/// The `eddsa-rdfc-2022` cryptosuite.
///
/// This is a legacy cryptographic suite for the usage of the EdDSA algorithm
/// and Curve25519. It is recommended to use `edssa-2022` instead.
///
/// See: <https://w3c.github.io/vc-di-eddsa/#the-ed25519signature2020-suite>
/// See: <https://w3c.github.io/vc-di-eddsa/#eddsa-rdfc-2022>
#[derive(Debug, Default, Clone, Copy)]
pub struct EdDsa2022;
pub struct EdDsaRdfc2022;

impl EdDsa2022 {
impl EdDsaRdfc2022 {
pub const NAME: &'static str = "DataIntegrityProof";

pub const IRI: &'static iref::Iri = iri!("https://w3id.org/security#DataIntegrityProof");
}

impl StandardCryptographicSuite for EdDsa2022 {
impl StandardCryptographicSuite for EdDsaRdfc2022 {
type Configuration = NoConfiguration;

type Transformation = CanonicalizeClaimsAndConfiguration;
Expand All @@ -42,6 +34,6 @@ impl StandardCryptographicSuite for EdDsa2022 {
type ProofOptions = ();

fn type_(&self) -> TypeRef {
TypeRef::DataIntegrityProof(CryptosuiteStr::new("eddsa-2022").unwrap())
TypeRef::DataIntegrityProof(CryptosuiteStr::new("eddsa-rdfc-2022").unwrap())
}
}

0 comments on commit 7ff3d58

Please sign in to comment.