github.com/anjalikarhana/fabric@v2.1.1+incompatible/idemix/nonrevocation-verifier.go (about) 1 /* 2 Copyright IBM Corp. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package idemix 8 9 import ( 10 "github.com/hyperledger/fabric-amcl/amcl/FP256BN" 11 "github.com/pkg/errors" 12 ) 13 14 // nonRevokedProver is the Verifier of the ZK proof system that handles revocation. 15 type nonRevocationVerifier interface { 16 // recomputeFSContribution recomputes the contribution of the non-revocation proof to the ZKP challenge 17 recomputeFSContribution(proof *NonRevocationProof, chal *FP256BN.BIG, epochPK *FP256BN.ECP2, proofSRh *FP256BN.BIG) ([]byte, error) 18 } 19 20 // nopNonRevocationVerifier is an empty nonRevocationVerifier that produces an empty contribution 21 type nopNonRevocationVerifier struct{} 22 23 func (verifier *nopNonRevocationVerifier) recomputeFSContribution(proof *NonRevocationProof, chal *FP256BN.BIG, epochPK *FP256BN.ECP2, proofSRh *FP256BN.BIG) ([]byte, error) { 24 return nil, nil 25 } 26 27 // getNonRevocationVerifier returns the nonRevocationVerifier bound to the passed revocation algorithm 28 func getNonRevocationVerifier(algorithm RevocationAlgorithm) (nonRevocationVerifier, error) { 29 switch algorithm { 30 case ALG_NO_REVOCATION: 31 return &nopNonRevocationVerifier{}, nil 32 default: 33 // unknown revocation algorithm 34 return nil, errors.Errorf("unknown revocation algorithm %d", algorithm) 35 } 36 }