From dfe94c67a5d343483a4a0cedde2f634ee204304c Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 2 Aug 2023 16:41:24 -0700 Subject: [PATCH] update to anoncreds-clsignatures 0.2 Signed-off-by: Andrew Whitehead --- indy-data-types/Cargo.toml | 22 +++++++++++++------- indy-data-types/src/anoncreds/cred_def.rs | 1 + indy-data-types/src/anoncreds/link_secret.rs | 8 +++---- indy-data-types/src/lib.rs | 1 + 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/indy-data-types/Cargo.toml b/indy-data-types/Cargo.toml index f00048f..77c2319 100644 --- a/indy-data-types/Cargo.toml +++ b/indy-data-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "indy-data-types" -version = "0.6.0" +version = "0.6.1" authors = ["Hyperledger Indy Contributors "] description = "Common data types for Hyperledger Indy (https://www.hyperledger.org/projects), which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org)." edition = "2021" @@ -16,25 +16,31 @@ path = "src/lib.rs" crate-type = ["rlib"] [features] -default = ["serde_support", "cl_native"] -cl = ["serde_support"] -cl_native = ["serde_support", "anoncreds-clsignatures/openssl_bn"] +default = ["anoncreds", "merkle_tree"] +anoncreds = ["serde_support"] +cl = ["anoncreds", "anoncreds-clsignatures", "serde_support"] +cl_native = ["anoncreds", "anoncreds-clsignatures/openssl_bn", "serde_support"] merkle_tree = ["indy-utils/hash", "hex"] rich_schema = [] -serde_support = ["serde", "serde_json", "anoncreds-clsignatures?/serde", "indy-utils/serde"] +serde_support = [ + "serde", + "serde_json", + "anoncreds-clsignatures?/serde", + "indy-utils/serde", +] vendored = ["anoncreds-clsignatures?/openssl_vendored"] [dependencies] -anoncreds-clsignatures = { version = "0.1", optional = true } +anoncreds-clsignatures = { version = "0.2", optional = true } hex = { version = "0.4", optional = true } once_cell = "1" regex = "1" serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true, features = ["raw_value"] } zeroize = { version = "1", features = ["zeroize_derive"] } - +rmp-serde = "1.0" [dependencies.indy-utils] -version = "0.5" +version = "0.6" path = "../indy-utils" default-features = false diff --git a/indy-data-types/src/anoncreds/cred_def.rs b/indy-data-types/src/anoncreds/cred_def.rs index 34cc10a..17a6ba0 100644 --- a/indy-data-types/src/anoncreds/cred_def.rs +++ b/indy-data-types/src/anoncreds/cred_def.rs @@ -1,3 +1,4 @@ +#[cfg(any(feature = "cl", feature = "cl_native"))] use crate::anoncreds_clsignatures::CredentialPublicKey; use crate::identifiers::cred_def::CredentialDefinitionId; use crate::identifiers::schema::SchemaId; diff --git a/indy-data-types/src/anoncreds/link_secret.rs b/indy-data-types/src/anoncreds/link_secret.rs index cad690b..b23887f 100644 --- a/indy-data-types/src/anoncreds/link_secret.rs +++ b/indy-data-types/src/anoncreds/link_secret.rs @@ -2,20 +2,20 @@ use std::fmt; use serde::{Deserialize, Serialize}; -use crate::anoncreds_clsignatures::{MasterSecret as ClMasterSecret, Prover as ClProver}; +use crate::anoncreds_clsignatures::{LinkSecret as ClLinkSecret, Prover as ClProver}; use crate::ConversionError; #[derive(Serialize, Deserialize)] pub struct LinkSecret { - pub value: ClMasterSecret, + pub value: ClLinkSecret, } impl LinkSecret { #[cfg(any(feature = "cl", feature = "cl_native"))] #[inline] pub fn new() -> Result { - let value = ClProver::new_master_secret().map_err(|err| { - ConversionError::from_msg(format!("Error creating master secret: {}", err)) + let value = ClProver::new_link_secret().map_err(|err| { + ConversionError::from_msg(format!("Error creating link secret: {}", err)) })?; Ok(Self { value }) } diff --git a/indy-data-types/src/lib.rs b/indy-data-types/src/lib.rs index d2faa73..e69b922 100644 --- a/indy-data-types/src/lib.rs +++ b/indy-data-types/src/lib.rs @@ -21,6 +21,7 @@ pub use indy_utils::{invalid, ConversionError, Validatable, ValidationError}; #[cfg(any(feature = "cl", feature = "cl_native"))] pub use anoncreds_clsignatures; +#[cfg(feature = "anoncreds")] /// Type definitions related Indy credential issuance and verification pub mod anoncreds;