| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/ec2_oct.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, | - | ||||||||||||||||||||||||
| 3 | EC_POINT *point, | - | ||||||||||||||||||||||||
| 4 | const BIGNUM *x_, int y_bit, | - | ||||||||||||||||||||||||
| 5 | BN_CTX *ctx) | - | ||||||||||||||||||||||||
| 6 | { | - | ||||||||||||||||||||||||
| 7 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||
| 8 | ((void *)0) | - | ||||||||||||||||||||||||
| 9 | ; | - | ||||||||||||||||||||||||
| 10 | BIGNUM *tmp, *x, *y, *z; | - | ||||||||||||||||||||||||
| 11 | int ret = 0, z0; | - | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | ERR_clear_error(); | - | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | if (ctx ==
| 0-6045 | ||||||||||||||||||||||||
| 17 | ((void *)0)
| 0-6045 | ||||||||||||||||||||||||
| 18 | ) { | - | ||||||||||||||||||||||||
| 19 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||
| 20 | if (ctx ==
| 0 | ||||||||||||||||||||||||
| 21 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 22 | ) | - | ||||||||||||||||||||||||
| 23 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 24 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | y_bit = (
| 291-5754 | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||
| 29 | tmp = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 30 | x = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 31 | y = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 32 | z = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 33 | if (z ==
| 0-6045 | ||||||||||||||||||||||||
| 34 | ((void *)0)
| 0-6045 | ||||||||||||||||||||||||
| 35 | ) | - | ||||||||||||||||||||||||
| 36 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||
| 38 | if (!BN_GF2m_mod_arr(x, x_, group->poly)
| 0-6045 | ||||||||||||||||||||||||
| 39 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 40 | if (BN_is_zero(x)
| 1111-4934 | ||||||||||||||||||||||||
| 41 | if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx)
| 0-1111 | ||||||||||||||||||||||||
| 42 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 43 | } executed 1111 times by 1 test: else {end of blockExecuted by:
| 1111 | ||||||||||||||||||||||||
| 44 | if (!group->meth->field_sqr(group, tmp, x, ctx)
| 0-4934 | ||||||||||||||||||||||||
| 45 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 46 | if (!group->meth->field_div(group, tmp, group->b, tmp, ctx)
| 0-4934 | ||||||||||||||||||||||||
| 47 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 48 | if (!BN_GF2m_add(tmp, group->a, tmp)
| 0-4934 | ||||||||||||||||||||||||
| 49 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 50 | if (!BN_GF2m_add(tmp, x, tmp)
| 0-4934 | ||||||||||||||||||||||||
| 51 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 52 | if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)
| 2314-2620 | ||||||||||||||||||||||||
| 53 | unsigned long err = ERR_peek_last_error(); | - | ||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||
| 55 | if ((
| 0-2314 | ||||||||||||||||||||||||
| 56 | && (
| 831-1483 | ||||||||||||||||||||||||
| 57 | ERR_clear_error(); | - | ||||||||||||||||||||||||
| 58 | ERR_put_error(16,(164),(110),__FILE__,82) | - | ||||||||||||||||||||||||
| 59 | ; | - | ||||||||||||||||||||||||
| 60 | } executed 1483 times by 1 test: elseend of blockExecuted by:
| 1483 | ||||||||||||||||||||||||
| 61 | ERR_put_error(16,(164),(3),__FILE__,85) executed 831 times by 1 test: ERR_put_error(16,(164),(3),__FILE__,85) ;Executed by:
| 831 | ||||||||||||||||||||||||
| 62 | ; executed 831 times by 1 test: ERR_put_error(16,(164),(3),__FILE__,85) ;Executed by:
| 831 | ||||||||||||||||||||||||
| 63 | goto executed 2314 times by 1 test: err;goto err;Executed by:
executed 2314 times by 1 test: goto err;Executed by:
| 2314 | ||||||||||||||||||||||||
| 64 | } | - | ||||||||||||||||||||||||
| 65 | z0 = (
| 109-2511 | ||||||||||||||||||||||||
| 66 | if (!group->meth->field_mul(group, y, x, z, ctx)
| 0-2620 | ||||||||||||||||||||||||
| 67 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 68 | if (z0 != y_bit
| 218-2402 | ||||||||||||||||||||||||
| 69 | if (!BN_GF2m_add(y, y, x)
| 0-2402 | ||||||||||||||||||||||||
| 70 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 71 | } executed 2402 times by 1 test: end of blockExecuted by:
| 2402 | ||||||||||||||||||||||||
| 72 | } executed 2620 times by 1 test: end of blockExecuted by:
| 2620 | ||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx)
| 0-3731 | ||||||||||||||||||||||||
| 75 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| 77 | ret = 1; | - | ||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||
| 79 | err: code before this statement executed 3731 times by 1 test: err:Executed by:
| 3731 | ||||||||||||||||||||||||
| 80 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||
| 81 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||
| 82 | return executed 6045 times by 1 test: ret;return ret;Executed by:
executed 6045 times by 1 test: return ret;Executed by:
| 6045 | ||||||||||||||||||||||||
| 83 | } | - | ||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | size_t ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, | - | ||||||||||||||||||||||||
| 91 | point_conversion_form_t form, | - | ||||||||||||||||||||||||
| 92 | unsigned char *buf, size_t len, BN_CTX *ctx) | - | ||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||
| 94 | size_t ret; | - | ||||||||||||||||||||||||
| 95 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||
| 96 | ((void *)0) | - | ||||||||||||||||||||||||
| 97 | ; | - | ||||||||||||||||||||||||
| 98 | int used_ctx = 0; | - | ||||||||||||||||||||||||
| 99 | BIGNUM *x, *y, *yxi; | - | ||||||||||||||||||||||||
| 100 | size_t field_len, i, skip; | - | ||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | if ((
| 32-169 | ||||||||||||||||||||||||
| 103 | && (
| 3-166 | ||||||||||||||||||||||||
| 104 | && (
| 1-2 | ||||||||||||||||||||||||
| 105 | ERR_put_error(16,(161),(104),__FILE__,126); | - | ||||||||||||||||||||||||
| 106 | goto executed 1 time by 1 test: err;goto err;Executed by:
executed 1 time by 1 test: goto err;Executed by:
| 1 | ||||||||||||||||||||||||
| 107 | } | - | ||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||
| 109 | if (EC_POINT_is_at_infinity(group, point)
| 14-186 | ||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||
| 111 | if (buf !=
| 7 | ||||||||||||||||||||||||
| 112 | ((void *)0)
| 7 | ||||||||||||||||||||||||
| 113 | ) { | - | ||||||||||||||||||||||||
| 114 | if (len < 1
| 0-7 | ||||||||||||||||||||||||
| 115 | ERR_put_error(16,(161),(100),__FILE__,134); | - | ||||||||||||||||||||||||
| 116 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 117 | } | - | ||||||||||||||||||||||||
| 118 | buf[0] = 0; | - | ||||||||||||||||||||||||
| 119 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 120 | return executed 14 times by 1 test: 1;return 1;Executed by:
executed 14 times by 1 test: return 1;Executed by:
| 14 | ||||||||||||||||||||||||
| 121 | } | - | ||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||
| 124 | field_len = (EC_GROUP_get_degree(group) + 7) / 8; | - | ||||||||||||||||||||||||
| 125 | ret = | - | ||||||||||||||||||||||||
| 126 | (
| 32-154 | ||||||||||||||||||||||||
| 127 | POINT_CONVERSION_COMPRESSED)
| 32-154 | ||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | if (buf !=
| 93 | ||||||||||||||||||||||||
| 131 | ((void *)0)
| 93 | ||||||||||||||||||||||||
| 132 | ) { | - | ||||||||||||||||||||||||
| 133 | if (len < ret
| 0-93 | ||||||||||||||||||||||||
| 134 | ERR_put_error(16,(161),(100),__FILE__,151); | - | ||||||||||||||||||||||||
| 135 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 136 | } | - | ||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | if (ctx ==
| 1-92 | ||||||||||||||||||||||||
| 139 | ((void *)0)
| 1-92 | ||||||||||||||||||||||||
| 140 | ) { | - | ||||||||||||||||||||||||
| 141 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||
| 142 | if (ctx ==
| 0-92 | ||||||||||||||||||||||||
| 143 | ((void *)0)
| 0-92 | ||||||||||||||||||||||||
| 144 | ) | - | ||||||||||||||||||||||||
| 145 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 146 | } executed 92 times by 1 test: end of blockExecuted by:
| 92 | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||
| 149 | used_ctx = 1; | - | ||||||||||||||||||||||||
| 150 | x = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 151 | y = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 152 | yxi = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 153 | if (yxi ==
| 0-93 | ||||||||||||||||||||||||
| 154 | ((void *)0)
| 0-93 | ||||||||||||||||||||||||
| 155 | ) | - | ||||||||||||||||||||||||
| 156 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx)
| 0-93 | ||||||||||||||||||||||||
| 159 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | buf[0] = form; | - | ||||||||||||||||||||||||
| 162 | if ((
| 1-76 | ||||||||||||||||||||||||
| 163 | if (!group->meth->field_div(group, yxi, y, x, ctx)
| 0-16 | ||||||||||||||||||||||||
| 164 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 165 | if (BN_is_odd(yxi)
| 7-9 | ||||||||||||||||||||||||
| 166 | buf[0]++; executed 7 times by 1 test: buf[0]++;Executed by:
| 7 | ||||||||||||||||||||||||
| 167 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||
| 169 | i = 1; | - | ||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||
| 171 | skip = field_len - ((BN_num_bits(x)+7)/8); | - | ||||||||||||||||||||||||
| 172 | if (skip > field_len
| 0-93 | ||||||||||||||||||||||||
| 173 | ERR_put_error(16,(161),((4|64)),__FILE__,184); | - | ||||||||||||||||||||||||
| 174 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 175 | } | - | ||||||||||||||||||||||||
| 176 | while (skip > 0
| 93-246 | ||||||||||||||||||||||||
| 177 | buf[i++] = 0; | - | ||||||||||||||||||||||||
| 178 | skip--; | - | ||||||||||||||||||||||||
| 179 | } executed 246 times by 1 test: end of blockExecuted by:
| 246 | ||||||||||||||||||||||||
| 180 | skip = BN_bn2bin(x, buf + i); | - | ||||||||||||||||||||||||
| 181 | i += skip; | - | ||||||||||||||||||||||||
| 182 | if (i != 1 + field_len
| 0-93 | ||||||||||||||||||||||||
| 183 | ERR_put_error(16,(161),((4|64)),__FILE__,194); | - | ||||||||||||||||||||||||
| 184 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 185 | } | - | ||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||
| 187 | if (form == POINT_CONVERSION_UNCOMPRESSED
| 17-76 | ||||||||||||||||||||||||
| 188 | || form == POINT_CONVERSION_HYBRID
| 1-16 | ||||||||||||||||||||||||
| 189 | skip = field_len - ((BN_num_bits(y)+7)/8); | - | ||||||||||||||||||||||||
| 190 | if (skip > field_len
| 0-77 | ||||||||||||||||||||||||
| 191 | ERR_put_error(16,(161),((4|64)),__FILE__,202); | - | ||||||||||||||||||||||||
| 192 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 193 | } | - | ||||||||||||||||||||||||
| 194 | while (skip > 0
| 77-94 | ||||||||||||||||||||||||
| 195 | buf[i++] = 0; | - | ||||||||||||||||||||||||
| 196 | skip--; | - | ||||||||||||||||||||||||
| 197 | } executed 94 times by 1 test: end of blockExecuted by:
| 94 | ||||||||||||||||||||||||
| 198 | skip = BN_bn2bin(y, buf + i); | - | ||||||||||||||||||||||||
| 199 | i += skip; | - | ||||||||||||||||||||||||
| 200 | } executed 77 times by 1 test: end of blockExecuted by:
| 77 | ||||||||||||||||||||||||
| 201 | - | |||||||||||||||||||||||||
| 202 | if (i != ret
| 0-93 | ||||||||||||||||||||||||
| 203 | ERR_put_error(16,(161),((4|64)),__FILE__,214); | - | ||||||||||||||||||||||||
| 204 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 205 | } | - | ||||||||||||||||||||||||
| 206 | } executed 93 times by 1 test: end of blockExecuted by:
| 93 | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | if (used_ctx
| 93 | ||||||||||||||||||||||||
| 209 | BN_CTX_end(ctx); executed 93 times by 1 test: BN_CTX_end(ctx);Executed by:
| 93 | ||||||||||||||||||||||||
| 210 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||
| 211 | return executed 186 times by 1 test: ret;return ret;Executed by:
executed 186 times by 1 test: return ret;Executed by:
| 186 | ||||||||||||||||||||||||
| 212 | - | |||||||||||||||||||||||||
| 213 | err: | - | ||||||||||||||||||||||||
| 214 | if (used_ctx
| 0-1 | ||||||||||||||||||||||||
| 215 | BN_CTX_end(ctx); never executed: BN_CTX_end(ctx); | 0 | ||||||||||||||||||||||||
| 216 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||
| 217 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 218 | } | - | ||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||
| 220 | - | |||||||||||||||||||||||||
| 221 | - | |||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||
| 224 | int ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point, | - | ||||||||||||||||||||||||
| 225 | const unsigned char *buf, size_t len, | - | ||||||||||||||||||||||||
| 226 | BN_CTX *ctx) | - | ||||||||||||||||||||||||
| 227 | { | - | ||||||||||||||||||||||||
| 228 | point_conversion_form_t form; | - | ||||||||||||||||||||||||
| 229 | int y_bit; | - | ||||||||||||||||||||||||
| 230 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||
| 231 | ((void *)0) | - | ||||||||||||||||||||||||
| 232 | ; | - | ||||||||||||||||||||||||
| 233 | BIGNUM *x, *y, *yxi; | - | ||||||||||||||||||||||||
| 234 | size_t field_len, enc_len; | - | ||||||||||||||||||||||||
| 235 | int ret = 0; | - | ||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | if (len == 0
| 80-9189 | ||||||||||||||||||||||||
| 238 | ERR_put_error(16,(160),(100),__FILE__,247); | - | ||||||||||||||||||||||||
| 239 | return executed 80 times by 1 test: 0;return 0;Executed by:
executed 80 times by 1 test: return 0;Executed by:
| 80 | ||||||||||||||||||||||||
| 240 | } | - | ||||||||||||||||||||||||
| 241 | form = buf[0]; | - | ||||||||||||||||||||||||
| 242 | y_bit = form & 1; | - | ||||||||||||||||||||||||
| 243 | form = form & ~1U; | - | ||||||||||||||||||||||||
| 244 | if ((
| 348-8841 | ||||||||||||||||||||||||
| 245 | && (
| 1213-1271 | ||||||||||||||||||||||||
| 246 | && (
| 572-641 | ||||||||||||||||||||||||
| 247 | ERR_put_error(16,(160),(102),__FILE__,256); | - | ||||||||||||||||||||||||
| 248 | return executed 572 times by 1 test: 0;return 0;Executed by:
executed 572 times by 1 test: return 0;Executed by:
| 572 | ||||||||||||||||||||||||
| 249 | } | - | ||||||||||||||||||||||||
| 250 | if ((form == 0
| 75-8269 | ||||||||||||||||||||||||
| 251 | ERR_put_error(16,(160),(102),__FILE__,260); | - | ||||||||||||||||||||||||
| 252 | return executed 75 times by 1 test: 0;return 0;Executed by:
executed 75 times by 1 test: return 0;Executed by:
| 75 | ||||||||||||||||||||||||
| 253 | } | - | ||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||
| 255 | if (form == 0
| 274-8268 | ||||||||||||||||||||||||
| 256 | if (len != 1
| 77-197 | ||||||||||||||||||||||||
| 257 | ERR_put_error(16,(160),(102),__FILE__,266); | - | ||||||||||||||||||||||||
| 258 | return executed 77 times by 1 test: 0;return 0;Executed by:
executed 77 times by 1 test: return 0;Executed by:
| 77 | ||||||||||||||||||||||||
| 259 | } | - | ||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | return executed 197 times by 1 test: EC_POINT_set_to_infinity(group, point);return EC_POINT_set_to_infinity(group, point);Executed by:
executed 197 times by 1 test: return EC_POINT_set_to_infinity(group, point);Executed by:
| 197 | ||||||||||||||||||||||||
| 262 | } | - | ||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | field_len = (EC_GROUP_get_degree(group) + 7) / 8; | - | ||||||||||||||||||||||||
| 265 | enc_len = | - | ||||||||||||||||||||||||
| 266 | (
| 1911-6357 | ||||||||||||||||||||||||
| 267 | POINT_CONVERSION_COMPRESSED)
| 1911-6357 | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | if (len != enc_len
| 258-8010 | ||||||||||||||||||||||||
| 270 | ERR_put_error(16,(160),(102),__FILE__,279); | - | ||||||||||||||||||||||||
| 271 | return executed 258 times by 1 test: 0;return 0;Executed by:
executed 258 times by 1 test: return 0;Executed by:
| 258 | ||||||||||||||||||||||||
| 272 | } | - | ||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||
| 274 | if (ctx ==
| 1-8009 | ||||||||||||||||||||||||
| 275 | ((void *)0)
| 1-8009 | ||||||||||||||||||||||||
| 276 | ) { | - | ||||||||||||||||||||||||
| 277 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||
| 278 | if (ctx ==
| 0-8009 | ||||||||||||||||||||||||
| 279 | ((void *)0)
| 0-8009 | ||||||||||||||||||||||||
| 280 | ) | - | ||||||||||||||||||||||||
| 281 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 282 | } executed 8009 times by 1 test: end of blockExecuted by:
| 8009 | ||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||
| 284 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||
| 285 | x = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 286 | y = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 287 | yxi = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||
| 288 | if (yxi ==
| 0-8010 | ||||||||||||||||||||||||
| 289 | ((void *)0)
| 0-8010 | ||||||||||||||||||||||||
| 290 | ) | - | ||||||||||||||||||||||||
| 291 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 | if (!BN_bin2bn(buf + 1, field_len, x)
| 0-8010 | ||||||||||||||||||||||||
| 294 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 295 | if (BN_ucmp(x, group->field) >= 0
| 92-7918 | ||||||||||||||||||||||||
| 296 | ERR_put_error(16,(160),(102),__FILE__,299); | - | ||||||||||||||||||||||||
| 297 | goto executed 92 times by 1 test: err;goto err;Executed by:
executed 92 times by 1 test: goto err;Executed by:
| 92 | ||||||||||||||||||||||||
| 298 | } | - | ||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | if (form == POINT_CONVERSION_COMPRESSED
| 1873-6045 | ||||||||||||||||||||||||
| 301 | if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx)
| 2314-3731 | ||||||||||||||||||||||||
| 302 | goto executed 2314 times by 1 test: err;goto err;Executed by:
executed 2314 times by 1 test: goto err;Executed by:
| 2314 | ||||||||||||||||||||||||
| 303 | } executed 3731 times by 1 test: else {end of blockExecuted by:
| 3731 | ||||||||||||||||||||||||
| 304 | if (!BN_bin2bn(buf + 1 + field_len, field_len, y)
| 0-1873 | ||||||||||||||||||||||||
| 305 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 306 | if (BN_ucmp(y, group->field) >= 0
| 73-1800 | ||||||||||||||||||||||||
| 307 | ERR_put_error(16,(160),(102),__FILE__,310); | - | ||||||||||||||||||||||||
| 308 | goto executed 73 times by 1 test: err;goto err;Executed by:
executed 73 times by 1 test: goto err;Executed by:
| 73 | ||||||||||||||||||||||||
| 309 | } | - | ||||||||||||||||||||||||
| 310 | if (form == POINT_CONVERSION_HYBRID
| 566-1234 | ||||||||||||||||||||||||
| 311 | if (!group->meth->field_div(group, yxi, y, x, ctx)
| 77-489 | ||||||||||||||||||||||||
| 312 | goto executed 77 times by 1 test: err;goto err;Executed by:
executed 77 times by 1 test: goto err;Executed by:
| 77 | ||||||||||||||||||||||||
| 313 | if (y_bit != BN_is_odd(yxi)
| 98-391 | ||||||||||||||||||||||||
| 314 | ERR_put_error(16,(160),(102),__FILE__,317); | - | ||||||||||||||||||||||||
| 315 | goto executed 98 times by 1 test: err;goto err;Executed by:
executed 98 times by 1 test: goto err;Executed by:
| 98 | ||||||||||||||||||||||||
| 316 | } | - | ||||||||||||||||||||||||
| 317 | } executed 391 times by 1 test: end of blockExecuted by:
| 391 | ||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx)
| 516-1109 | ||||||||||||||||||||||||
| 324 | goto executed 516 times by 1 test: err;goto err;Executed by:
executed 516 times by 1 test: goto err;Executed by:
| 516 | ||||||||||||||||||||||||
| 325 | } executed 1109 times by 1 test: end of blockExecuted by:
| 1109 | ||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | ret = 1; | - | ||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||
| 329 | err: code before this statement executed 4840 times by 1 test: err:Executed by:
| 4840 | ||||||||||||||||||||||||
| 330 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||
| 331 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||
| 332 | return executed 8010 times by 1 test: ret;return ret;Executed by:
executed 8010 times by 1 test: return ret;Executed by:
| 8010 | ||||||||||||||||||||||||
| 333 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |