| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/bn/bn_gf2m.c | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | static const unsigned long SQR_tb[16] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | { 0, 1, 4, 5, 16, 17, 20, 21, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 64, 65, 68, 69, 80, 81, 84, 85 }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | void bn_GF2m_mul_2x2(unsigned long *r, unsigned long a1, unsigned long a0, unsigned long b1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | unsigned long b0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | const BIGNUM *at, *bt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | if (a->top < b->top 
 | 15536-1490360 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | at = b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | bt = a; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } executed 15536 times by 3 tests: else { end of blockExecuted by: 
 | 15536 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | at = a; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | bt = b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } executed 1490360 times by 4 tests:  end of blockExecuted by: 
 | 1490360 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | if (((( 
 
 
 
 
 
 | 0-1505896 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | ((void *)0) 
 | 0-1505896 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | return never executed: 0; return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | for (i = 0; i < bt->top 
 | 1505896-7327801 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | r->d[i] = at->d[i] ^ bt->d[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } executed 7327801 times by 4 tests:  end of blockExecuted by: 
 | 7327801 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | for (; i < at->top 
 | 759005-1505896 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | r->d[i] = at->d[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } executed 759005 times by 4 tests:  end of blockExecuted by: 
 | 759005 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | r->top = at->top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | { unsigned long *ftl; int tmp_top = (r)->top; if (tmp_top > 0 
 
 
 
 executed 1504771 times by 4 tests: (r)->top = tmp_top; } break;Executed by: 
 executed 1505895 times by 4 tests: ; }; end of blockExecuted by: 
 | 1-1524551 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | return executed 1505896 times by 4 tests: 1; return 1;Executed by: 
 executed 1505896 times by 4 tests:  return 1;Executed by: 
 | 1505896 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | int j, k; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | int n, dN, d0, d1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | unsigned long zz, *z; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | if (!p[0] 
 | 0-1399087 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | (BN_set_word((r),0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | return never executed: 1; return 1;never executed:  return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | if (a != r 
 | 0-1399087 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | if (!((( 
 
 
 | 0-1399087 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | return never executed: 0; return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | for (j = 0; j < a->top 
 | 1399087-12036018 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | r->d[j] = a->d[j]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } executed 12036018 times by 4 tests:  end of blockExecuted by: 
 | 12036018 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | r->top = a->top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } executed 1399087 times by 4 tests:  end of blockExecuted by: 
 | 1399087 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | z = r->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | dN = p[0] / 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | for (j = r->top - 1; j > dN 
 | 1399087-11012238 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | zz = z[j]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | if (z[j] == 0 
 | 5506067-5506171 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | j--; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | continue; executed 5506171 times by 4 tests:  continue;Executed by: 
 | 5506171 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | z[j] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | for (k = 1; p[k] != 0 
 | 5506067-11527291 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | n = p[0] - p[k]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | d0 = n % 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | d1 = 64 - d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | n /= 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | z[j - n] ^= (zz >> d0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | if (d0 
 | 3004-11524287 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | z[j - n - 1] ^= (zz << d1); executed 11524287 times by 4 tests:  z[j - n - 1] ^= (zz << d1);Executed by: 
 | 11524287 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } executed 11527291 times by 4 tests:  end of blockExecuted by: 
 | 11527291 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | n = dN; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | d0 = p[0] % 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | d1 = 64 - d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | z[j - n] ^= (zz >> d0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | if (d0 
 | 0-5506067 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | z[j - n - 1] ^= (zz << d1); executed 5506067 times by 4 tests:  z[j - n - 1] ^= (zz << d1);Executed by: 
 | 5506067 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } executed 5506067 times by 4 tests:  end of blockExecuted by: 
 | 5506067 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | while (j == dN 
 | 4096-2552988 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | d0 = p[0] % 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | zz = z[dN] >> d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | if (zz == 0 
 | 1157997-1394991 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | break; executed 1394991 times by 4 tests:  break;Executed by: 
 | 1394991 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | d1 = 64 - d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | if (d0 
 | 0-1157997 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | z[dN] = (z[dN] << d1) >> d1; executed 1157997 times by 4 tests:  z[dN] = (z[dN] << d1) >> d1;Executed by: 
 | 1157997 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | z[dN] = 0; never executed:  z[dN] = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | z[0] ^= zz; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | for (k = 1; p[k] != 0 
 | 1157997-2348515 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | unsigned long tmp_ulong; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | n = p[k] / 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | d0 = p[k] % 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | d1 = 64 - d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | z[n] ^= (zz << d0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | if (d0 
 
 
 | 0-2348515 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | z[n + 1] ^= tmp_ulong; executed 345056 times by 3 tests:  z[n + 1] ^= tmp_ulong;Executed by: 
 | 345056 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } executed 2348515 times by 4 tests:  end of blockExecuted by: 
 | 2348515 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } executed 1157997 times by 4 tests:  end of blockExecuted by: 
 | 1157997 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | { unsigned long *ftl; int tmp_top = (r)->top; if (tmp_top > 0 
 
 
 
 executed 1398849 times by 4 tests: (r)->top = tmp_top; } break;Executed by: 
 executed 1399049 times by 4 tests: ; }; end of blockExecuted by: 
 | 38-7054109 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | return executed 1399087 times by 4 tests: 1; return 1;Executed by: 
 executed 1399087 times by 4 tests:  return 1;Executed by: 
 | 1399087 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | int arr[6]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | ret = BN_GF2m_poly2arr(p, arr, sizeof(arr) / sizeof(arr[0])); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | if (!ret 
 
 | 0-216185 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | ERR_put_error(3,(0xfff),(106),__FILE__,473); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | return never executed: 0; return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | ret = BN_GF2m_mod_arr(r, a, arr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | return executed 216185 times by 4 tests: ret; return ret;Executed by: 
 executed 216185 times by 4 tests:  return ret;Executed by: 
 | 216185 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const int p[], | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | int zlen, i, j, k, ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | BIGNUM *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | unsigned long x1, x0, y1, y0, zz[4]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | if (a == b 
 | 0-588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | return never executed: BN_GF2m_mod_sqr_arr(r, a, p, ctx); return BN_GF2m_mod_sqr_arr(r, a, p, ctx);never executed:  return BN_GF2m_mod_sqr_arr(r, a, p, ctx); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | if (( 
 
 | 0-588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | ((void *)0) 
 | 0-588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | zlen = a->top + b->top + 4; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | if (!((( 
 
 
 | 0-588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | s->top = zlen; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | for (i = 0; i < zlen 
 | 588270-8778821 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | s->d[i] = 0; executed 8778821 times by 4 tests:  s->d[i] = 0;Executed by: 
 | 8778821 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | for (j = 0; j < b->top 
 | 588270-1942306 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | y0 = b->d[j]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | y1 = (( 
 
 | 300993-1641313 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | for (i = 0; i < a->top 
 | 1942306-5859259 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | x0 = a->d[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | x1 = (( 
 
 | 1493217-4366042 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | bn_GF2m_mul_2x2(zz, x1, x0, y1, y0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | for (k = 0; k < 4 
 | 5859259-23437036 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | s->d[i + j + k] ^= zz[k]; executed 23437036 times by 4 tests:  s->d[i + j + k] ^= zz[k];Executed by: 
 | 23437036 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | } executed 5859259 times by 4 tests:  end of blockExecuted by: 
 | 5859259 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } executed 1942306 times by 4 tests:  end of blockExecuted by: 
 | 1942306 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | { unsigned long *ftl; int tmp_top = (s)->top; if (tmp_top > 0 
 
 
 
 executed 588268 times by 4 tests: (s)->top = tmp_top; } break;Executed by: 
 executed 588270 times by 4 tests: ; }; end of blockExecuted by: 
 | 0-3109008 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | if (BN_GF2m_mod_arr(r, s, p) 
 | 0-588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | ret = 1; executed 588270 times by 4 tests:  ret = 1;Executed by: 
 | 588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | err: code before this statement executed 588270 times by 4 tests:  err:Executed by: 
 | 588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | return executed 588270 times by 4 tests: ret; return ret;Executed by: 
 executed 588270 times by 4 tests:  return ret;Executed by: 
 | 588270 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | const int max = BN_num_bits(p) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | int *arr = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | if (( 
 
 | 0-216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | ((void *)0) 
 | 0-216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | , max, sizeof(int))) == 
 | 0-216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | ((void *)0) 
 | 0-216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | ret = BN_GF2m_poly2arr(p, arr, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | if (!ret 
 
 | 0-216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | ERR_put_error(3,(0xfff),(106),__FILE__,556); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | err: code before this statement executed 216677 times by 4 tests:  err:Executed by: 
 | 216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | free(arr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | return executed 216677 times by 4 tests: ret; return ret;Executed by: 
 executed 216677 times by 4 tests:  return ret;Executed by: 
 | 216677 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | int i, ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | BIGNUM *s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | if (( 
 
 | 0-593294 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | ((void *)0) 
 | 0-593294 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | if (!((( 
 
 
 | 0-593294 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | for (i = a->top - 1; i >= 0 
 | 593294-2390855 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | s->d[2 * i + 1] = SQR_tb[(a->d[i]) >> 60 & 0xF] << 56 | SQR_tb[(a->d[i]) >> 56 & 0xF] << 48 | SQR_tb[(a->d[i]) >> 52 & 0xF] << 40 | SQR_tb[(a->d[i]) >> 48 & 0xF] << 32 | SQR_tb[(a->d[i]) >> 44 & 0xF] << 24 | SQR_tb[(a->d[i]) >> 40 & 0xF] << 16 | SQR_tb[(a->d[i]) >> 36 & 0xF] << 8 | SQR_tb[(a->d[i]) >> 32 & 0xF]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | s->d[2 * i] = SQR_tb[(a->d[i]) >> 28 & 0xF] << 56 | SQR_tb[(a->d[i]) >> 24 & 0xF] << 48 | SQR_tb[(a->d[i]) >> 20 & 0xF] << 40 | SQR_tb[(a->d[i]) >> 16 & 0xF] << 32 | SQR_tb[(a->d[i]) >> 12 & 0xF] << 24 | SQR_tb[(a->d[i]) >> 8 & 0xF] << 16 | SQR_tb[(a->d[i]) >> 4 & 0xF] << 8 | SQR_tb[(a->d[i]) & 0xF]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | } executed 2390855 times by 4 tests:  end of blockExecuted by: 
 | 2390855 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | s->top = 2 * a->top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | { unsigned long *ftl; int tmp_top = (s)->top; if (tmp_top > 0 
 
 
 
 executed 593294 times by 4 tests: (s)->top = tmp_top; } break;Executed by: 
 executed 593294 times by 4 tests: ; }; end of blockExecuted by: 
 | 0-775348 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | if (!BN_GF2m_mod_arr(r, s, p) 
 | 0-593294 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | err: code before this statement executed 593294 times by 4 tests:  err:Executed by: 
 | 593294 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | return executed 593294 times by 4 tests: ret; return ret;Executed by: 
 executed 593294 times by 4 tests:  return ret;Executed by: 
 | 593294 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | const int max = BN_num_bits(p) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | int *arr = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | if (( 
 
 | 0-508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | ((void *)0) 
 | 0-508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | , max, sizeof(int))) == 
 | 0-508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | ((void *)0) 
 | 0-508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | ret = BN_GF2m_poly2arr(p, arr, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | if (!ret 
 
 | 0-508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | ERR_put_error(3,(0xfff),(106),__FILE__,618); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | err: code before this statement executed 508 times by 1 test:  err:Executed by: 
 | 508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | free(arr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | return executed 508 times by 1 test: ret; return ret;Executed by: 
 executed 508 times by 1 test:  return ret;Executed by: 
 | 508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | BIGNUM *b, *c = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | , *u = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | , *v = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | , *tmp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | if (( 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | ((void *)0) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | if (( 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | ((void *)0) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | if (( 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | ((void *)0) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | if (( 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | ((void *)0) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | if (!BN_GF2m_mod(u, a, p) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | if ((( 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | if (!BN_copy(v, p) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | int i, ubits = BN_num_bits(u), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | vbits = BN_num_bits(v), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | top = p->top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | unsigned long *udp, *bdp, *vdp, *cdp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | if (!((( 
 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | udp = u->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | for (i = u->top; i < top 
 | 4046-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | udp[i] = 0; executed 4046 times by 3 tests:  udp[i] = 0;Executed by: 
 | 4046 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | u->top = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | if (!((( 
 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | bdp = b->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | bdp[0] = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | for (i = 1; i < top 
 | 215477-947175 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | bdp[i] = 0; executed 947175 times by 4 tests:  bdp[i] = 0;Executed by: 
 | 947175 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | b->top = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | if (!((( 
 
 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | cdp = c->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | for (i = 0; i < top 
 | 215477-1162652 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | cdp[i] = 0; executed 1162652 times by 4 tests:  cdp[i] = 0;Executed by: 
 | 1162652 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | c->top = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | vdp = v->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | while (1) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | while (ubits 
 
 | 0-171940353 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | unsigned long u0, u1, b0, b1, mask; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | u0 = udp[0]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | b0 = bdp[0]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | mask = (unsigned long)0 - (b0 & 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | b0 ^= p->d[0] & mask; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | for (i = 0; i < top - 1 
 | 114536659-609490484 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | u1 = udp[i + 1]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | udp[i] = ((u0 >> 1) | | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | (u1 << (64 - 1))) & (0xffffffffffffffffL); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | u0 = u1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | b1 = bdp[i + 1] ^ (p->d[i + 1] & mask); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | bdp[i] = ((b0 >> 1) | | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | (b1 << (64 - 1))) & (0xffffffffffffffffL); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | b0 = b1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | } executed 609490484 times by 4 tests:  end of blockExecuted by: 
 | 609490484 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | udp[i] = u0 >> 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | bdp[i] = b0 >> 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | ubits--; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | } executed 114536659 times by 4 tests:  end of blockExecuted by: 
 | 114536659 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | if (ubits <= 64 
 | 11250304-46153390 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | if (udp[0] == 0 
 | 0-11250304 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | if (udp[0] == 1 
 | 215477-11034827 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | break; executed 215477 times by 4 tests:  break;Executed by: 
 | 215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | } executed 11034827 times by 4 tests:  end of blockExecuted by: 
 | 11034827 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | if (ubits < vbits 
 | 22942687-34245530 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | i = ubits; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | ubits = vbits; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | vbits = i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | tmp = u; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | u = v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | v = tmp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | tmp = b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | b = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | c = tmp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | udp = vdp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | vdp = v->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | bdp = cdp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | cdp = c->d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | } executed 22942687 times by 4 tests:  end of blockExecuted by: 
 | 22942687 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | for (i = 0; i < top 
 | 57188217-361584547 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | udp[i] ^= vdp[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | bdp[i] ^= cdp[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | } executed 361584547 times by 4 tests:  end of blockExecuted by: 
 | 361584547 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | if (ubits == vbits 
 | 11435608-45752609 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | unsigned long ul; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | int utop = (ubits - 1) / 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | while (( 
 
 
 | 0-11435608 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | utop--; executed 313545 times by 4 tests:  utop--;Executed by: 
 | 313545 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | ubits = utop*64 + BN_num_bits_word(ul); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | } executed 11435608 times by 4 tests:  end of blockExecuted by: 
 | 11435608 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | } executed 57188217 times by 4 tests:  end of blockExecuted by: 
 | 57188217 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | { unsigned long *ftl; int tmp_top = (b)->top; if (tmp_top > 0 
 
 
 
 executed 215477 times by 4 tests: (b)->top = tmp_top; } break;Executed by: 
 executed 215477 times by 4 tests: ; }; end of blockExecuted by: 
 | 0-219393 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | if (!BN_copy(r, b) 
 | 0-215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | err: code before this statement executed 215477 times by 4 tests:  err:Executed by: 
 | 215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | return executed 215477 times by 4 tests: ret; return ret;Executed by: 
 executed 215477 times by 4 tests:  return ret;Executed by: 
 | 215477 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *xx, const int p[], BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | BIGNUM *field; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | if (( 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | ((void *)0) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | if (!BN_GF2m_arr2poly(p, field) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | ret = BN_GF2m_mod_inv(r, xx, field, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | err: code before this statement never executed:  err: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | return never executed: ret; return ret;never executed:  return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x, const BIGNUM *p, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | BIGNUM *xinv = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | if (( 
 
 | 0-215277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | ((void *)0) 
 | 0-215277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | if (!BN_GF2m_mod_inv(xinv, x, p, ctx) 
 | 0-215277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx) 
 | 0-215277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | err: code before this statement executed 215277 times by 4 tests:  err:Executed by: 
 | 215277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | return executed 215277 times by 4 tests: ret; return ret;Executed by: 
 executed 215277 times by 4 tests:  return ret;Executed by: 
 | 215277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *yy, const BIGNUM *xx, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | const int p[], BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | BIGNUM *field; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | if (( 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | ((void *)0) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | if (!BN_GF2m_arr2poly(p, field) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | ret = BN_GF2m_mod_div(r, yy, xx, field, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | err: code before this statement never executed:  err: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | return never executed: ret; return ret;never executed:  return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const int p[], | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | int ret = 0, i, n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | BIGNUM *u; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | if ((( 
 
 | 0-800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | return never executed: ((BN_set_word((r),1))); return ((BN_set_word((r),1)));never executed:  return ((BN_set_word((r),1))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | if ((((( 
 
 
 
 
 
 
 
 | 0-800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | return never executed: (BN_copy(r, a) != return (BN_copy(r, a) != ((void *)0) );never executed:  return (BN_copy(r, a) != ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | ((void *)0) never executed:  return (BN_copy(r, a) != ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | ); never executed:  return (BN_copy(r, a) != ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | if (( 
 
 | 0-800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | ((void *)0) 
 | 0-800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | if (!BN_GF2m_mod_arr(u, a, p) 
 | 0-800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | n = BN_num_bits(b) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | for (i = n - 1; i >= 0 
 | 800-342200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx) 
 | 0-342200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | if (BN_is_bit_set(b, i) 
 | 156498-185702 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx) 
 | 0-156498 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | } executed 156498 times by 1 test:  end of blockExecuted by: 
 | 156498 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | } executed 342200 times by 1 test:  end of blockExecuted by: 
 | 342200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | if (!BN_copy(r, u) 
 | 0-800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | err: code before this statement executed 800 times by 1 test:  err:Executed by: 
 | 800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | return executed 800 times by 1 test: ret; return ret;Executed by: 
 executed 800 times by 1 test:  return ret;Executed by: 
 | 800 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | const int max = BN_num_bits(p) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | int *arr = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | if (( 
 
 | 0-600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | ((void *)0) 
 | 0-600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | , max, sizeof(int))) == 
 | 0-600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | ((void *)0) 
 | 0-600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | ret = BN_GF2m_poly2arr(p, arr, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | if (!ret 
 
 | 0-600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | ERR_put_error(3,(0xfff),(106),__FILE__,1055); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | ret = BN_GF2m_mod_exp_arr(r, a, b, arr, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | err: code before this statement executed 600 times by 1 test:  err:Executed by: 
 | 600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | free(arr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | return executed 600 times by 1 test: ret; return ret;Executed by: 
 executed 600 times by 1 test:  return ret;Executed by: 
 | 600 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | BIGNUM *u; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | if (!p[0] 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | (BN_set_word((r),0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | return never executed: 1; return 1;never executed:  return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | if (( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | if (!BN_set_bit(u, p[0] - 1) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | err: code before this statement executed 200 times by 1 test:  err:Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | return executed 200 times by 1 test: ret; return ret;Executed by: 
 executed 200 times by 1 test:  return ret;Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | const int max = BN_num_bits(p) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | int *arr = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | if (( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | , max, sizeof(int))) == 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | ret = BN_GF2m_poly2arr(p, arr, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | if (!ret 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | ERR_put_error(3,(0xfff),(106),__FILE__,1117); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | ret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | err: code before this statement executed 200 times by 1 test:  err:Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | free(arr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | return executed 200 times by 1 test: ret; return ret;Executed by: 
 executed 200 times by 1 test:  return ret;Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[], | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | int ret = 0, count = 0, j; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | BIGNUM *a, *z, *rho, *w, *w2, *tmp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | if (!p[0] 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | (BN_set_word((r),0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | return never executed: 1; return 1;never executed:  return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | if (( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | if (( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | if (( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | if (!BN_GF2m_mod_arr(a, a_, p) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | if ((( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | (BN_set_word((r),0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | if (p[0] & 0x1 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | if (!BN_copy(z, a) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | for (j = 1; j <= (p[0] - 1) / 2 
 | 200-17700 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx) 
 | 0-17700 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx) 
 | 0-17700 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | if (!BN_GF2m_add(z, z, a) 
 | 0-17700 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | } executed 17700 times by 1 test:  end of blockExecuted by: 
 | 17700 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | } executed 200 times by 1 test:  end of blockExecuted by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | if (( 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | ((void *)0) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | if (( 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | ((void *)0) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | if (( 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | ((void *)0) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | if (!BN_rand(rho, p[0], 0, 0) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | if (!BN_GF2m_mod_arr(rho, rho, p) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | (BN_set_word((z),0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | if (!BN_copy(w, rho) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | for (j = 1; j <= p[0] - 1 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | if (!BN_GF2m_mod_mul_arr(tmp, w2, a, p, ctx) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | if (!BN_GF2m_add(z, z, tmp) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | if (!BN_GF2m_add(w, w2, rho) 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | count++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | } never executed: while ((( end of block
 
 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | if ((( 
 
 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | ERR_put_error(3,(0xfff),(113),__FILE__,1209); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | if (!BN_GF2m_mod_sqr_arr(w, z, p, ctx) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | if (!BN_GF2m_add(w, z, w) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | if (BN_ucmp((w), (a)) 
 | 92-108 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | ERR_put_error(3,(0xfff),(116),__FILE__,1219); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | goto executed 92 times by 1 test: err; goto err;Executed by: 
 executed 92 times by 1 test:  goto err;Executed by: 
 | 92 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | if (!BN_copy(r, z) 
 | 0-108 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | err: code before this statement executed 108 times by 1 test:  err:Executed by: 
 | 108 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | return executed 200 times by 1 test: ret; return ret;Executed by: 
 executed 200 times by 1 test:  return ret;Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | const int max = BN_num_bits(p) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | int *arr = | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | if (( 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | , max, sizeof(int))) == 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | ((void *)0) 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | ret = BN_GF2m_poly2arr(p, arr, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | if (!ret 
 
 | 0-200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | ERR_put_error(3,(0xfff),(106),__FILE__,1253); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | goto never executed: err; goto err;never executed:  goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | err: code before this statement executed 200 times by 1 test:  err:Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | free(arr); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | return executed 200 times by 1 test: ret; return ret;Executed by: 
 executed 200 times by 1 test:  return ret;Executed by: 
 | 200 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | int i, j, k = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | unsigned long mask; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | if ((( 
 
 | 0-434518 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | return never executed: 0; return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | for (i = a->top - 1; i >= 0 
 | 434518-2337915 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | if (!a->d[i] 
 | 1032105-1305810 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | continue; executed 1305810 times by 4 tests:  continue;Executed by: 
 | 1305810 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | mask = (0x8000000000000000L); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | for (j = 64 - 1; j >= 0 
 | 1032105-66054720 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | if (a->d[i] & mask 
 | 1751340-64303380 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | if (k < max 
 | 0-1751340 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | p[k] = 64 * i + j; executed 1751340 times by 4 tests:  p[k] = 64 * i + j;Executed by: 
 | 1751340 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | k++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | } executed 1751340 times by 4 tests:  end of blockExecuted by: 
 | 1751340 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | mask >>= 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | } executed 66054720 times by 4 tests:  end of blockExecuted by: 
 | 66054720 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | } executed 1032105 times by 4 tests:  end of blockExecuted by: 
 | 1032105 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | if (k < max 
 | 0-434518 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | p[k] = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | k++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | } executed 434518 times by 4 tests:  end of blockExecuted by: 
 | 434518 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | return executed 434518 times by 4 tests: k; return k;Executed by: 
 executed 434518 times by 4 tests:  return k;Executed by: 
 | 434518 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | BN_GF2m_arr2poly(const int p[], BIGNUM *a) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | (BN_set_word((a),0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | for (i = 0; p[i] != -1 
 | 16-64 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | if (BN_set_bit(a, p[i]) == 0 
 | 0-64 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | return never executed: 0; return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | } executed 64 times by 1 test:  end of blockExecuted by: 
 | 64 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | return executed 16 times by 1 test: 1; return 1;Executed by: 
 executed 16 times by 1 test:  return 1;Executed by: 
 | 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |