Lines Matching refs:res
47 EpidStatus res = kEpidNoErr; in Epid11VerifyBasicSig() local
105 res = kEpidBadArgErr; in Epid11VerifyBasicSig()
106 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
114 res = NewEcPoint(G1, &T1); in Epid11VerifyBasicSig()
115 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
116 res = NewEcPoint(G1, &T2); in Epid11VerifyBasicSig()
117 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
118 res = NewEcPoint(G1, &R1); in Epid11VerifyBasicSig()
119 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
120 res = NewEcPoint(G1, &R2); in Epid11VerifyBasicSig()
121 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
122 res = NewEcPoint(G1, &t1); in Epid11VerifyBasicSig()
123 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
124 res = NewEcPoint(G1, &t2); in Epid11VerifyBasicSig()
125 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
127 res = NewFfElement(GT, &R4); in Epid11VerifyBasicSig()
128 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
129 res = NewFfElement(GT, &t3); in Epid11VerifyBasicSig()
130 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
132 res = NewEcPoint(G3, &B); in Epid11VerifyBasicSig()
133 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
134 res = NewEcPoint(G3, &K); in Epid11VerifyBasicSig()
135 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
136 res = NewEcPoint(G3, &R3); in Epid11VerifyBasicSig()
137 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
138 res = NewEcPoint(G3, &t5); in Epid11VerifyBasicSig()
139 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
141 res = NewBigNum(sizeof(FpElemStr), &c_bn); in Epid11VerifyBasicSig()
142 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
143 res = NewBigNum(sizeof(FpElemStr), &sa_bn); in Epid11VerifyBasicSig()
144 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
145 res = NewBigNum(sizeof(FpElemStr), &sb_bn); in Epid11VerifyBasicSig()
146 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
147 res = NewBigNum(sizeof(FpElemStr), &nc_bn); in Epid11VerifyBasicSig()
148 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
149 res = NewBigNum(sizeof(FpElemStr), &salpha_bn); in Epid11VerifyBasicSig()
150 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
151 res = NewBigNum(sizeof(FpElemStr), &sbeta_bn); in Epid11VerifyBasicSig()
152 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
153 res = NewBigNum(sizeof(FpElemStr), &nsx_bn); in Epid11VerifyBasicSig()
154 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
155 res = NewBigNum(sizeof(OctStr600), &sf_bn); in Epid11VerifyBasicSig()
156 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
157 res = NewBigNum(sizeof(OctStr600), &sf_tick_bn); in Epid11VerifyBasicSig()
158 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
159 res = NewBigNum(sizeof(FpElemStr), &nc_tick_bn); in Epid11VerifyBasicSig()
160 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
161 res = NewBigNum(sizeof(FpElemStr) * 2, &syalpha_bn); in Epid11VerifyBasicSig()
162 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
167 res = ReadEcPoint(G3, &(sig->B), sizeof(sig->B), B); in Epid11VerifyBasicSig()
168 if (kEpidNoErr != res) { in Epid11VerifyBasicSig()
169 if (ctx->basename_len == 0 && kEpidBadArgErr == res) { in Epid11VerifyBasicSig()
170 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
176 res = EcIsIdentity(G3, B, &cmp_result); in Epid11VerifyBasicSig()
177 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
179 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
185 res = EcIsEqual(G3, basename_hash, B, &cmp_result); in Epid11VerifyBasicSig()
186 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
188 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
193 res = ReadEcPoint(G3, &(sig->K), sizeof(sig->K), K); in Epid11VerifyBasicSig()
194 if (kEpidNoErr != res) { in Epid11VerifyBasicSig()
195 if (kEpidBadArgErr == res) { in Epid11VerifyBasicSig()
196 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
202 res = ReadEcPoint(G1, &(sig->T1), sizeof(sig->T1), T1); in Epid11VerifyBasicSig()
203 if (kEpidNoErr != res) { in Epid11VerifyBasicSig()
204 if (kEpidBadArgErr == res) { in Epid11VerifyBasicSig()
205 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
211 res = ReadEcPoint(G1, &(sig->T2), sizeof(sig->T2), T2); in Epid11VerifyBasicSig()
212 if (kEpidNoErr != res) { in Epid11VerifyBasicSig()
213 if (kEpidBadArgErr == res) { in Epid11VerifyBasicSig()
214 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
226 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
235 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
240 res = ReadBigNum(&(sig->c), sizeof(sig->c), c_bn); in Epid11VerifyBasicSig()
241 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
242 res = BigNumMod(c_bn, p_bn, nc_bn); in Epid11VerifyBasicSig()
243 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
245 res = BigNumSub(p_bn, nc_bn, nc_bn); in Epid11VerifyBasicSig()
246 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
249 res = BigNumMod(c_bn, p_tick_bn, nc_tick_bn); in Epid11VerifyBasicSig()
250 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
251 res = BigNumSub(p_tick_bn, nc_tick_bn, nc_tick_bn); in Epid11VerifyBasicSig()
252 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
255 res = ReadBigNum(&(sig->sx), sizeof(sig->sx), nsx_bn); in Epid11VerifyBasicSig()
256 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
257 res = BigNumSub(p_bn, nsx_bn, nsx_bn); in Epid11VerifyBasicSig()
258 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
261 res = ReadBigNum(&(sig->salpha), sizeof(sig->salpha), salpha_bn); in Epid11VerifyBasicSig()
262 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
263 res = ReadBigNum(&(sig->sy), sizeof(sig->sy), syalpha_bn); in Epid11VerifyBasicSig()
264 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
265 res = BigNumAdd(salpha_bn, syalpha_bn, syalpha_bn); in Epid11VerifyBasicSig()
266 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
267 res = BigNumMod(syalpha_bn, p_bn, syalpha_bn); in Epid11VerifyBasicSig()
268 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
271 res = ReadBigNum(&sig->sa, sizeof(sig->sa), sa_bn); in Epid11VerifyBasicSig()
272 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
273 res = ReadBigNum(&sig->sb, sizeof(sig->sb), sb_bn); in Epid11VerifyBasicSig()
274 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
284 res = EcMultiExpBn(G1, points, exponents, COUNT_OF(points), R1); in Epid11VerifyBasicSig()
285 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
289 res = ReadBigNum(&sig->sbeta, sizeof(sig->sbeta), sbeta_bn); in Epid11VerifyBasicSig()
290 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
300 res = EcMultiExpBn(G1, points, exponents, COUNT_OF(points), R2); in Epid11VerifyBasicSig()
301 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
304 res = ReadBigNum(&sig->sf, sizeof(sig->sf), sf_tick_bn); in Epid11VerifyBasicSig()
305 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
307 res = BigNumMod(sf_tick_bn, p_tick_bn, sf_tick_bn); in Epid11VerifyBasicSig()
308 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
316 res = EcMultiExpBn(G3, points, exponents, COUNT_OF(points), R3); in Epid11VerifyBasicSig()
317 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
321 res = BigNumMod(c_bn, p_bn, c_bn); in Epid11VerifyBasicSig()
322 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
330 res = EcMultiExpBn(G1, points, exponents, COUNT_OF(points), t1); in Epid11VerifyBasicSig()
331 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
334 res = WriteBigNum(nc_bn, sizeof(nc_str), &nc_str); in Epid11VerifyBasicSig()
335 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
336 res = EcExp(G1, T1, &nc_str, t2); in Epid11VerifyBasicSig()
337 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
339 res = Epid11Pairing(ctx->epid11_params->pairing_state, t1, g2, R4); in Epid11VerifyBasicSig()
340 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
342 res = Epid11Pairing(ctx->epid11_params->pairing_state, t2, w, t3); in Epid11VerifyBasicSig()
343 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
345 res = FfMul(GT, R4, t3, R4); in Epid11VerifyBasicSig()
346 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
349 res = ReadBigNum(&sig->sf, sizeof(sig->sf), sf_bn); in Epid11VerifyBasicSig()
350 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
360 res = FfMultiExpBn(GT, points, exponents, COUNT_OF(points), t3); in Epid11VerifyBasicSig()
361 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
364 res = FfMul(GT, R4, t3, R4); in Epid11VerifyBasicSig()
365 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
369 res = SetCalculatedEpid11CommitValues(&sig->B, &sig->K, &sig->T1, &sig->T2, in Epid11VerifyBasicSig()
372 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
373 res = CalculateEpid11CommitmentHash(&commit_values, msg, (uint32_t)msg_len, in Epid11VerifyBasicSig()
375 BREAK_ON_EPID_ERROR(res); in Epid11VerifyBasicSig()
377 res = kEpidSigInvalid; in Epid11VerifyBasicSig()
380 res = kEpidNoErr; in Epid11VerifyBasicSig()
411 return (res); in Epid11VerifyBasicSig()