| 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 | | - |
| 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 | #include <openssl/err.h> | - |
| 113 | | - |
| 114 | #include "bn_lcl.h" | - |
| 115 | | - |
| 116 | static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); | - |
| 117 | static BIGNUM *BN_gcd_no_branch(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, | - |
| 118 | BN_CTX *ctx); | - |
| 119 | | - |
| 120 | int | - |
| 121 | BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) | - |
| 122 | { | - |
| 123 | BIGNUM *a, *b, *t; | - |
| 124 | int ret = 0; | - |
| 125 | | - |
| 126 | bn_check_top(in_a); | - |
| 127 | bn_check_top(in_b); | - |
| 128 | | - |
| 129 | BN_CTX_start(ctx); | - |
| 130 | if ((a = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 131 | goto err; never executed: goto err; | 0 |
| 132 | if ((b = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 133 | goto err; never executed: goto err; | 0 |
| 134 | | - |
| 135 | if (BN_copy(a, in_a) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 136 | goto err; never executed: goto err; | 0 |
| 137 | if (BN_copy(b, in_b) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 138 | goto err; never executed: goto err; | 0 |
| 139 | a->neg = 0; | - |
| 140 | b->neg = 0; | - |
| 141 | | - |
| 142 | if (BN_cmp(a, b) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 143 | t = a; | - |
| 144 | a = b; | - |
| 145 | b = t; | - |
| 146 | } never executed: end of block | 0 |
| 147 | t = euclid(a, b); | - |
| 148 | if (t == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 149 | goto err; never executed: goto err; | 0 |
| 150 | | - |
| 151 | if (BN_copy(r, t) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 152 | goto err; never executed: goto err; | 0 |
| 153 | ret = 1; | - |
| 154 | | - |
| 155 | err: code before this statement never executed: err: | 0 |
| 156 | BN_CTX_end(ctx); | - |
| 157 | bn_check_top(r); | - |
| 158 | return (ret); never executed: return (ret); | 0 |
| 159 | } | - |
| 160 | | - |
| 161 | int | - |
| 162 | BN_gcd_ct(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) | - |
| 163 | { | - |
| 164 | if (BN_gcd_no_branch(r, in_a, in_b, ctx) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 165 | return 0; never executed: return 0; | 0 |
| 166 | return 1;executed 2 times by 1 test: return 1; | 2 |
| 167 | } | - |
| 168 | | - |
| 169 | int | - |
| 170 | BN_gcd_nonct(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) | - |
| 171 | { | - |
| 172 | return BN_gcd(r, in_a, in_b, ctx); never executed: return BN_gcd(r, in_a, in_b, ctx); | 0 |
| 173 | } | - |
| 174 | | - |
| 175 | | - |
| 176 | static BIGNUM * | - |
| 177 | euclid(BIGNUM *a, BIGNUM *b) | - |
| 178 | { | - |
| 179 | BIGNUM *t; | - |
| 180 | int shifts = 0; | - |
| 181 | | - |
| 182 | bn_check_top(a); | - |
| 183 | bn_check_top(b); | - |
| 184 | | - |
| 185 | | - |
| 186 | while (!BN_is_zero(b)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 187 | | - |
| 188 | | - |
| 189 | if (BN_is_odd(a)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 190 | if (BN_is_odd(b)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 191 | if (!BN_sub(a, a, b))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 192 | goto err; never executed: goto err; | 0 |
| 193 | if (!BN_rshift1(a, a))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 194 | goto err; never executed: goto err; | 0 |
| 195 | if (BN_cmp(a, b) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 196 | t = a; | - |
| 197 | a = b; | - |
| 198 | b = t; | - |
| 199 | } never executed: end of block | 0 |
| 200 | } never executed: end of block | 0 |
| 201 | else | - |
| 202 | { | - |
| 203 | if (!BN_rshift1(b, b))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 204 | goto err; never executed: goto err; | 0 |
| 205 | if (BN_cmp(a, b) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 206 | t = a; | - |
| 207 | a = b; | - |
| 208 | b = t; | - |
| 209 | } never executed: end of block | 0 |
| 210 | } never executed: end of block | 0 |
| 211 | } | - |
| 212 | else | - |
| 213 | { | - |
| 214 | if (BN_is_odd(b)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 215 | if (!BN_rshift1(a, a))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 216 | goto err; never executed: goto err; | 0 |
| 217 | if (BN_cmp(a, b) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 218 | t = a; | - |
| 219 | a = b; | - |
| 220 | b = t; | - |
| 221 | } never executed: end of block | 0 |
| 222 | } never executed: end of block | 0 |
| 223 | else | - |
| 224 | { | - |
| 225 | if (!BN_rshift1(a, a))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 226 | goto err; never executed: goto err; | 0 |
| 227 | if (!BN_rshift1(b, b))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 228 | goto err; never executed: goto err; | 0 |
| 229 | shifts++; | - |
| 230 | } never executed: end of block | 0 |
| 231 | } | - |
| 232 | | - |
| 233 | } | - |
| 234 | | - |
| 235 | if (shifts) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 236 | if (!BN_lshift(a, a, shifts))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 237 | goto err; never executed: goto err; | 0 |
| 238 | } never executed: end of block | 0 |
| 239 | bn_check_top(a); | - |
| 240 | return (a); never executed: return (a); | 0 |
| 241 | | - |
| 242 | err: | - |
| 243 | return (NULL); never executed: return ( ((void *)0) ); | 0 |
| 244 | } | - |
| 245 | | - |
| 246 | | - |
| 247 | | - |
| 248 | static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, const BIGNUM *a, | - |
| 249 | const BIGNUM *n, BN_CTX *ctx); | - |
| 250 | | - |
| 251 | static BIGNUM * | - |
| 252 | BN_mod_inverse_internal(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, | - |
| 253 | int ct) | - |
| 254 | { | - |
| 255 | BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL; | - |
| 256 | BIGNUM *ret = NULL; | - |
| 257 | int sign; | - |
| 258 | | - |
| 259 | if (ct)| TRUE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | never evaluated |
| 0-4086 |
| 260 | return BN_mod_inverse_no_branch(in, a, n, ctx);executed 4086 times by 14 tests: return BN_mod_inverse_no_branch(in, a, n, ctx);Executed by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 4086 |
| 261 | | - |
| 262 | bn_check_top(a); | - |
| 263 | bn_check_top(n); | - |
| 264 | | - |
| 265 | BN_CTX_start(ctx); | - |
| 266 | if ((A = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 267 | goto err; never executed: goto err; | 0 |
| 268 | if ((B = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 269 | goto err; never executed: goto err; | 0 |
| 270 | if ((X = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 271 | goto err; never executed: goto err; | 0 |
| 272 | if ((D = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 273 | goto err; never executed: goto err; | 0 |
| 274 | if ((M = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 275 | goto err; never executed: goto err; | 0 |
| 276 | if ((Y = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 277 | goto err; never executed: goto err; | 0 |
| 278 | if ((T = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 279 | goto err; never executed: goto err; | 0 |
| 280 | | - |
| 281 | if (in == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 282 | R = BN_new(); never executed: R = BN_new(); | 0 |
| 283 | else | - |
| 284 | R = in; never executed: R = in; | 0 |
| 285 | if (R == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 286 | goto err; never executed: goto err; | 0 |
| 287 | | - |
| 288 | BN_one(X); | - |
| 289 | BN_zero(Y); | - |
| 290 | if (BN_copy(B, a) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 291 | goto err; never executed: goto err; | 0 |
| 292 | if (BN_copy(A, n) == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 293 | goto err; never executed: goto err; | 0 |
| 294 | A->neg = 0; | - |
| 295 | if (B->neg || (BN_ucmp(B, A) >= 0)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 296 | if (!BN_nnmod(B, B, A, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 297 | goto err; never executed: goto err; | 0 |
| 298 | } never executed: end of block | 0 |
| 299 | sign = -1; | - |
| 300 | | - |
| 301 | | - |
| 302 | | - |
| 303 | | - |
| 304 | | - |
| 305 | | - |
| 306 | | - |
| 307 | if (BN_is_odd(n) && (BN_num_bits(n) <= (BN_BITS <= 32 ? 450 : 2048))) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 308 | | - |
| 309 | | - |
| 310 | | - |
| 311 | | - |
| 312 | int shift; | - |
| 313 | | - |
| 314 | while (!BN_is_zero(B)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 315 | | - |
| 316 | | - |
| 317 | | - |
| 318 | | - |
| 319 | | - |
| 320 | | - |
| 321 | | - |
| 322 | | - |
| 323 | | - |
| 324 | | - |
| 325 | shift = 0; | - |
| 326 | while (!BN_is_bit_set(B, shift)) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 327 | { | - |
| 328 | shift++; | - |
| 329 | | - |
| 330 | if (BN_is_odd(X)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 331 | if (!BN_uadd(X, X, n))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 332 | goto err; never executed: goto err; | 0 |
| 333 | } never executed: end of block | 0 |
| 334 | | - |
| 335 | if (!BN_rshift1(X, X))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 336 | goto err; never executed: goto err; | 0 |
| 337 | } never executed: end of block | 0 |
| 338 | if (shift > 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 339 | if (!BN_rshift(B, B, shift))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 340 | goto err; never executed: goto err; | 0 |
| 341 | } never executed: end of block | 0 |
| 342 | | - |
| 343 | | - |
| 344 | | - |
| 345 | shift = 0; | - |
| 346 | while (!BN_is_bit_set(A, shift)) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 347 | { | - |
| 348 | shift++; | - |
| 349 | | - |
| 350 | if (BN_is_odd(Y)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 351 | if (!BN_uadd(Y, Y, n))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 352 | goto err; never executed: goto err; | 0 |
| 353 | } never executed: end of block | 0 |
| 354 | | - |
| 355 | if (!BN_rshift1(Y, Y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 356 | goto err; never executed: goto err; | 0 |
| 357 | } never executed: end of block | 0 |
| 358 | if (shift > 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 359 | if (!BN_rshift(A, A, shift))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 360 | goto err; never executed: goto err; | 0 |
| 361 | } never executed: end of block | 0 |
| 362 | | - |
| 363 | | - |
| 364 | | - |
| 365 | | - |
| 366 | | - |
| 367 | | - |
| 368 | | - |
| 369 | | - |
| 370 | | - |
| 371 | | - |
| 372 | | - |
| 373 | | - |
| 374 | | - |
| 375 | if (BN_ucmp(B, A) >= 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 376 | | - |
| 377 | if (!BN_uadd(X, X, Y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 378 | goto err; never executed: goto err; | 0 |
| 379 | | - |
| 380 | | - |
| 381 | if (!BN_usub(B, B, A))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 382 | goto err; never executed: goto err; | 0 |
| 383 | } else { never executed: end of block | 0 |
| 384 | | - |
| 385 | if (!BN_uadd(Y, Y, X))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 386 | goto err; never executed: goto err; | 0 |
| 387 | | - |
| 388 | if (!BN_usub(A, A, B))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 389 | goto err; never executed: goto err; | 0 |
| 390 | } never executed: end of block | 0 |
| 391 | } | - |
| 392 | } else { never executed: end of block | 0 |
| 393 | | - |
| 394 | | - |
| 395 | while (!BN_is_zero(B)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 396 | BIGNUM *tmp; | - |
| 397 | | - |
| 398 | | - |
| 399 | | - |
| 400 | | - |
| 401 | | - |
| 402 | | - |
| 403 | | - |
| 404 | | - |
| 405 | if (BN_num_bits(A) == BN_num_bits(B)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 406 | if (!BN_one(D))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 407 | goto err; never executed: goto err; | 0 |
| 408 | if (!BN_sub(M, A, B))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 409 | goto err; never executed: goto err; | 0 |
| 410 | } else if (BN_num_bits(A) == BN_num_bits(B) + 1) { never executed: end of block | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 411 | | - |
| 412 | if (!BN_lshift1(T, B))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 413 | goto err; never executed: goto err; | 0 |
| 414 | if (BN_ucmp(A, T) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 415 | | - |
| 416 | if (!BN_one(D))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 417 | goto err; never executed: goto err; | 0 |
| 418 | if (!BN_sub(M, A, B))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 419 | goto err; never executed: goto err; | 0 |
| 420 | } else { never executed: end of block | 0 |
| 421 | | - |
| 422 | if (!BN_sub(M, A, T))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 423 | goto err; never executed: goto err; | 0 |
| 424 | if (!BN_add(D,T,B)) goto err; never executed: goto err; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 425 | if (BN_ucmp(A, D) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 426 | | - |
| 427 | if (!BN_set_word(D, 2))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 428 | goto err; never executed: goto err; | 0 |
| 429 | | - |
| 430 | } else { never executed: end of block | 0 |
| 431 | | - |
| 432 | if (!BN_set_word(D, 3))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 433 | goto err; never executed: goto err; | 0 |
| 434 | | - |
| 435 | if (!BN_sub(M, M, B))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 436 | goto err; never executed: goto err; | 0 |
| 437 | } never executed: end of block | 0 |
| 438 | } | - |
| 439 | } else { | - |
| 440 | if (!BN_div_nonct(D, M, A, B, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 441 | goto err; never executed: goto err; | 0 |
| 442 | } never executed: end of block | 0 |
| 443 | | - |
| 444 | | - |
| 445 | | - |
| 446 | | - |
| 447 | | - |
| 448 | | - |
| 449 | tmp = A; | - |
| 450 | | - |
| 451 | | - |
| 452 | A = B; | - |
| 453 | B = M; | - |
| 454 | | - |
| 455 | | - |
| 456 | | - |
| 457 | | - |
| 458 | | - |
| 459 | | - |
| 460 | | - |
| 461 | | - |
| 462 | | - |
| 463 | | - |
| 464 | | - |
| 465 | | - |
| 466 | | - |
| 467 | | - |
| 468 | | - |
| 469 | | - |
| 470 | | - |
| 471 | | - |
| 472 | | - |
| 473 | | - |
| 474 | | - |
| 475 | | - |
| 476 | if (BN_is_one(D)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 477 | if (!BN_add(tmp, X, Y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 478 | goto err; never executed: goto err; | 0 |
| 479 | } else { never executed: end of block | 0 |
| 480 | if (BN_is_word(D, 2)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 481 | if (!BN_lshift1(tmp, X))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 482 | goto err; never executed: goto err; | 0 |
| 483 | } else if (BN_is_word(D, 4)) { never executed: end of block | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 484 | if (!BN_lshift(tmp, X, 2))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 485 | goto err; never executed: goto err; | 0 |
| 486 | } else if (D->top == 1) { never executed: end of block | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 487 | if (!BN_copy(tmp, X))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 488 | goto err; never executed: goto err; | 0 |
| 489 | if (!BN_mul_word(tmp, D->d[0]))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 490 | goto err; never executed: goto err; | 0 |
| 491 | } else { never executed: end of block | 0 |
| 492 | if (!BN_mul(tmp, D,X, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 493 | goto err; never executed: goto err; | 0 |
| 494 | } never executed: end of block | 0 |
| 495 | if (!BN_add(tmp, tmp, Y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 496 | goto err; never executed: goto err; | 0 |
| 497 | } never executed: end of block | 0 |
| 498 | | - |
| 499 | M = Y; | - |
| 500 | Y = X; | - |
| 501 | X = tmp; | - |
| 502 | sign = -sign; | - |
| 503 | } never executed: end of block | 0 |
| 504 | } never executed: end of block | 0 |
| 505 | | - |
| 506 | | - |
| 507 | | - |
| 508 | | - |
| 509 | | - |
| 510 | | - |
| 511 | | - |
| 512 | | - |
| 513 | | - |
| 514 | if (sign < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 515 | if (!BN_sub(Y, n, Y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 516 | goto err; never executed: goto err; | 0 |
| 517 | } never executed: end of block | 0 |
| 518 | | - |
| 519 | | - |
| 520 | if (BN_is_one(A)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 521 | | - |
| 522 | if (!Y->neg && BN_ucmp(Y, n) < 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 523 | if (!BN_copy(R, Y))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 524 | goto err; never executed: goto err; | 0 |
| 525 | } else { never executed: end of block | 0 |
| 526 | if (!BN_nnmod(R, Y,n, ctx))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 527 | goto err; never executed: goto err; | 0 |
| 528 | } never executed: end of block | 0 |
| 529 | } else { | - |
| 530 | BNerror(BN_R_NO_INVERSE); | - |
| 531 | goto err; never executed: goto err; | 0 |
| 532 | } | - |
| 533 | ret = R; | - |
| 534 | | - |
| 535 | err: code before this statement never executed: err: | 0 |
| 536 | if ((ret == NULL) && (in == NULL))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 537 | BN_free(R); never executed: BN_free(R); | 0 |
| 538 | BN_CTX_end(ctx); | - |
| 539 | bn_check_top(ret); | - |
| 540 | return (ret); never executed: return (ret); | 0 |
| 541 | } | - |
| 542 | | - |
| 543 | BIGNUM * | - |
| 544 | BN_mod_inverse(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) | - |
| 545 | { | - |
| 546 | int ct = ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) ||| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 547 | (BN_get_flags(n, BN_FLG_CONSTTIME) != 0));| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 548 | return BN_mod_inverse_internal(in, a, n, ctx, ct); never executed: return BN_mod_inverse_internal(in, a, n, ctx, ct); | 0 |
| 549 | } | - |
| 550 | | - |
| 551 | BIGNUM * | - |
| 552 | BN_mod_inverse_nonct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) | - |
| 553 | { | - |
| 554 | return BN_mod_inverse_internal(in, a, n, ctx, 0); never executed: return BN_mod_inverse_internal(in, a, n, ctx, 0); | 0 |
| 555 | } | - |
| 556 | | - |
| 557 | BIGNUM * | - |
| 558 | BN_mod_inverse_ct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) | - |
| 559 | { | - |
| 560 | return BN_mod_inverse_internal(in, a, n, ctx, 1);executed 4086 times by 14 tests: return BN_mod_inverse_internal(in, a, n, ctx, 1);Executed by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 4086 |
| 561 | } | - |
| 562 | | - |
| 563 | | - |
| 564 | | - |
| 565 | | - |
| 566 | static BIGNUM * | - |
| 567 | BN_mod_inverse_no_branch(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, | - |
| 568 | BN_CTX *ctx) | - |
| 569 | { | - |
| 570 | BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL; | - |
| 571 | BIGNUM local_A, local_B; | - |
| 572 | BIGNUM *pA, *pB; | - |
| 573 | BIGNUM *ret = NULL; | - |
| 574 | int sign; | - |
| 575 | | - |
| 576 | bn_check_top(a); | - |
| 577 | bn_check_top(n); | - |
| 578 | | - |
| 579 | BN_CTX_start(ctx); | - |
| 580 | if ((A = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 581 | goto err; never executed: goto err; | 0 |
| 582 | if ((B = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 583 | goto err; never executed: goto err; | 0 |
| 584 | if ((X = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 585 | goto err; never executed: goto err; | 0 |
| 586 | if ((D = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 587 | goto err; never executed: goto err; | 0 |
| 588 | if ((M = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 589 | goto err; never executed: goto err; | 0 |
| 590 | if ((Y = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 591 | goto err; never executed: goto err; | 0 |
| 592 | if ((T = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 593 | goto err; never executed: goto err; | 0 |
| 594 | | - |
| 595 | if (in == NULL)| TRUE | evaluated 2 times by 2 testsEvaluated by:- dsatest
- libcrypto.so.44.0.1
| | FALSE | evaluated 4084 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 2-4084 |
| 596 | R = BN_new();executed 2 times by 2 tests: R = BN_new();Executed by:- dsatest
- libcrypto.so.44.0.1
| 2 |
| 597 | else | - |
| 598 | R = in;executed 4084 times by 14 tests: R = in;Executed by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 4084 |
| 599 | if (R == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 600 | goto err; never executed: goto err; | 0 |
| 601 | | - |
| 602 | BN_one(X); | - |
| 603 | BN_zero(Y); | - |
| 604 | if (BN_copy(B, a) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 605 | goto err; never executed: goto err; | 0 |
| 606 | if (BN_copy(A, n) == NULL)| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 607 | goto err; never executed: goto err; | 0 |
| 608 | A->neg = 0; | - |
| 609 | | - |
| 610 | if (B->neg || (BN_ucmp(B, A) >= 0)) {| TRUE | never evaluated | | FALSE | evaluated 4086 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| TRUE | evaluated 2959 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | evaluated 1127 times by 10 testsEvaluated by:- dsatest
- ecdhtest
- ecdsatest
- ectest
- libcrypto.so.44.0.1
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4086 |
| 611 | | - |
| 612 | | - |
| 613 | | - |
| 614 | pB = &local_B; | - |
| 615 | BN_with_flags(pB, B, BN_FLG_CONSTTIME); | - |
| 616 | if (!BN_nnmod(B, pB, A, ctx))| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 2958 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 1-2958 |
| 617 | goto err;executed 1 time by 1 test: goto err; | 1 |
| 618 | }executed 2958 times by 14 tests: end of blockExecuted by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 2958 |
| 619 | sign = -1; | - |
| 620 | | - |
| 621 | | - |
| 622 | | - |
| 623 | | - |
| 624 | | - |
| 625 | | - |
| 626 | | - |
| 627 | while (!BN_is_zero(B)) {| TRUE | evaluated 334754 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | evaluated 4085 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 4085-334754 |
| 628 | BIGNUM *tmp; | - |
| 629 | | - |
| 630 | | - |
| 631 | | - |
| 632 | | - |
| 633 | | - |
| 634 | | - |
| 635 | | - |
| 636 | | - |
| 637 | | - |
| 638 | | - |
| 639 | pA = &local_A; | - |
| 640 | BN_with_flags(pA, A, BN_FLG_CONSTTIME); | - |
| 641 | | - |
| 642 | | - |
| 643 | if (!BN_div_ct(D, M, pA, B, ctx))| TRUE | never evaluated | | FALSE | evaluated 334754 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-334754 |
| 644 | goto err; never executed: goto err; | 0 |
| 645 | | - |
| 646 | | - |
| 647 | | - |
| 648 | | - |
| 649 | | - |
| 650 | | - |
| 651 | tmp = A; | - |
| 652 | | - |
| 653 | | - |
| 654 | A = B; | - |
| 655 | B = M; | - |
| 656 | | - |
| 657 | | - |
| 658 | | - |
| 659 | | - |
| 660 | | - |
| 661 | | - |
| 662 | | - |
| 663 | | - |
| 664 | | - |
| 665 | | - |
| 666 | | - |
| 667 | | - |
| 668 | | - |
| 669 | | - |
| 670 | | - |
| 671 | | - |
| 672 | | - |
| 673 | | - |
| 674 | | - |
| 675 | | - |
| 676 | | - |
| 677 | if (!BN_mul(tmp, D, X, ctx))| TRUE | never evaluated | | FALSE | evaluated 334754 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-334754 |
| 678 | goto err; never executed: goto err; | 0 |
| 679 | if (!BN_add(tmp, tmp, Y))| TRUE | never evaluated | | FALSE | evaluated 334754 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-334754 |
| 680 | goto err; never executed: goto err; | 0 |
| 681 | | - |
| 682 | M = Y; | - |
| 683 | Y = X; | - |
| 684 | X = tmp; | - |
| 685 | sign = -sign; | - |
| 686 | }executed 334754 times by 14 tests: end of blockExecuted by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 334754 |
| 687 | | - |
| 688 | | - |
| 689 | | - |
| 690 | | - |
| 691 | | - |
| 692 | | - |
| 693 | | - |
| 694 | | - |
| 695 | | - |
| 696 | if (sign < 0) {| TRUE | evaluated 1935 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | evaluated 2150 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 1935-2150 |
| 697 | if (!BN_sub(Y, n, Y))| TRUE | never evaluated | | FALSE | evaluated 1935 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-1935 |
| 698 | goto err; never executed: goto err; | 0 |
| 699 | }executed 1935 times by 14 tests: end of blockExecuted by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 1935 |
| 700 | | - |
| 701 | | - |
| 702 | if (BN_is_one(A)) {| TRUE | evaluated 4085 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | never evaluated |
| TRUE | evaluated 4084 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | evaluated 1 time by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 4084 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | never evaluated |
| 0-4085 |
| 703 | | - |
| 704 | if (!Y->neg && BN_ucmp(Y, n) < 0) {| TRUE | evaluated 4084 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | never evaluated |
| TRUE | evaluated 4072 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| | FALSE | evaluated 12 times by 3 tests |
| 0-4084 |
| 705 | if (!BN_copy(R, Y))| TRUE | never evaluated | | FALSE | evaluated 4072 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| 0-4072 |
| 706 | goto err; never executed: goto err; | 0 |
| 707 | } else {executed 4072 times by 14 tests: end of blockExecuted by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 4072 |
| 708 | if (!BN_nnmod(R, Y, n, ctx))| TRUE | never evaluated | | FALSE | evaluated 12 times by 3 tests |
| 0-12 |
| 709 | goto err; never executed: goto err; | 0 |
| 710 | }executed 12 times by 3 tests: end of block | 12 |
| 711 | } else { | - |
| 712 | BNerror(BN_R_NO_INVERSE); | - |
| 713 | goto err;executed 1 time by 1 test: goto err; | 1 |
| 714 | } | - |
| 715 | ret = R; | - |
| 716 | | - |
| 717 | err:code before this statement executed 4084 times by 14 tests: err:Executed by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 4084 |
| 718 | if ((ret == NULL) && (in == NULL))| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 4084 times by 14 testsEvaluated by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
|
| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-4084 |
| 719 | BN_free(R); never executed: BN_free(R); | 0 |
| 720 | BN_CTX_end(ctx); | - |
| 721 | bn_check_top(ret); | - |
| 722 | return (ret);executed 4086 times by 14 tests: return (ret);Executed by:- bntest
- dhtest
- dsatest
- ecdhtest
- ecdsatest
- ectest
- exptest
- libcrypto.so.44.0.1
- mont
- pkcs7test
- rsa_test
- servertest
- ssltest
- tlstest
| 4086 |
| 723 | } | - |
| 724 | | - |
| 725 | | - |
| 726 | | - |
| 727 | | - |
| 728 | | - |
| 729 | static BIGNUM * | - |
| 730 | BN_gcd_no_branch(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, | - |
| 731 | BN_CTX *ctx) | - |
| 732 | { | - |
| 733 | BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL; | - |
| 734 | BIGNUM local_A, local_B; | - |
| 735 | BIGNUM *pA, *pB; | - |
| 736 | BIGNUM *ret = NULL; | - |
| 737 | int sign; | - |
| 738 | | - |
| 739 | if (in == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 740 | goto err; never executed: goto err; | 0 |
| 741 | R = in; | - |
| 742 | | - |
| 743 | bn_check_top(a); | - |
| 744 | bn_check_top(n); | - |
| 745 | | - |
| 746 | BN_CTX_start(ctx); | - |
| 747 | if ((A = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 748 | goto err; never executed: goto err; | 0 |
| 749 | if ((B = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 750 | goto err; never executed: goto err; | 0 |
| 751 | if ((X = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 752 | goto err; never executed: goto err; | 0 |
| 753 | if ((D = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 754 | goto err; never executed: goto err; | 0 |
| 755 | if ((M = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 756 | goto err; never executed: goto err; | 0 |
| 757 | if ((Y = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 758 | goto err; never executed: goto err; | 0 |
| 759 | if ((T = BN_CTX_get(ctx)) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 760 | goto err; never executed: goto err; | 0 |
| 761 | | - |
| 762 | BN_one(X); | - |
| 763 | BN_zero(Y); | - |
| 764 | if (BN_copy(B, a) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 765 | goto err; never executed: goto err; | 0 |
| 766 | if (BN_copy(A, n) == NULL)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 767 | goto err; never executed: goto err; | 0 |
| 768 | A->neg = 0; | - |
| 769 | | - |
| 770 | if (B->neg || (BN_ucmp(B, A) >= 0)) {| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 771 | | - |
| 772 | | - |
| 773 | | - |
| 774 | pB = &local_B; | - |
| 775 | BN_with_flags(pB, B, BN_FLG_CONSTTIME); | - |
| 776 | if (!BN_nnmod(B, pB, A, ctx))| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 777 | goto err; never executed: goto err; | 0 |
| 778 | }executed 2 times by 1 test: end of block | 2 |
| 779 | sign = -1; | - |
| 780 | | - |
| 781 | | - |
| 782 | | - |
| 783 | | - |
| 784 | | - |
| 785 | | - |
| 786 | | - |
| 787 | while (!BN_is_zero(B)) {| TRUE | evaluated 19 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-19 |
| 788 | BIGNUM *tmp; | - |
| 789 | | - |
| 790 | | - |
| 791 | | - |
| 792 | | - |
| 793 | | - |
| 794 | | - |
| 795 | | - |
| 796 | | - |
| 797 | | - |
| 798 | | - |
| 799 | pA = &local_A; | - |
| 800 | BN_with_flags(pA, A, BN_FLG_CONSTTIME); | - |
| 801 | | - |
| 802 | | - |
| 803 | if (!BN_div_ct(D, M, pA, B, ctx))| TRUE | never evaluated | | FALSE | evaluated 19 times by 1 test |
| 0-19 |
| 804 | goto err; never executed: goto err; | 0 |
| 805 | | - |
| 806 | | - |
| 807 | | - |
| 808 | | - |
| 809 | | - |
| 810 | | - |
| 811 | tmp = A; | - |
| 812 | | - |
| 813 | | - |
| 814 | A = B; | - |
| 815 | B = M; | - |
| 816 | | - |
| 817 | | - |
| 818 | | - |
| 819 | | - |
| 820 | | - |
| 821 | | - |
| 822 | | - |
| 823 | | - |
| 824 | | - |
| 825 | | - |
| 826 | | - |
| 827 | | - |
| 828 | | - |
| 829 | | - |
| 830 | | - |
| 831 | | - |
| 832 | | - |
| 833 | | - |
| 834 | | - |
| 835 | | - |
| 836 | | - |
| 837 | if (!BN_mul(tmp, D, X, ctx))| TRUE | never evaluated | | FALSE | evaluated 19 times by 1 test |
| 0-19 |
| 838 | goto err; never executed: goto err; | 0 |
| 839 | if (!BN_add(tmp, tmp, Y))| TRUE | never evaluated | | FALSE | evaluated 19 times by 1 test |
| 0-19 |
| 840 | goto err; never executed: goto err; | 0 |
| 841 | | - |
| 842 | M = Y; | - |
| 843 | Y = X; | - |
| 844 | X = tmp; | - |
| 845 | sign = -sign; | - |
| 846 | }executed 19 times by 1 test: end of block | 19 |
| 847 | | - |
| 848 | | - |
| 849 | | - |
| 850 | | - |
| 851 | | - |
| 852 | | - |
| 853 | if (!BN_copy(R, A))| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 854 | goto err; never executed: goto err; | 0 |
| 855 | ret = R; | - |
| 856 | err:code before this statement executed 2 times by 1 test: err: | 2 |
| 857 | if ((ret == NULL) && (in == NULL))| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-2 |
| 858 | BN_free(R); never executed: BN_free(R); | 0 |
| 859 | BN_CTX_end(ctx); | - |
| 860 | bn_check_top(ret); | - |
| 861 | return (ret);executed 2 times by 1 test: return (ret); | 2 |
| 862 | } | - |
| | |