Skip to content

Commit

Permalink
add IssuerAuthState input
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Nov 6, 2023
1 parent e1971f9 commit 0f40b78
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions credentialAtomicQueryV3.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type atomicQueryV3CircuitInputs struct {
IssuerAuthClaimsTreeRoot string `json:"issuerAuthClaimsTreeRoot"`
IssuerAuthRevTreeRoot string `json:"issuerAuthRevTreeRoot"`
IssuerAuthRootsTreeRoot string `json:"issuerAuthRootsTreeRoot"`
IssuerAuthState *merkletree.Hash `json:"issuerAuthState"`

IsRevocationChecked int `json:"isRevocationChecked"`
// Query
Expand Down Expand Up @@ -228,6 +229,7 @@ func (a AtomicQueryV3Inputs) InputsMarshal() ([]byte, error) {
s.IssuerAuthClaimNonRevMtpAuxHi = nodeAuxIssuerAuthNonRev.key
s.IssuerAuthClaimNonRevMtpAuxHv = nodeAuxIssuerAuthNonRev.value
s.IssuerAuthClaimNonRevMtpNoAux = nodeAuxIssuerAuthNonRev.noAux
s.IssuerAuthState = a.Claim.SignatureProof.IssuerAuthNonRevProof.TreeState.State

a.fillMTPProofsWithZero(&s)
case MTPProofType:
Expand Down Expand Up @@ -297,6 +299,7 @@ func (a AtomicQueryV3Inputs) fillSigProofWithZero(s *atomicQueryV3CircuitInputs)
s.IssuerAuthClaimNonRevMtpAuxHi = &merkletree.HashZero
s.IssuerAuthClaimNonRevMtpAuxHv = &merkletree.HashZero
s.IssuerAuthClaimNonRevMtpNoAux = "0"
s.IssuerAuthState = &merkletree.HashZero
}

// AtomicQueryV3PubSignals public inputs
Expand Down
3 changes: 3 additions & 0 deletions credentialAtomicQueryV3OnChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type atomicQueryV3OnChainCircuitInputs struct {
IssuerAuthClaimsTreeRoot string `json:"issuerAuthClaimsTreeRoot"`
IssuerAuthRevTreeRoot string `json:"issuerAuthRevTreeRoot"`
IssuerAuthRootsTreeRoot string `json:"issuerAuthRootsTreeRoot"`
IssuerAuthState *merkletree.Hash `json:"issuerAuthState"`

IsRevocationChecked int `json:"isRevocationChecked"`
// Query
Expand Down Expand Up @@ -297,6 +298,7 @@ func (a AtomicQueryV3OnChainInputs) InputsMarshal() ([]byte, error) {
s.IssuerAuthClaimNonRevMtpAuxHi = nodeAuxIssuerAuthNonRev.key
s.IssuerAuthClaimNonRevMtpAuxHv = nodeAuxIssuerAuthNonRev.value
s.IssuerAuthClaimNonRevMtpNoAux = nodeAuxIssuerAuthNonRev.noAux
s.IssuerAuthState = a.Claim.SignatureProof.IssuerAuthNonRevProof.TreeState.State

a.fillMTPProofsWithZero(&s)
case MTPProofType:
Expand Down Expand Up @@ -376,6 +378,7 @@ func (a AtomicQueryV3OnChainInputs) fillSigProofWithZero(s *atomicQueryV3OnChain
s.IssuerAuthClaimNonRevMtpAuxHi = &merkletree.HashZero
s.IssuerAuthClaimNonRevMtpAuxHv = &merkletree.HashZero
s.IssuerAuthClaimNonRevMtpNoAux = "0"
s.IssuerAuthState = &merkletree.HashZero
}

// AtomicQueryV3OnChainPubSignals public inputs
Expand Down
1 change: 1 addition & 0 deletions testdata/V3_mtp_inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"issuerAuthClaimsTreeRoot": "0",
"issuerAuthRevTreeRoot": "0",
"issuerAuthRootsTreeRoot": "0",
"issuerAuthState": "0",
"isRevocationChecked": 1,
"claimPathNotExists": 1,
"claimPathMtp": [
Expand Down
1 change: 1 addition & 0 deletions testdata/V3_sig_inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"issuerAuthClaimsTreeRoot": "10304430946970870697981400054531724100803206948489006715521525892274350097449",
"issuerAuthRevTreeRoot": "0",
"issuerAuthRootsTreeRoot": "0",
"issuerAuthState": "20177832565449474772630743317224985532862797657496372535616634430055981993180",
"isRevocationChecked": 1,
"claimPathNotExists": 1,
"claimPathMtp": [
Expand Down
1 change: 1 addition & 0 deletions testdata/onchain_V3_mtp_inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
"issuerAuthClaimsTreeRoot": "0",
"issuerAuthRevTreeRoot": "0",
"issuerAuthRootsTreeRoot": "0",
"issuerAuthState": "0",
"issuerAuthClaimNonRevMtp": [
"0",
"0",
Expand Down
1 change: 1 addition & 0 deletions testdata/onchain_V3_sig_inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"issuerAuthClaimsTreeRoot": "10304430946970870697981400054531724100803206948489006715521525892274350097449",
"issuerAuthRevTreeRoot": "0",
"issuerAuthRootsTreeRoot": "0",
"issuerAuthState": "20177832565449474772630743317224985532862797657496372535616634430055981993180",
"isRevocationChecked": 1,
"claimPathNotExists": 1,
"claimPathMtp": [
Expand Down

0 comments on commit 0f40b78

Please sign in to comment.