Skip to content

Commit

Permalink
update to anoncreds-clsignatures 0.2
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Aug 2, 2023
1 parent 9384403 commit dfe94c6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
22 changes: 14 additions & 8 deletions indy-data-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indy-data-types"
version = "0.6.0"
version = "0.6.1"
authors = ["Hyperledger Indy Contributors <[email protected]>"]
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"
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions indy-data-types/src/anoncreds/cred_def.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions indy-data-types/src/anoncreds/link_secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self, ConversionError> {
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 })
}
Expand Down
1 change: 1 addition & 0 deletions indy-data-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit dfe94c6

Please sign in to comment.