| Line | Source | Count |
| 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 | #include <openssl/opensslconf.h> | - |
| 71 | | - |
| 72 | #include <openssl/err.h> | - |
| 73 | | - |
| 74 | #include "bn_lcl.h" | - |
| 75 | #include "ec_lcl.h" | - |
| 76 | | - |
| 77 | #ifndef OPENSSL_NO_EC2M | - |
| 78 | | - |
| 79 | | - |
| 80 | | - |
| 81 | | - |
| 82 | | - |
| 83 | | - |
| 84 | | - |
| 85 | | - |
| 86 | | - |
| 87 | static int | - |
| 88 | gf2m_Mdouble(const EC_GROUP *group, BIGNUM *x, BIGNUM *z, BN_CTX *ctx) | - |
| 89 | { | - |
| 90 | BIGNUM *t1; | - |
| 91 | int ret = 0; | - |
| 92 | | - |
| 93 | | - |
| 94 | BN_CTX_start(ctx); | - |
| 95 | if ((t1 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 96 | goto err; never executed: goto err; | 0 |
| 97 | | - |
| 98 | if (!group->meth->field_sqr(group, x, x, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 99 | goto err; never executed: goto err; | 0 |
| 100 | if (!group->meth->field_sqr(group, t1, z, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 101 | goto err; never executed: goto err; | 0 |
| 102 | if (!group->meth->field_mul(group, z, x, t1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 103 | goto err; never executed: goto err; | 0 |
| 104 | if (!group->meth->field_sqr(group, x, x, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 105 | goto err; never executed: goto err; | 0 |
| 106 | if (!group->meth->field_sqr(group, t1, t1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 107 | goto err; never executed: goto err; | 0 |
| 108 | if (!group->meth->field_mul(group, t1, &group->b, t1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 109 | goto err; never executed: goto err; | 0 |
| 110 | if (!BN_GF2m_add(x, x, t1))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 111 | goto err; never executed: goto err; | 0 |
| 112 | | - |
| 113 | ret = 1; | - |
| 114 | | - |
| 115 | err: code before this statement never executed: err: | 0 |
| 116 | BN_CTX_end(ctx); | - |
| 117 | return ret; never executed: return ret; | 0 |
| 118 | } | - |
| 119 | | - |
| 120 | | - |
| 121 | | - |
| 122 | | - |
| 123 | | - |
| 124 | | - |
| 125 | | - |
| 126 | static int | - |
| 127 | gf2m_Madd(const EC_GROUP *group, const BIGNUM *x, BIGNUM *x1, BIGNUM *z1, | - |
| 128 | const BIGNUM *x2, const BIGNUM *z2, BN_CTX *ctx) | - |
| 129 | { | - |
| 130 | BIGNUM *t1, *t2; | - |
| 131 | int ret = 0; | - |
| 132 | | - |
| 133 | | - |
| 134 | BN_CTX_start(ctx); | - |
| 135 | if ((t1 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 136 | goto err; never executed: goto err; | 0 |
| 137 | if ((t2 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 138 | goto err; never executed: goto err; | 0 |
| 139 | | - |
| 140 | if (!BN_copy(t1, x))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 141 | goto err; never executed: goto err; | 0 |
| 142 | if (!group->meth->field_mul(group, x1, x1, z2, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 143 | goto err; never executed: goto err; | 0 |
| 144 | if (!group->meth->field_mul(group, z1, z1, x2, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 145 | goto err; never executed: goto err; | 0 |
| 146 | if (!group->meth->field_mul(group, t2, x1, z1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 147 | goto err; never executed: goto err; | 0 |
| 148 | if (!BN_GF2m_add(z1, z1, x1))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 149 | goto err; never executed: goto err; | 0 |
| 150 | if (!group->meth->field_sqr(group, z1, z1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 151 | goto err; never executed: goto err; | 0 |
| 152 | if (!group->meth->field_mul(group, x1, z1, t1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 153 | goto err; never executed: goto err; | 0 |
| 154 | if (!BN_GF2m_add(x1, x1, t2))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 155 | goto err; never executed: goto err; | 0 |
| 156 | | - |
| 157 | ret = 1; | - |
| 158 | | - |
| 159 | err: code before this statement never executed: err: | 0 |
| 160 | BN_CTX_end(ctx); | - |
| 161 | return ret; never executed: return ret; | 0 |
| 162 | } | - |
| 163 | | - |
| 164 | | - |
| 165 | | - |
| 166 | | - |
| 167 | | - |
| 168 | | - |
| 169 | | - |
| 170 | | - |
| 171 | | - |
| 172 | | - |
| 173 | static int | - |
| 174 | gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1, | - |
| 175 | BIGNUM *z1, BIGNUM *x2, BIGNUM *z2, BN_CTX *ctx) | - |
| 176 | { | - |
| 177 | BIGNUM *t3, *t4, *t5; | - |
| 178 | int ret = 0; | - |
| 179 | | - |
| 180 | if (BN_is_zero(z1)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 181 | BN_zero(x2); | - |
| 182 | BN_zero(z2); | - |
| 183 | return 1; never executed: return 1; | 0 |
| 184 | } | - |
| 185 | if (BN_is_zero(z2)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 186 | if (!BN_copy(x2, x))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 187 | return 0; never executed: return 0; | 0 |
| 188 | if (!BN_GF2m_add(z2, x, y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 189 | return 0; never executed: return 0; | 0 |
| 190 | return 2; never executed: return 2; | 0 |
| 191 | } | - |
| 192 | | - |
| 193 | BN_CTX_start(ctx); | - |
| 194 | if ((t3 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 195 | goto err; never executed: goto err; | 0 |
| 196 | if ((t4 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 197 | goto err; never executed: goto err; | 0 |
| 198 | if ((t5 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 199 | goto err; never executed: goto err; | 0 |
| 200 | | - |
| 201 | if (!BN_one(t5))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 202 | goto err; never executed: goto err; | 0 |
| 203 | | - |
| 204 | if (!group->meth->field_mul(group, t3, z1, z2, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 205 | goto err; never executed: goto err; | 0 |
| 206 | | - |
| 207 | if (!group->meth->field_mul(group, z1, z1, x, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 208 | goto err; never executed: goto err; | 0 |
| 209 | if (!BN_GF2m_add(z1, z1, x1))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 210 | goto err; never executed: goto err; | 0 |
| 211 | if (!group->meth->field_mul(group, z2, z2, x, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 212 | goto err; never executed: goto err; | 0 |
| 213 | if (!group->meth->field_mul(group, x1, z2, x1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 214 | goto err; never executed: goto err; | 0 |
| 215 | if (!BN_GF2m_add(z2, z2, x2))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 216 | goto err; never executed: goto err; | 0 |
| 217 | | - |
| 218 | if (!group->meth->field_mul(group, z2, z2, z1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 219 | goto err; never executed: goto err; | 0 |
| 220 | if (!group->meth->field_sqr(group, t4, x, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 221 | goto err; never executed: goto err; | 0 |
| 222 | if (!BN_GF2m_add(t4, t4, y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 223 | goto err; never executed: goto err; | 0 |
| 224 | if (!group->meth->field_mul(group, t4, t4, t3, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 225 | goto err; never executed: goto err; | 0 |
| 226 | if (!BN_GF2m_add(t4, t4, z2))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 227 | goto err; never executed: goto err; | 0 |
| 228 | | - |
| 229 | if (!group->meth->field_mul(group, t3, t3, x, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 230 | goto err; never executed: goto err; | 0 |
| 231 | if (!group->meth->field_div(group, t3, t5, t3, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 232 | goto err; never executed: goto err; | 0 |
| 233 | if (!group->meth->field_mul(group, t4, t3, t4, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 234 | goto err; never executed: goto err; | 0 |
| 235 | if (!group->meth->field_mul(group, x2, x1, t3, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 236 | goto err; never executed: goto err; | 0 |
| 237 | if (!BN_GF2m_add(z2, x2, x))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 238 | goto err; never executed: goto err; | 0 |
| 239 | | - |
| 240 | if (!group->meth->field_mul(group, z2, z2, t4, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 241 | goto err; never executed: goto err; | 0 |
| 242 | if (!BN_GF2m_add(z2, z2, y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 243 | goto err; never executed: goto err; | 0 |
| 244 | | - |
| 245 | ret = 2; | - |
| 246 | | - |
| 247 | err: code before this statement never executed: err: | 0 |
| 248 | BN_CTX_end(ctx); | - |
| 249 | return ret; never executed: return ret; | 0 |
| 250 | } | - |
| 251 | | - |
| 252 | | - |
| 253 | | - |
| 254 | | - |
| 255 | | - |
| 256 | | - |
| 257 | | - |
| 258 | | - |
| 259 | | - |
| 260 | | - |
| 261 | | - |
| 262 | static int | - |
| 263 | ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, | - |
| 264 | const BIGNUM *scalar, const EC_POINT *point, BN_CTX *ctx) | - |
| 265 | { | - |
| 266 | BIGNUM *x1, *x2, *z1, *z2; | - |
| 267 | int ret = 0, i; | - |
| 268 | BN_ULONG mask, word; | - |
| 269 | | - |
| 270 | if (r == point) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 271 | ECerror(EC_R_INVALID_ARGUMENT); | - |
| 272 | return 0; never executed: return 0; | 0 |
| 273 | } | - |
| 274 | | - |
| 275 | if ((scalar == NULL) || BN_is_zero(scalar) || (point == NULL) ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 276 | EC_POINT_is_at_infinity(group, point) > 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 277 | return EC_POINT_set_to_infinity(group, r); never executed: return EC_POINT_set_to_infinity(group, r); | 0 |
| 278 | } | - |
| 279 | | - |
| 280 | if (!point->Z_is_one)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 281 | return 0; never executed: return 0; | 0 |
| 282 | | - |
| 283 | | - |
| 284 | BN_CTX_start(ctx); | - |
| 285 | if ((x1 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 286 | goto err; never executed: goto err; | 0 |
| 287 | if ((z1 = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 288 | goto err; never executed: goto err; | 0 |
| 289 | | - |
| 290 | x2 = &r->X; | - |
| 291 | z2 = &r->Y; | - |
| 292 | | - |
| 293 | if (!bn_wexpand(x1, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 294 | goto err; never executed: goto err; | 0 |
| 295 | if (!bn_wexpand(z1, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 296 | goto err; never executed: goto err; | 0 |
| 297 | if (!bn_wexpand(x2, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 298 | goto err; never executed: goto err; | 0 |
| 299 | if (!bn_wexpand(z2, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 300 | goto err; never executed: goto err; | 0 |
| 301 | | - |
| 302 | if (!BN_GF2m_mod_arr(x1, &point->X, group->poly))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 303 | goto err; never executed: goto err; | 0 |
| 304 | if (!BN_one(z1))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 305 | goto err; never executed: goto err; | 0 |
| 306 | if (!group->meth->field_sqr(group, z2, x1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 307 | goto err; never executed: goto err; | 0 |
| 308 | if (!group->meth->field_sqr(group, x2, z2, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 309 | goto err; never executed: goto err; | 0 |
| 310 | if (!BN_GF2m_add(x2, x2, &group->b))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 311 | goto err; never executed: goto err; | 0 |
| 312 | | - |
| 313 | | - |
| 314 | i = scalar->top - 1; | - |
| 315 | mask = BN_TBIT; | - |
| 316 | word = scalar->d[i]; | - |
| 317 | while (!(word & mask))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 318 | mask >>= 1; never executed: mask >>= 1; | 0 |
| 319 | mask >>= 1; | - |
| 320 | | - |
| 321 | if (!mask) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 322 | i--; | - |
| 323 | mask = BN_TBIT; | - |
| 324 | } never executed: end of block | 0 |
| 325 | for (; i >= 0; i--) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 326 | word = scalar->d[i]; | - |
| 327 | while (mask) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 328 | if (!BN_swap_ct(word & mask, x1, x2, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 329 | goto err; never executed: goto err; | 0 |
| 330 | if (!BN_swap_ct(word & mask, z1, z2, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 331 | goto err; never executed: goto err; | 0 |
| 332 | if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 333 | goto err; never executed: goto err; | 0 |
| 334 | if (!gf2m_Mdouble(group, x1, z1, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 335 | goto err; never executed: goto err; | 0 |
| 336 | if (!BN_swap_ct(word & mask, x1, x2, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 337 | goto err; never executed: goto err; | 0 |
| 338 | if (!BN_swap_ct(word & mask, z1, z2, group->field.top))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 339 | goto err; never executed: goto err; | 0 |
| 340 | mask >>= 1; | - |
| 341 | } never executed: end of block | 0 |
| 342 | mask = BN_TBIT; | - |
| 343 | } never executed: end of block | 0 |
| 344 | | - |
| 345 | | - |
| 346 | i = gf2m_Mxy(group, &point->X, &point->Y, x1, z1, x2, z2, ctx); | - |
| 347 | if (i == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 348 | goto err; never executed: goto err; | 0 |
| 349 | else if (i == 1) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 350 | if (!EC_POINT_set_to_infinity(group, r))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 351 | goto err; never executed: goto err; | 0 |
| 352 | } else { never executed: end of block | 0 |
| 353 | if (!BN_one(&r->Z))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 354 | goto err; never executed: goto err; | 0 |
| 355 | r->Z_is_one = 1; | - |
| 356 | } never executed: end of block | 0 |
| 357 | | - |
| 358 | | - |
| 359 | BN_set_negative(&r->X, 0); | - |
| 360 | BN_set_negative(&r->Y, 0); | - |
| 361 | | - |
| 362 | ret = 1; | - |
| 363 | | - |
| 364 | err: code before this statement never executed: err: | 0 |
| 365 | BN_CTX_end(ctx); | - |
| 366 | return ret; never executed: return ret; | 0 |
| 367 | } | - |
| 368 | | - |
| 369 | | - |
| 370 | | - |
| 371 | | - |
| 372 | | - |
| 373 | | - |
| 374 | int | - |
| 375 | ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | - |
| 376 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx) | - |
| 377 | { | - |
| 378 | BN_CTX *new_ctx = NULL; | - |
| 379 | int ret = 0; | - |
| 380 | size_t i; | - |
| 381 | EC_POINT *p = NULL; | - |
| 382 | EC_POINT *acc = NULL; | - |
| 383 | | - |
| 384 | if (ctx == NULL) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 385 | ctx = new_ctx = BN_CTX_new(); | - |
| 386 | if (ctx == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 387 | return 0; never executed: return 0; | 0 |
| 388 | } never executed: end of block | 0 |
| 389 | | - |
| 390 | | - |
| 391 | | - |
| 392 | | - |
| 393 | | - |
| 394 | | - |
| 395 | if ((scalar && (num > 1)) || (num > 2) ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 396 | (num == 0 && EC_GROUP_have_precompute_mult(group))) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 397 | ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); | - |
| 398 | goto err; never executed: goto err; | 0 |
| 399 | } | - |
| 400 | if ((p = EC_POINT_new(group)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 401 | goto err; never executed: goto err; | 0 |
| 402 | if ((acc = EC_POINT_new(group)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 403 | goto err; never executed: goto err; | 0 |
| 404 | | - |
| 405 | if (!EC_POINT_set_to_infinity(group, acc))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 406 | goto err; never executed: goto err; | 0 |
| 407 | | - |
| 408 | if (scalar) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 409 | if (!ec_GF2m_montgomery_point_multiply(group, p, scalar, group->generator, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 410 | goto err; never executed: goto err; | 0 |
| 411 | if (BN_is_negative(scalar))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 412 | if (!group->meth->invert(group, p, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 413 | goto err; never executed: goto err; | 0 |
| 414 | if (!group->meth->add(group, acc, acc, p, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 415 | goto err; never executed: goto err; | 0 |
| 416 | } never executed: end of block | 0 |
| 417 | for (i = 0; i < num; i++) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 418 | if (!ec_GF2m_montgomery_point_multiply(group, p, scalars[i], points[i], ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 419 | goto err; never executed: goto err; | 0 |
| 420 | if (BN_is_negative(scalars[i]))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 421 | if (!group->meth->invert(group, p, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 422 | goto err; never executed: goto err; | 0 |
| 423 | if (!group->meth->add(group, acc, acc, p, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 424 | goto err; never executed: goto err; | 0 |
| 425 | } never executed: end of block | 0 |
| 426 | | - |
| 427 | if (!EC_POINT_copy(r, acc))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 428 | goto err; never executed: goto err; | 0 |
| 429 | | - |
| 430 | ret = 1; | - |
| 431 | | - |
| 432 | err: code before this statement never executed: err: | 0 |
| 433 | EC_POINT_free(p); | - |
| 434 | EC_POINT_free(acc); | - |
| 435 | BN_CTX_free(new_ctx); | - |
| 436 | return ret; never executed: return ret; | 0 |
| 437 | } | - |
| 438 | | - |
| 439 | | - |
| 440 | | - |
| 441 | | - |
| 442 | | - |
| 443 | int | - |
| 444 | ec_GF2m_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | - |
| 445 | { | - |
| 446 | return ec_wNAF_precompute_mult(group, ctx);executed 10 times by 1 test: return ec_wNAF_precompute_mult(group, ctx); | 10 |
| 447 | } | - |
| 448 | | - |
| 449 | int | - |
| 450 | ec_GF2m_have_precompute_mult(const EC_GROUP * group) | - |
| 451 | { | - |
| 452 | return ec_wNAF_have_precompute_mult(group); never executed: return ec_wNAF_have_precompute_mult(group); | 0 |
| 453 | } | - |
| 454 | | - |
| 455 | #endif | - |
| | |