Skip to content

Commit

Permalink
add verifier id constants
Browse files Browse the repository at this point in the history
  • Loading branch information
motemotech committed Oct 21, 2024
1 parent 9cff012 commit f9d9c5b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 7 deletions.
12 changes: 11 additions & 1 deletion contracts/archived-contracts/constants/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ uint256 constant PROVE_RSA_CURRENT_DATE_INDEX = 43;
uint256 constant PROVE_RSA_USER_IDENTIFIER_INDEX = 49;
uint256 constant PROVE_RSA_SCOPE_INDEX = 50;

uint256 constant DSC_BLINDED_DSC_COMMITMENT_INDEX = 0;
uint256 constant DSC_BLINDED_DSC_COMMITMENT_INDEX = 0;

uint256 constant RSA_65537_SHA256_2048_VERIFIER = 1;
uint256 constant RSA_65537_SHA1_2048_VERIFIER = 3;
uint256 constant RSA_PSS_65537_SHA256_2048_VERIFIER = 4;
uint256 constant ECDSA_SECP256R1_SHA1_256_VERIFIER = 7;
uint256 constant ECDSA_SECP256R1_SHA256_256_VERIFIER = 8;
uint256 constant ECDSA_SECP384R1_SHA384_384_VERIFIER = 9;
uint256 constant RSA_65537_SHA256_4096_VERIFIER = 10;
uint256 constant RSA_65537_SHA1_4096_VERIFIER = 11;
uint256 constant RSA_PSS_65537_SHA256_4096_VERIFIER = 12;
71 changes: 70 additions & 1 deletion contracts/contracts/interfaces/IOpenPassportVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,76 @@ interface IOpenPassportVerifier {
bytes3[20] forbiddenCountries;
}

function discloseIssuingState(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function discloseName(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function disclosePassportNumber(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function discloseNationality(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function discloseDateOfBirth(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function discloseGender(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function discloseExpiryDate(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (string memory);

function discloseOlderThan(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (uint256);

function discloseOfacResult(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (bool);

function discloseForbiddenCountries(
uint256 proveVerifierId,
uint256 dscVerifierId,
IGenericVerifier.ProveCircuitProof memory pProof,
IGenericVerifier.DscCircuitProof memory dProof
) external returns (bytes3[20] memory);

function verifyAndDiscloseAttributes(
uint256 proveVerifierId,
uint256 dscVerifierId,
Expand All @@ -36,7 +106,6 @@ interface IOpenPassportVerifier {
uint256 attributeSelector
) external returns (PassportAttributes memory);


function verify(
uint256 proveVerifierId,
uint256 dscVerifierId,
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openpassport/contracts",
"version": "0.0.1",
"version": "0.0.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions contracts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,10 @@
resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0"
integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg==

"@openzeppelin/contracts@^4.9.2":
version "4.9.6"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.6.tgz#2a880a24eb19b4f8b25adc2a5095f2aa27f39677"
integrity sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==
"@openzeppelin/contracts@^5.0.2":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.1.0.tgz#4e61162f2a2bf414c4e10c45eca98ce5f1aadbd4"
integrity sha512-p1ULhl7BXzjjbha5aqst+QMLY+4/LCWADXOCsmLHRM77AqiPjnd9vvUN9sosUfhL9JGKpZ0TjEGxgvnizmWGSA==

"@scure/base@~1.1.0", "@scure/base@~1.1.6":
version "1.1.7"
Expand Down

0 comments on commit f9d9c5b

Please sign in to comment.