github.com/blockchain-gm/fabric-ca@v0.0.0-20200423072702-b2c40c7ac69c/lib/server/idemix/mocks/Lib.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  package mocks
     3  
     4  import (
     5  	amcl "github.com/hyperledger/fabric-amcl/amcl"
     6  	FP256BN "github.com/hyperledger/fabric-amcl/amcl/FP256BN"
     7  	sm2 "github.com/tjfoc/gmsm/sm2"
     8  
     9  	idemix "github.com/hyperledger/fabric/idemix"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  )
    13  
    14  // Lib is an autogenerated mock type for the Lib type
    15  type Lib struct {
    16  	mock.Mock
    17  }
    18  
    19  // CreateCRI provides a mock function with given fields: key, unrevokedHandles, epoch, alg, rng
    20  func (_m *Lib) CreateCRI(key *sm2.PrivateKey, unrevokedHandles []*FP256BN.BIG, epoch int, alg idemix.RevocationAlgorithm, rng *amcl.RAND) (*idemix.CredentialRevocationInformation, error) {
    21  	ret := _m.Called(key, unrevokedHandles, epoch, alg, rng)
    22  
    23  	var r0 *idemix.CredentialRevocationInformation
    24  	if rf, ok := ret.Get(0).(func(*sm2.PrivateKey, []*FP256BN.BIG, int, idemix.RevocationAlgorithm, *amcl.RAND) *idemix.CredentialRevocationInformation); ok {
    25  		r0 = rf(key, unrevokedHandles, epoch, alg, rng)
    26  	} else {
    27  		if ret.Get(0) != nil {
    28  			r0 = ret.Get(0).(*idemix.CredentialRevocationInformation)
    29  		}
    30  	}
    31  
    32  	var r1 error
    33  	if rf, ok := ret.Get(1).(func(*sm2.PrivateKey, []*FP256BN.BIG, int, idemix.RevocationAlgorithm, *amcl.RAND) error); ok {
    34  		r1 = rf(key, unrevokedHandles, epoch, alg, rng)
    35  	} else {
    36  		r1 = ret.Error(1)
    37  	}
    38  
    39  	return r0, r1
    40  }
    41  
    42  // GenerateLongTermRevocationKey provides a mock function with given fields:
    43  func (_m *Lib) GenerateLongTermRevocationKey() (*sm2.PrivateKey, error) {
    44  	ret := _m.Called()
    45  
    46  	var r0 *sm2.PrivateKey
    47  	if rf, ok := ret.Get(0).(func() *sm2.PrivateKey); ok {
    48  		r0 = rf()
    49  	} else {
    50  		if ret.Get(0) != nil {
    51  			r0 = ret.Get(0).(*sm2.PrivateKey)
    52  		}
    53  	}
    54  
    55  	var r1 error
    56  	if rf, ok := ret.Get(1).(func() error); ok {
    57  		r1 = rf()
    58  	} else {
    59  		r1 = ret.Error(1)
    60  	}
    61  
    62  	return r0, r1
    63  }
    64  
    65  // GetRand provides a mock function with given fields:
    66  func (_m *Lib) GetRand() (*amcl.RAND, error) {
    67  	ret := _m.Called()
    68  
    69  	var r0 *amcl.RAND
    70  	if rf, ok := ret.Get(0).(func() *amcl.RAND); ok {
    71  		r0 = rf()
    72  	} else {
    73  		if ret.Get(0) != nil {
    74  			r0 = ret.Get(0).(*amcl.RAND)
    75  		}
    76  	}
    77  
    78  	var r1 error
    79  	if rf, ok := ret.Get(1).(func() error); ok {
    80  		r1 = rf()
    81  	} else {
    82  		r1 = ret.Error(1)
    83  	}
    84  
    85  	return r0, r1
    86  }
    87  
    88  // NewCredential provides a mock function with given fields: key, m, attrs, rng
    89  func (_m *Lib) NewCredential(key *idemix.IssuerKey, m *idemix.CredRequest, attrs []*FP256BN.BIG, rng *amcl.RAND) (*idemix.Credential, error) {
    90  	ret := _m.Called(key, m, attrs, rng)
    91  
    92  	var r0 *idemix.Credential
    93  	if rf, ok := ret.Get(0).(func(*idemix.IssuerKey, *idemix.CredRequest, []*FP256BN.BIG, *amcl.RAND) *idemix.Credential); ok {
    94  		r0 = rf(key, m, attrs, rng)
    95  	} else {
    96  		if ret.Get(0) != nil {
    97  			r0 = ret.Get(0).(*idemix.Credential)
    98  		}
    99  	}
   100  
   101  	var r1 error
   102  	if rf, ok := ret.Get(1).(func(*idemix.IssuerKey, *idemix.CredRequest, []*FP256BN.BIG, *amcl.RAND) error); ok {
   103  		r1 = rf(key, m, attrs, rng)
   104  	} else {
   105  		r1 = ret.Error(1)
   106  	}
   107  
   108  	return r0, r1
   109  }
   110  
   111  // NewIssuerKey provides a mock function with given fields: AttributeNames, rng
   112  func (_m *Lib) NewIssuerKey(AttributeNames []string, rng *amcl.RAND) (*idemix.IssuerKey, error) {
   113  	ret := _m.Called(AttributeNames, rng)
   114  
   115  	var r0 *idemix.IssuerKey
   116  	if rf, ok := ret.Get(0).(func([]string, *amcl.RAND) *idemix.IssuerKey); ok {
   117  		r0 = rf(AttributeNames, rng)
   118  	} else {
   119  		if ret.Get(0) != nil {
   120  			r0 = ret.Get(0).(*idemix.IssuerKey)
   121  		}
   122  	}
   123  
   124  	var r1 error
   125  	if rf, ok := ret.Get(1).(func([]string, *amcl.RAND) error); ok {
   126  		r1 = rf(AttributeNames, rng)
   127  	} else {
   128  		r1 = ret.Error(1)
   129  	}
   130  
   131  	return r0, r1
   132  }
   133  
   134  // RandModOrder provides a mock function with given fields: rng
   135  func (_m *Lib) RandModOrder(rng *amcl.RAND) (*FP256BN.BIG, error) {
   136  	ret := _m.Called(rng)
   137  
   138  	var r0 *FP256BN.BIG
   139  	if rf, ok := ret.Get(0).(func(*amcl.RAND) *FP256BN.BIG); ok {
   140  		r0 = rf(rng)
   141  	} else {
   142  		if ret.Get(0) != nil {
   143  			r0 = ret.Get(0).(*FP256BN.BIG)
   144  		}
   145  	}
   146  
   147  	var r1 error
   148  	if rf, ok := ret.Get(1).(func(*amcl.RAND) error); ok {
   149  		r1 = rf(rng)
   150  	} else {
   151  		r1 = ret.Error(1)
   152  	}
   153  
   154  	return r0, r1
   155  }