Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pdtfh committed Nov 28, 2024
1 parent 4ca0b40 commit 3c86b8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions walletkit-core/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Identity {
} else {
// When the identity commitment for the non-canonical identity is requested, a new Semaphore identity needs to be initialized.
let mut secret_hex = self.secret_hex;
let identity = semaphore::identity::Identity::from_secret(
let identity = semaphore::identity::Identity::from_hashed_secret(
&mut secret_hex,
Some(credential_type.as_identity_trapdoor()),
);
Expand Down Expand Up @@ -136,10 +136,16 @@ mod tests {
assert_eq!(
*secure_passport_commitment,
uint!(
16067026999511589387916925190393290559934977022835489992976401115232782097070_U256
4772776030911288417155544975787646998508849894109450205303839917538446765610_U256
)
);

let semaphore_identity = semaphore::identity::Identity::from_secret(
&mut b"not_a_real_secret".to_vec(),
Some(b"secure_passport"),
);
assert_eq!(semaphore_identity.commitment(), *secure_passport_commitment);

let device_commitment =
identity.get_identity_commitment(&CredentialType::Device);

Expand Down

0 comments on commit 3c86b8a

Please sign in to comment.