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