Skip to content

Commit

Permalink
Changelog + proof version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf committed Oct 9, 2024
1 parent 2643089 commit 4d5edbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- `get_encryption_keys`, `decrypt_amount`, and `combine_encrypted_amounts` functions for handling encrypted amounts.
- `prove_statement_v1` for producing proofs related to Concordium identities.
- `prove_identity_statement` for producing proofs related to Concordium identities.
- `Network` type to represent different concordium network variants.
- `AttributeTag` to represent the different identity attribute variants.
- A number of types including `VerifiablePresentation`, `Web3IdCredential`, `VerifiableCredentialStatement`,
Expand Down
24 changes: 14 additions & 10 deletions src/id_proofs.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use concordium_base::{
common::VERSION_0,
id::{
constants::{ArCurve, AttributeKind, IpPairing},
id_proof_types::{ProofVersion, StatementWithContext},
types::IdentityObjectV1,
},
use concordium_base::id::{
constants::{ArCurve, AttributeKind, IpPairing},
id_proof_types::{ProofVersion, StatementWithContext},
types::IdentityObjectV1,
};
use key_derivation::CredentialContext;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -219,16 +216,23 @@ pub fn prove_identity_statement(
credential: cred_id,
};

let proof_version = ProofVersion::Version2;
let proof = statement
.prove(
ProofVersion::Version2,
proof_version,
&global_context,
challenge.as_ref(),
&id_object.alist,
&credential_context,
)
.context("Could not produce proof.")
.map_err(|e| e.to_call_failed(fn_name.to_string()))?;
VersionedIdentityProof::try_from(concordium_base::common::Versioned::new(VERSION_0, proof))
.map_err(|e| e.to_call_failed(fn_name.to_string()))

// We tag the proof with version 1 for `Versioned`, as 0 is used for `Proof` produced with
// `ProofVersion::Version1`
VersionedIdentityProof::try_from(concordium_base::common::Versioned::new(
(proof_version as u32).into(),
proof,
))
.map_err(|e| e.to_call_failed(fn_name.to_string()))
}

0 comments on commit 4d5edbc

Please sign in to comment.