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