Skip to content

Commit

Permalink
rename group id
Browse files Browse the repository at this point in the history
  • Loading branch information
vmidyllic committed Dec 15, 2023
1 parent 2538369 commit 41daf9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
10 changes: 4 additions & 6 deletions pubsignals/atomicV3.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ func (c *AtomicQueryV3) VerifyQuery(
if c.NullifierSessionID.Cmp(nullifierSessionID) != 0 {
return errors.Errorf("wrong verifier session id is used for nullification: expected %s given %s,", nullifierSessionID.String(), c.NullifierSessionID.String())
}
} else {
} else if c.NullifierSessionID != nil && c.NullifierSessionID.Int64() != 0 {
// if no nullifierSessionID in params - we need to verify that nullifier is zero
if c.NullifierSessionID != nil && c.NullifierSessionID.Int64() != 0 {
return errors.New("nullfifier id is generated but wasn't requested")
}
return errors.New("nullfifier id is generated but wasn't requested")
}

}
Expand All @@ -105,8 +103,8 @@ func (c *AtomicQueryV3) VerifyQuery(

}

if query.LinkSessionID != "" && c.LinkID == nil {
return errors.New("proof doesn't contain link id, but link session id is provided")
if query.GroupID != 0 && c.LinkID == nil {
return errors.New("proof doesn't contain link id, but group id is provided")
}

return nil
Expand Down
28 changes: 1 addition & 27 deletions pubsignals/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Query struct {
ClaimID string `json:"claimId,omitempty"`
SkipClaimRevocationCheck bool `json:"skipClaimRevocationCheck,omitempty"`
ProofType string `json:"proofType"`
LinkSessionID string `json:"linkSessionId"`
GroupID int `json:"groupId"`
}

// CircuitOutputs pub signals from circuit.
Expand Down Expand Up @@ -368,32 +368,6 @@ func (q Query) verifyEmptyCredentialSubject(
return nil
}

// func verifyLinkID(linkNonce string, claim *core.Claim, linkId string) error {
// linkIdCalc, err := CalculateLinkID(linkNonce, claim)
// if err != nil {
// return errors.Errorf("failed to calculate link ID: %v", err)
// }

// if linkId != linkIdCalc {
// return errors.Errorf("invalid link ID")
// }

// return nil
// }

// func verifyNullify(genesisID, claimSubjectProfileNonce, claimSchema, fieldValue, verifierID, crs, operatorOutput *big.Int) error {
// nullify, err := CalculateNullify(genesisID, claimSubjectProfileNonce, claimSchema, fieldValue, verifierID, crs)
// if err != nil {
// return errors.Errorf("failed to calculate nullify: %v", err)
// }

// if nullify != operatorOutput.String() {
// return errors.Errorf("invalid nullify value")
// }

// return nil
// }

func (q Query) isSelectivityDisclosure(
predicate map[string]interface{}) bool {
return q.CredentialSubject != nil && len(predicate) == 0
Expand Down

0 comments on commit 41daf9f

Please sign in to comment.