| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/ec/ec2_smpl.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||
| 6 | const EC_METHOD * | - | ||||||||||||||||||||||||||||||||||||
| 7 | EC_GF2m_simple_method(void) | - | ||||||||||||||||||||||||||||||||||||
| 8 | { | - | ||||||||||||||||||||||||||||||||||||
| 9 | static const EC_METHOD ret = { | - | ||||||||||||||||||||||||||||||||||||
| 10 | .flags = 0x1, | - | ||||||||||||||||||||||||||||||||||||
| 11 | .field_type = 407, | - | ||||||||||||||||||||||||||||||||||||
| 12 | .group_init = ec_GF2m_simple_group_init, | - | ||||||||||||||||||||||||||||||||||||
| 13 | .group_finish = ec_GF2m_simple_group_finish, | - | ||||||||||||||||||||||||||||||||||||
| 14 | .group_clear_finish = ec_GF2m_simple_group_clear_finish, | - | ||||||||||||||||||||||||||||||||||||
| 15 | .group_copy = ec_GF2m_simple_group_copy, | - | ||||||||||||||||||||||||||||||||||||
| 16 | .group_set_curve = ec_GF2m_simple_group_set_curve, | - | ||||||||||||||||||||||||||||||||||||
| 17 | .group_get_curve = ec_GF2m_simple_group_get_curve, | - | ||||||||||||||||||||||||||||||||||||
| 18 | .group_get_degree = ec_GF2m_simple_group_get_degree, | - | ||||||||||||||||||||||||||||||||||||
| 19 | .group_check_discriminant = | - | ||||||||||||||||||||||||||||||||||||
| 20 | ec_GF2m_simple_group_check_discriminant, | - | ||||||||||||||||||||||||||||||||||||
| 21 | .point_init = ec_GF2m_simple_point_init, | - | ||||||||||||||||||||||||||||||||||||
| 22 | .point_finish = ec_GF2m_simple_point_finish, | - | ||||||||||||||||||||||||||||||||||||
| 23 | .point_clear_finish = ec_GF2m_simple_point_clear_finish, | - | ||||||||||||||||||||||||||||||||||||
| 24 | .point_copy = ec_GF2m_simple_point_copy, | - | ||||||||||||||||||||||||||||||||||||
| 25 | .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity, | - | ||||||||||||||||||||||||||||||||||||
| 26 | .point_set_affine_coordinates = | - | ||||||||||||||||||||||||||||||||||||
| 27 | ec_GF2m_simple_point_set_affine_coordinates, | - | ||||||||||||||||||||||||||||||||||||
| 28 | .point_get_affine_coordinates = | - | ||||||||||||||||||||||||||||||||||||
| 29 | ec_GF2m_simple_point_get_affine_coordinates, | - | ||||||||||||||||||||||||||||||||||||
| 30 | .add = ec_GF2m_simple_add, | - | ||||||||||||||||||||||||||||||||||||
| 31 | .dbl = ec_GF2m_simple_dbl, | - | ||||||||||||||||||||||||||||||||||||
| 32 | .invert = ec_GF2m_simple_invert, | - | ||||||||||||||||||||||||||||||||||||
| 33 | .is_at_infinity = ec_GF2m_simple_is_at_infinity, | - | ||||||||||||||||||||||||||||||||||||
| 34 | .is_on_curve = ec_GF2m_simple_is_on_curve, | - | ||||||||||||||||||||||||||||||||||||
| 35 | .point_cmp = ec_GF2m_simple_cmp, | - | ||||||||||||||||||||||||||||||||||||
| 36 | .make_affine = ec_GF2m_simple_make_affine, | - | ||||||||||||||||||||||||||||||||||||
| 37 | .points_make_affine = ec_GF2m_simple_points_make_affine, | - | ||||||||||||||||||||||||||||||||||||
| 38 | .mul_generator_ct = ec_GFp_simple_mul_generator_ct, | - | ||||||||||||||||||||||||||||||||||||
| 39 | .mul_single_ct = ec_GFp_simple_mul_single_ct, | - | ||||||||||||||||||||||||||||||||||||
| 40 | .mul_double_nonct = ec_GFp_simple_mul_double_nonct, | - | ||||||||||||||||||||||||||||||||||||
| 41 | .precompute_mult = ec_GF2m_precompute_mult, | - | ||||||||||||||||||||||||||||||||||||
| 42 | .have_precompute_mult = ec_GF2m_have_precompute_mult, | - | ||||||||||||||||||||||||||||||||||||
| 43 | .field_mul = ec_GF2m_simple_field_mul, | - | ||||||||||||||||||||||||||||||||||||
| 44 | .field_sqr = ec_GF2m_simple_field_sqr, | - | ||||||||||||||||||||||||||||||||||||
| 45 | .field_div = ec_GF2m_simple_field_div, | - | ||||||||||||||||||||||||||||||||||||
| 46 | }; | - | ||||||||||||||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||||||||||||||
| 48 | return executed 138 times by 3 tests: &ret;return &ret;Executed by:
executed 138 times by 3 tests: return &ret;Executed by:
| 138 | ||||||||||||||||||||||||||||||||||||
| 49 | } | - | ||||||||||||||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||||||||||||||
| 55 | int | - | ||||||||||||||||||||||||||||||||||||
| 56 | ec_GF2m_simple_group_init(EC_GROUP * group) | - | ||||||||||||||||||||||||||||||||||||
| 57 | { | - | ||||||||||||||||||||||||||||||||||||
| 58 | BN_init(&group->field); | - | ||||||||||||||||||||||||||||||||||||
| 59 | BN_init(&group->a); | - | ||||||||||||||||||||||||||||||||||||
| 60 | BN_init(&group->b); | - | ||||||||||||||||||||||||||||||||||||
| 61 | return executed 224 times by 3 tests: 1;return 1;Executed by:
executed 224 times by 3 tests: return 1;Executed by:
| 224 | ||||||||||||||||||||||||||||||||||||
| 62 | } | - | ||||||||||||||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||||||||||||||
| 68 | void | - | ||||||||||||||||||||||||||||||||||||
| 69 | ec_GF2m_simple_group_finish(EC_GROUP * group) | - | ||||||||||||||||||||||||||||||||||||
| 70 | { | - | ||||||||||||||||||||||||||||||||||||
| 71 | BN_free(&group->field); | - | ||||||||||||||||||||||||||||||||||||
| 72 | BN_free(&group->a); | - | ||||||||||||||||||||||||||||||||||||
| 73 | BN_free(&group->b); | - | ||||||||||||||||||||||||||||||||||||
| 74 | } executed 224 times by 3 tests: end of blockExecuted by:
| 224 | ||||||||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||||||||||||||
| 80 | void | - | ||||||||||||||||||||||||||||||||||||
| 81 | ec_GF2m_simple_group_clear_finish(EC_GROUP * group) | - | ||||||||||||||||||||||||||||||||||||
| 82 | { | - | ||||||||||||||||||||||||||||||||||||
| 83 | BN_clear_free(&group->field); | - | ||||||||||||||||||||||||||||||||||||
| 84 | BN_clear_free(&group->a); | - | ||||||||||||||||||||||||||||||||||||
| 85 | BN_clear_free(&group->b); | - | ||||||||||||||||||||||||||||||||||||
| 86 | group->poly[0] = 0; | - | ||||||||||||||||||||||||||||||||||||
| 87 | group->poly[1] = 0; | - | ||||||||||||||||||||||||||||||||||||
| 88 | group->poly[2] = 0; | - | ||||||||||||||||||||||||||||||||||||
| 89 | group->poly[3] = 0; | - | ||||||||||||||||||||||||||||||||||||
| 90 | group->poly[4] = 0; | - | ||||||||||||||||||||||||||||||||||||
| 91 | group->poly[5] = -1; | - | ||||||||||||||||||||||||||||||||||||
| 92 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||||||||||||||
| 98 | int | - | ||||||||||||||||||||||||||||||||||||
| 99 | ec_GF2m_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src) | - | ||||||||||||||||||||||||||||||||||||
| 100 | { | - | ||||||||||||||||||||||||||||||||||||
| 101 | int i; | - | ||||||||||||||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||||||||||||||
| 103 | if (!BN_copy(&dest->field, &src->field)
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 104 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 105 | if (!BN_copy(&dest->a, &src->a)
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 106 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 107 | if (!BN_copy(&dest->b, &src->b)
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 108 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 109 | dest->poly[0] = src->poly[0]; | - | ||||||||||||||||||||||||||||||||||||
| 110 | dest->poly[1] = src->poly[1]; | - | ||||||||||||||||||||||||||||||||||||
| 111 | dest->poly[2] = src->poly[2]; | - | ||||||||||||||||||||||||||||||||||||
| 112 | dest->poly[3] = src->poly[3]; | - | ||||||||||||||||||||||||||||||||||||
| 113 | dest->poly[4] = src->poly[4]; | - | ||||||||||||||||||||||||||||||||||||
| 114 | dest->poly[5] = src->poly[5]; | - | ||||||||||||||||||||||||||||||||||||
| 115 | if (((((
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 116 | ((void *)0)
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 117 | ) | - | ||||||||||||||||||||||||||||||||||||
| 118 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 119 | if (((((
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 120 | ((void *)0)
| 0-86 | ||||||||||||||||||||||||||||||||||||
| 121 | ) | - | ||||||||||||||||||||||||||||||||||||
| 122 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 123 | for (i = dest->a.top; i < dest->a.dmax
| 86-190 | ||||||||||||||||||||||||||||||||||||
| 124 | dest->a.d[i] = 0; executed 190 times by 2 tests: dest->a.d[i] = 0;Executed by:
| 190 | ||||||||||||||||||||||||||||||||||||
| 125 | for (i = dest->b.top; i < dest->b.dmax
| 86-92 | ||||||||||||||||||||||||||||||||||||
| 126 | dest->b.d[i] = 0; executed 92 times by 2 tests: dest->b.d[i] = 0;Executed by:
| 92 | ||||||||||||||||||||||||||||||||||||
| 127 | return executed 86 times by 2 tests: 1;return 1;Executed by:
executed 86 times by 2 tests: return 1;Executed by:
| 86 | ||||||||||||||||||||||||||||||||||||
| 128 | } | - | ||||||||||||||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||||||||
| 132 | int | - | ||||||||||||||||||||||||||||||||||||
| 133 | ec_GF2m_simple_group_set_curve(EC_GROUP * group, | - | ||||||||||||||||||||||||||||||||||||
| 134 | const BIGNUM * p, const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx) | - | ||||||||||||||||||||||||||||||||||||
| 135 | { | - | ||||||||||||||||||||||||||||||||||||
| 136 | int ret = 0, i; | - | ||||||||||||||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||||||||||||||
| 139 | if (!BN_copy(&group->field, p)
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 140 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 141 | i = BN_GF2m_poly2arr(&group->field, group->poly, 6) - 1; | - | ||||||||||||||||||||||||||||||||||||
| 142 | if ((
| 0-75 | ||||||||||||||||||||||||||||||||||||
| 143 | ERR_put_error(16,(0xfff),(131),__FILE__,211); | - | ||||||||||||||||||||||||||||||||||||
| 144 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 145 | } | - | ||||||||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||||||||
| 147 | if (!BN_GF2m_mod_arr(&group->a, a, group->poly)
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 148 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 149 | if (((((
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 150 | ((void *)0)
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 151 | ) | - | ||||||||||||||||||||||||||||||||||||
| 152 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 153 | for (i = group->a.top; i < group->a.dmax
| 148-365 | ||||||||||||||||||||||||||||||||||||
| 154 | group->a.d[i] = 0; executed 365 times by 3 tests: group->a.d[i] = 0;Executed by:
| 365 | ||||||||||||||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||||||||||||||
| 157 | if (!BN_GF2m_mod_arr(&group->b, b, group->poly)
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 158 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 159 | if (((((
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 160 | ((void *)0)
| 0-148 | ||||||||||||||||||||||||||||||||||||
| 161 | ) | - | ||||||||||||||||||||||||||||||||||||
| 162 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 163 | for (i = group->b.top; i < group->b.dmax
| 148-176 | ||||||||||||||||||||||||||||||||||||
| 164 | group->b.d[i] = 0; executed 176 times by 3 tests: group->b.d[i] = 0;Executed by:
| 176 | ||||||||||||||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||||||||||||||
| 166 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 167 | err: code before this statement executed 148 times by 3 tests: err:Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 168 | return executed 148 times by 3 tests: ret;return ret;Executed by:
executed 148 times by 3 tests: return ret;Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 169 | } | - | ||||||||||||||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||||||||
| 175 | int | - | ||||||||||||||||||||||||||||||||||||
| 176 | ec_GF2m_simple_group_get_curve(const EC_GROUP *group, | - | ||||||||||||||||||||||||||||||||||||
| 177 | BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 178 | { | - | ||||||||||||||||||||||||||||||||||||
| 179 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||||||||||||||
| 181 | if (p !=
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 182 | ((void *)0)
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 183 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 184 | if (!BN_copy(p, &group->field)
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 185 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 186 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 187 | if (a !=
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 188 | ((void *)0)
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 189 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 190 | if (!BN_copy(a, &group->a)
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 191 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 192 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 193 | if (b !=
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 194 | ((void *)0)
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 195 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 196 | if (!BN_copy(b, &group->b)
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 197 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 198 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 199 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 200 | - | |||||||||||||||||||||||||||||||||||||
| 201 | err: code before this statement executed 1 time by 1 test: err:Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 202 | return executed 1 time by 1 test: ret;return ret;Executed by:
executed 1 time by 1 test: return ret;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 203 | } | - | ||||||||||||||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||||||||||||||
| 207 | int | - | ||||||||||||||||||||||||||||||||||||
| 208 | ec_GF2m_simple_group_get_degree(const EC_GROUP * group) | - | ||||||||||||||||||||||||||||||||||||
| 209 | { | - | ||||||||||||||||||||||||||||||||||||
| 210 | return executed 73 times by 3 tests: BN_num_bits(&group->field) - 1;return BN_num_bits(&group->field) - 1;Executed by:
executed 73 times by 3 tests: return BN_num_bits(&group->field) - 1;Executed by:
| 73 | ||||||||||||||||||||||||||||||||||||
| 211 | } | - | ||||||||||||||||||||||||||||||||||||
| 212 | - | |||||||||||||||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||||||||||||||
| 217 | int | - | ||||||||||||||||||||||||||||||||||||
| 218 | ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) | - | ||||||||||||||||||||||||||||||||||||
| 219 | { | - | ||||||||||||||||||||||||||||||||||||
| 220 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||
| 221 | BIGNUM *b; | - | ||||||||||||||||||||||||||||||||||||
| 222 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||||||||||||||
| 223 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 224 | ; | - | ||||||||||||||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||||||||||||||
| 226 | if (ctx ==
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 227 | ((void *)0)
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 228 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 229 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||
| 230 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 231 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 232 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 233 | ERR_put_error(16,(0xfff),((1|64)),__FILE__,285); | - | ||||||||||||||||||||||||||||||||||||
| 234 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 235 | } | - | ||||||||||||||||||||||||||||||||||||
| 236 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 237 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||
| 238 | if ((
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 239 | ((void *)0)
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 240 | ) | - | ||||||||||||||||||||||||||||||||||||
| 241 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||
| 243 | if (!BN_GF2m_mod_arr(b, &group->b, group->poly)
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 244 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||||||||||||||
| 246 | - | |||||||||||||||||||||||||||||||||||||
| 247 | - | |||||||||||||||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||||||||||||||
| 250 | if (((
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 251 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||||||||||||||
| 253 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||||||||||||||
| 255 | err: code before this statement executed 42 times by 1 test: err:Executed by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 256 | if (ctx !=
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 257 | ((void *)0)
| 0-42 | ||||||||||||||||||||||||||||||||||||
| 258 | ) | - | ||||||||||||||||||||||||||||||||||||
| 259 | BN_CTX_end(ctx); executed 42 times by 1 test: BN_CTX_end(ctx);Executed by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 260 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||||||||||||||
| 261 | return executed 42 times by 1 test: ret;return ret;Executed by:
executed 42 times by 1 test: return ret;Executed by:
| 42 | ||||||||||||||||||||||||||||||||||||
| 262 | } | - | ||||||||||||||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||||||||
| 266 | int | - | ||||||||||||||||||||||||||||||||||||
| 267 | ec_GF2m_simple_point_init(EC_POINT * point) | - | ||||||||||||||||||||||||||||||||||||
| 268 | { | - | ||||||||||||||||||||||||||||||||||||
| 269 | BN_init(&point->X); | - | ||||||||||||||||||||||||||||||||||||
| 270 | BN_init(&point->Y); | - | ||||||||||||||||||||||||||||||||||||
| 271 | BN_init(&point->Z); | - | ||||||||||||||||||||||||||||||||||||
| 272 | return executed 6253 times by 3 tests: 1;return 1;Executed by:
executed 6253 times by 3 tests: return 1;Executed by:
| 6253 | ||||||||||||||||||||||||||||||||||||
| 273 | } | - | ||||||||||||||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||||||||||||||
| 277 | void | - | ||||||||||||||||||||||||||||||||||||
| 278 | ec_GF2m_simple_point_finish(EC_POINT * point) | - | ||||||||||||||||||||||||||||||||||||
| 279 | { | - | ||||||||||||||||||||||||||||||||||||
| 280 | BN_free(&point->X); | - | ||||||||||||||||||||||||||||||||||||
| 281 | BN_free(&point->Y); | - | ||||||||||||||||||||||||||||||||||||
| 282 | BN_free(&point->Z); | - | ||||||||||||||||||||||||||||||||||||
| 283 | } executed 4621 times by 3 tests: end of blockExecuted by:
| 4621 | ||||||||||||||||||||||||||||||||||||
| 284 | - | |||||||||||||||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||||||||||||||
| 287 | void | - | ||||||||||||||||||||||||||||||||||||
| 288 | ec_GF2m_simple_point_clear_finish(EC_POINT * point) | - | ||||||||||||||||||||||||||||||||||||
| 289 | { | - | ||||||||||||||||||||||||||||||||||||
| 290 | BN_clear_free(&point->X); | - | ||||||||||||||||||||||||||||||||||||
| 291 | BN_clear_free(&point->Y); | - | ||||||||||||||||||||||||||||||||||||
| 292 | BN_clear_free(&point->Z); | - | ||||||||||||||||||||||||||||||||||||
| 293 | point->Z_is_one = 0; | - | ||||||||||||||||||||||||||||||||||||
| 294 | } executed 1632 times by 1 test: end of blockExecuted by:
| 1632 | ||||||||||||||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||||||||||||||
| 298 | int | - | ||||||||||||||||||||||||||||||||||||
| 299 | ec_GF2m_simple_point_copy(EC_POINT * dest, const EC_POINT * src) | - | ||||||||||||||||||||||||||||||||||||
| 300 | { | - | ||||||||||||||||||||||||||||||||||||
| 301 | if (!BN_copy(&dest->X, &src->X)
| 0-1784 | ||||||||||||||||||||||||||||||||||||
| 302 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 303 | if (!BN_copy(&dest->Y, &src->Y)
| 0-1784 | ||||||||||||||||||||||||||||||||||||
| 304 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 305 | if (!BN_copy(&dest->Z, &src->Z)
| 0-1784 | ||||||||||||||||||||||||||||||||||||
| 306 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 307 | dest->Z_is_one = src->Z_is_one; | - | ||||||||||||||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||||||||||||||
| 309 | return executed 1784 times by 3 tests: 1;return 1;Executed by:
executed 1784 times by 3 tests: return 1;Executed by:
| 1784 | ||||||||||||||||||||||||||||||||||||
| 310 | } | - | ||||||||||||||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||||||||||||||
| 316 | int | - | ||||||||||||||||||||||||||||||||||||
| 317 | ec_GF2m_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point) | - | ||||||||||||||||||||||||||||||||||||
| 318 | { | - | ||||||||||||||||||||||||||||||||||||
| 319 | point->Z_is_one = 0; | - | ||||||||||||||||||||||||||||||||||||
| 320 | (BN_set_word((&point->Z),0)); | - | ||||||||||||||||||||||||||||||||||||
| 321 | return executed 101 times by 2 tests: 1;return 1;Executed by:
executed 101 times by 2 tests: return 1;Executed by:
| 101 | ||||||||||||||||||||||||||||||||||||
| 322 | } | - | ||||||||||||||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||||||||||||||
| 328 | int | - | ||||||||||||||||||||||||||||||||||||
| 329 | ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point, | - | ||||||||||||||||||||||||||||||||||||
| 330 | const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx) | - | ||||||||||||||||||||||||||||||||||||
| 331 | { | - | ||||||||||||||||||||||||||||||||||||
| 332 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||
| 333 | if (x ==
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 334 | ((void *)0)
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 335 | || y ==
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 336 | ((void *)0)
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 337 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 338 | ERR_put_error(16,(0xfff),((3|64)),__FILE__,382); | - | ||||||||||||||||||||||||||||||||||||
| 339 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 340 | } | - | ||||||||||||||||||||||||||||||||||||
| 341 | if (!BN_copy(&point->X, x)
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 342 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 343 | BN_set_negative(&point->X, 0); | - | ||||||||||||||||||||||||||||||||||||
| 344 | if (!BN_copy(&point->Y, y)
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 345 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 346 | BN_set_negative(&point->Y, 0); | - | ||||||||||||||||||||||||||||||||||||
| 347 | if (!BN_copy(&point->Z, BN_value_one())
| 0-215026 | ||||||||||||||||||||||||||||||||||||
| 348 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 349 | BN_set_negative(&point->Z, 0); | - | ||||||||||||||||||||||||||||||||||||
| 350 | point->Z_is_one = 1; | - | ||||||||||||||||||||||||||||||||||||
| 351 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||||||||
| 353 | err: code before this statement executed 215026 times by 3 tests: err:Executed by:
| 215026 | ||||||||||||||||||||||||||||||||||||
| 354 | return executed 215026 times by 3 tests: ret;return ret;Executed by:
executed 215026 times by 3 tests: return ret;Executed by:
| 215026 | ||||||||||||||||||||||||||||||||||||
| 355 | } | - | ||||||||||||||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||||||||
| 359 | - | |||||||||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||||||||
| 361 | int | - | ||||||||||||||||||||||||||||||||||||
| 362 | ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, | - | ||||||||||||||||||||||||||||||||||||
| 363 | const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 364 | { | - | ||||||||||||||||||||||||||||||||||||
| 365 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||
| 366 | - | |||||||||||||||||||||||||||||||||||||
| 367 | if (EC_POINT_is_at_infinity(group, point) > 0
| 0-251 | ||||||||||||||||||||||||||||||||||||
| 368 | ERR_put_error(16,(0xfff),(106),__FILE__,412); | - | ||||||||||||||||||||||||||||||||||||
| 369 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 370 | } | - | ||||||||||||||||||||||||||||||||||||
| 371 | if (BN_cmp(&point->Z, BN_value_one())
| 0-251 | ||||||||||||||||||||||||||||||||||||
| 372 | ERR_put_error(16,(0xfff),((2|64)),__FILE__,416); | - | ||||||||||||||||||||||||||||||||||||
| 373 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 374 | } | - | ||||||||||||||||||||||||||||||||||||
| 375 | if (x !=
| 0-251 | ||||||||||||||||||||||||||||||||||||
| 376 | ((void *)0)
| 0-251 | ||||||||||||||||||||||||||||||||||||
| 377 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 378 | if (!BN_copy(x, &point->X)
| 0-251 | ||||||||||||||||||||||||||||||||||||
| 379 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 380 | BN_set_negative(x, 0); | - | ||||||||||||||||||||||||||||||||||||
| 381 | } executed 251 times by 3 tests: end of blockExecuted by:
| 251 | ||||||||||||||||||||||||||||||||||||
| 382 | if (y !=
| 48-203 | ||||||||||||||||||||||||||||||||||||
| 383 | ((void *)0)
| 48-203 | ||||||||||||||||||||||||||||||||||||
| 384 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 385 | if (!BN_copy(y, &point->Y)
| 0-48 | ||||||||||||||||||||||||||||||||||||
| 386 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 387 | BN_set_negative(y, 0); | - | ||||||||||||||||||||||||||||||||||||
| 388 | } executed 48 times by 2 tests: end of blockExecuted by:
| 48 | ||||||||||||||||||||||||||||||||||||
| 389 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||||||||||||||
| 391 | err: code before this statement executed 251 times by 3 tests: err:Executed by:
| 251 | ||||||||||||||||||||||||||||||||||||
| 392 | return executed 251 times by 3 tests: ret;return ret;Executed by:
executed 251 times by 3 tests: return ret;Executed by:
| 251 | ||||||||||||||||||||||||||||||||||||
| 393 | } | - | ||||||||||||||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||||||||||||||
| 395 | - | |||||||||||||||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||||||||||||||
| 397 | - | |||||||||||||||||||||||||||||||||||||
| 398 | int | - | ||||||||||||||||||||||||||||||||||||
| 399 | ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, | - | ||||||||||||||||||||||||||||||||||||
| 400 | const EC_POINT *b, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 401 | { | - | ||||||||||||||||||||||||||||||||||||
| 402 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||||||||||||||
| 403 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 404 | ; | - | ||||||||||||||||||||||||||||||||||||
| 405 | BIGNUM *x0, *y0, *x1, *y1, *x2, *y2, *s, *t; | - | ||||||||||||||||||||||||||||||||||||
| 406 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||||||||||||||
| 408 | if (EC_POINT_is_at_infinity(group, a) > 0
| 19976-214976 | ||||||||||||||||||||||||||||||||||||
| 409 | if (!EC_POINT_copy(r, b)
| 0-19976 | ||||||||||||||||||||||||||||||||||||
| 410 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 411 | return executed 19976 times by 1 test: 1;return 1;Executed by:
executed 19976 times by 1 test: return 1;Executed by:
| 19976 | ||||||||||||||||||||||||||||||||||||
| 412 | } | - | ||||||||||||||||||||||||||||||||||||
| 413 | if (EC_POINT_is_at_infinity(group, b) > 0
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 414 | if (!EC_POINT_copy(r, a)
| 0 | ||||||||||||||||||||||||||||||||||||
| 415 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 416 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||
| 417 | } | - | ||||||||||||||||||||||||||||||||||||
| 418 | if (ctx ==
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 419 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 420 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 421 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||
| 422 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 423 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 424 | ) | - | ||||||||||||||||||||||||||||||||||||
| 425 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 426 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 427 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||
| 428 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 429 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 430 | ) | - | ||||||||||||||||||||||||||||||||||||
| 431 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 432 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 433 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 434 | ) | - | ||||||||||||||||||||||||||||||||||||
| 435 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 436 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 437 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 438 | ) | - | ||||||||||||||||||||||||||||||||||||
| 439 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 440 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 441 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 442 | ) | - | ||||||||||||||||||||||||||||||||||||
| 443 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 444 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 445 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 446 | ) | - | ||||||||||||||||||||||||||||||||||||
| 447 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 448 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 449 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 450 | ) | - | ||||||||||||||||||||||||||||||||||||
| 451 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 452 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 453 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 454 | ) | - | ||||||||||||||||||||||||||||||||||||
| 455 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 456 | if ((
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 457 | ((void *)0)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 458 | ) | - | ||||||||||||||||||||||||||||||||||||
| 459 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 460 | - | |||||||||||||||||||||||||||||||||||||
| 461 | if (a->Z_is_one
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 462 | if (!BN_copy(x0, &a->X)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 463 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 464 | if (!BN_copy(y0, &a->Y)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 465 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 466 | } executed 214976 times by 3 tests: else {end of blockExecuted by:
| 214976 | ||||||||||||||||||||||||||||||||||||
| 467 | if (!EC_POINT_get_affine_coordinates_GF2m(group, a, x0, y0, ctx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 468 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 469 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 470 | if (b->Z_is_one
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 471 | if (!BN_copy(x1, &b->X)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 472 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 473 | if (!BN_copy(y1, &b->Y)
| 0-214976 | ||||||||||||||||||||||||||||||||||||
| 474 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 475 | } executed 214976 times by 3 tests: else {end of blockExecuted by:
| 214976 | ||||||||||||||||||||||||||||||||||||
| 476 | if (!EC_POINT_get_affine_coordinates_GF2m(group, b, x1, y1, ctx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 477 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 478 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||||||||||||||
| 481 | if (BN_ucmp((x0), (x1))
| 94219-120757 | ||||||||||||||||||||||||||||||||||||
| 482 | if (!BN_GF2m_add(t, x0, x1)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 483 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 484 | if (!BN_GF2m_add(s, y0, y1)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 485 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 486 | if (!group->meth->field_div(group, s, s, t, ctx)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 487 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 488 | if (!group->meth->field_sqr(group, x2, s, ctx)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 489 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 490 | if (!BN_GF2m_add(x2, x2, &group->a)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 491 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 492 | if (!BN_GF2m_add(x2, x2, s)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 493 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 494 | if (!BN_GF2m_add(x2, x2, t)
| 0-94219 | ||||||||||||||||||||||||||||||||||||
| 495 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 496 | } executed 94219 times by 3 tests: else {end of blockExecuted by:
| 94219 | ||||||||||||||||||||||||||||||||||||
| 497 | if (BN_ucmp((y0), (y1))
| 2-120660 | ||||||||||||||||||||||||||||||||||||
| 498 | if (!EC_POINT_set_to_infinity(group, r)
| 0-99 | ||||||||||||||||||||||||||||||||||||
| 499 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 500 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 501 | goto executed 99 times by 2 tests: err;goto err;Executed by:
executed 99 times by 2 tests: goto err;Executed by:
| 99 | ||||||||||||||||||||||||||||||||||||
| 502 | } | - | ||||||||||||||||||||||||||||||||||||
| 503 | if (!group->meth->field_div(group, s, y1, x1, ctx)
| 0-120658 | ||||||||||||||||||||||||||||||||||||
| 504 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 505 | if (!BN_GF2m_add(s, s, x1)
| 0-120658 | ||||||||||||||||||||||||||||||||||||
| 506 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||||||||||||||
| 508 | if (!group->meth->field_sqr(group, x2, s, ctx)
| 0-120658 | ||||||||||||||||||||||||||||||||||||
| 509 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 510 | if (!BN_GF2m_add(x2, x2, s)
| 0-120658 | ||||||||||||||||||||||||||||||||||||
| 511 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 512 | if (!BN_GF2m_add(x2, x2, &group->a)
| 0-120658 | ||||||||||||||||||||||||||||||||||||
| 513 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 514 | } executed 120658 times by 3 tests: end of blockExecuted by:
| 120658 | ||||||||||||||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||||||||||||||
| 516 | if (!BN_GF2m_add(y2, x1, x2)
| 0-214877 | ||||||||||||||||||||||||||||||||||||
| 517 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 518 | if (!group->meth->field_mul(group, y2, y2, s, ctx)
| 0-214877 | ||||||||||||||||||||||||||||||||||||
| 519 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 520 | if (!BN_GF2m_add(y2, y2, x2)
| 0-214877 | ||||||||||||||||||||||||||||||||||||
| 521 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 522 | if (!BN_GF2m_add(y2, y2, y1)
| 0-214877 | ||||||||||||||||||||||||||||||||||||
| 523 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 524 | - | |||||||||||||||||||||||||||||||||||||
| 525 | if (!EC_POINT_set_affine_coordinates_GF2m(group, r, x2, y2, ctx)
| 0-214877 | ||||||||||||||||||||||||||||||||||||
| 526 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||||||||||||||
| 528 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 529 | - | |||||||||||||||||||||||||||||||||||||
| 530 | err: code before this statement executed 214877 times by 3 tests: err:Executed by:
| 214877 | ||||||||||||||||||||||||||||||||||||
| 531 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||
| 532 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||||||||||||||
| 533 | return executed 214976 times by 3 tests: ret;return ret;Executed by:
executed 214976 times by 3 tests: return ret;Executed by:
| 214976 | ||||||||||||||||||||||||||||||||||||
| 534 | } | - | ||||||||||||||||||||||||||||||||||||
| 535 | - | |||||||||||||||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||||||||||||||
| 540 | int | - | ||||||||||||||||||||||||||||||||||||
| 541 | ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, | - | ||||||||||||||||||||||||||||||||||||
| 542 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 543 | { | - | ||||||||||||||||||||||||||||||||||||
| 544 | return executed 130661 times by 3 tests: ec_GF2m_simple_add(group, r, a, a, ctx);return ec_GF2m_simple_add(group, r, a, a, ctx);Executed by:
executed 130661 times by 3 tests: return ec_GF2m_simple_add(group, r, a, a, ctx);Executed by:
| 130661 | ||||||||||||||||||||||||||||||||||||
| 545 | } | - | ||||||||||||||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||||||||||||||
| 547 | int | - | ||||||||||||||||||||||||||||||||||||
| 548 | ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 549 | { | - | ||||||||||||||||||||||||||||||||||||
| 550 | if (EC_POINT_is_at_infinity(group, point) > 0
| 0-8044 | ||||||||||||||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||||||||||||||
| 552 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||||||||||||||
| 554 | if (!EC_POINT_make_affine(group, point, ctx)
| 0-8044 | ||||||||||||||||||||||||||||||||||||
| 555 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 556 | return executed 8044 times by 2 tests: BN_GF2m_add(&point->Y, &point->X, &point->Y);return BN_GF2m_add(&point->Y, &point->X, &point->Y);Executed by:
executed 8044 times by 2 tests: return BN_GF2m_add(&point->Y, &point->X, &point->Y);Executed by:
| 8044 | ||||||||||||||||||||||||||||||||||||
| 557 | } | - | ||||||||||||||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||||||||||||||
| 560 | - | |||||||||||||||||||||||||||||||||||||
| 561 | int | - | ||||||||||||||||||||||||||||||||||||
| 562 | ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) | - | ||||||||||||||||||||||||||||||||||||
| 563 | { | - | ||||||||||||||||||||||||||||||||||||
| 564 | return executed 458616 times by 3 tests: ((&point->Z)->top == 0);return ((&point->Z)->top == 0);Executed by:
executed 458616 times by 3 tests: return ((&point->Z)->top == 0);Executed by:
| 458616 | ||||||||||||||||||||||||||||||||||||
| 565 | } | - | ||||||||||||||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||||||||||||||
| 567 | - | |||||||||||||||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||||||||
| 572 | int | - | ||||||||||||||||||||||||||||||||||||
| 573 | ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 574 | { | - | ||||||||||||||||||||||||||||||||||||
| 575 | int ret = -1; | - | ||||||||||||||||||||||||||||||||||||
| 576 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||||||||||||||
| 577 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 578 | ; | - | ||||||||||||||||||||||||||||||||||||
| 579 | BIGNUM *lh, *y2; | - | ||||||||||||||||||||||||||||||||||||
| 580 | int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); | - | ||||||||||||||||||||||||||||||||||||
| 581 | int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); | - | ||||||||||||||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||||||||||||||
| 583 | if (EC_POINT_is_at_infinity(group, point) > 0
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 584 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||||||||||||||
| 586 | field_mul = group->meth->field_mul; | - | ||||||||||||||||||||||||||||||||||||
| 587 | field_sqr = group->meth->field_sqr; | - | ||||||||||||||||||||||||||||||||||||
| 588 | - | |||||||||||||||||||||||||||||||||||||
| 589 | - | |||||||||||||||||||||||||||||||||||||
| 590 | if (!point->Z_is_one
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 591 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||||||||||||||
| 593 | if (ctx ==
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 594 | ((void *)0)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 595 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 596 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||
| 597 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 598 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 599 | ) | - | ||||||||||||||||||||||||||||||||||||
| 600 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
| 601 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 602 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||
| 603 | if ((
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 604 | ((void *)0)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 605 | ) | - | ||||||||||||||||||||||||||||||||||||
| 606 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 607 | if ((
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 608 | ((void *)0)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 609 | ) | - | ||||||||||||||||||||||||||||||||||||
| 610 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||||||||||||||
| 614 | - | |||||||||||||||||||||||||||||||||||||
| 615 | - | |||||||||||||||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||||||||||||||
| 617 | if (!BN_GF2m_add(lh, &point->X, &group->a)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 618 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 619 | if (!field_mul(group, lh, lh, &point->X, ctx)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 620 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 621 | if (!BN_GF2m_add(lh, lh, &point->Y)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 622 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 623 | if (!field_mul(group, lh, lh, &point->X, ctx)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 624 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 625 | if (!BN_GF2m_add(lh, lh, &group->b)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 626 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 627 | if (!field_sqr(group, y2, &point->Y, ctx)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 628 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 629 | if (!BN_GF2m_add(lh, lh, y2)
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 630 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 631 | ret = ((lh)->top == 0); | - | ||||||||||||||||||||||||||||||||||||
| 632 | err: code before this statement executed 109 times by 3 tests: err:Executed by:
| 109 | ||||||||||||||||||||||||||||||||||||
| 633 | if (ctx
| 0-109 | ||||||||||||||||||||||||||||||||||||
| 634 | BN_CTX_end(ctx); executed 109 times by 3 tests: BN_CTX_end(ctx);Executed by:
| 109 | ||||||||||||||||||||||||||||||||||||
| 635 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||||||||||||||
| 636 | return executed 109 times by 3 tests: ret;return ret;Executed by:
executed 109 times by 3 tests: return ret;Executed by:
| 109 | ||||||||||||||||||||||||||||||||||||
| 637 | } | - | ||||||||||||||||||||||||||||||||||||
| 638 | int | - | ||||||||||||||||||||||||||||||||||||
| 639 | ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, | - | ||||||||||||||||||||||||||||||||||||
| 640 | const EC_POINT *b, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 641 | { | - | ||||||||||||||||||||||||||||||||||||
| 642 | BIGNUM *aX, *aY, *bX, *bY; | - | ||||||||||||||||||||||||||||||||||||
| 643 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||||||||||||||
| 644 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 645 | ; | - | ||||||||||||||||||||||||||||||||||||
| 646 | int ret = -1; | - | ||||||||||||||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||||||||||||||
| 648 | if (EC_POINT_is_at_infinity(group, a) > 0
| 30-36 | ||||||||||||||||||||||||||||||||||||
| 649 | return executed 30 times by 1 test: EC_POINT_is_at_infinity(group, b) > 0return EC_POINT_is_at_infinity(group, b) > 0 ? 0 : 1;Executed by:
executed 30 times by 1 test: return EC_POINT_is_at_infinity(group, b) > 0 ? 0 : 1;Executed by:
| 0-30 | ||||||||||||||||||||||||||||||||||||
| 650 | } | - | ||||||||||||||||||||||||||||||||||||
| 651 | if (EC_POINT_is_at_infinity(group, b) > 0
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 652 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||||||||||||||
| 654 | if (a->Z_is_one
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 655 | return executed 36 times by 2 tests: ((return ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0) ? 0 : 1;Executed by:
executed 36 times by 2 tests: return ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0) ? 0 : 1;Executed by:
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 656 | } | - | ||||||||||||||||||||||||||||||||||||
| 657 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 658 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 659 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 660 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||
| 661 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 662 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 663 | ) | - | ||||||||||||||||||||||||||||||||||||
| 664 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
| 665 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 666 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||
| 667 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 668 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 669 | ) | - | ||||||||||||||||||||||||||||||||||||
| 670 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 671 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 672 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 673 | ) | - | ||||||||||||||||||||||||||||||||||||
| 674 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 675 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 676 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 677 | ) | - | ||||||||||||||||||||||||||||||||||||
| 678 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 679 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 680 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 681 | ) | - | ||||||||||||||||||||||||||||||||||||
| 682 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 683 | - | |||||||||||||||||||||||||||||||||||||
| 684 | if (!EC_POINT_get_affine_coordinates_GF2m(group, a, aX, aY, ctx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 685 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 686 | if (!EC_POINT_get_affine_coordinates_GF2m(group, b, bX, bY, ctx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 687 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 688 | ret = ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||||||||||||||
| 690 | err: code before this statement never executed: err: | 0 | ||||||||||||||||||||||||||||||||||||
| 691 | if (ctx
| 0 | ||||||||||||||||||||||||||||||||||||
| 692 | BN_CTX_end(ctx); never executed: BN_CTX_end(ctx); | 0 | ||||||||||||||||||||||||||||||||||||
| 693 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||||||||||||||
| 694 | return never executed: ret;return ret;never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||
| 695 | } | - | ||||||||||||||||||||||||||||||||||||
| 696 | - | |||||||||||||||||||||||||||||||||||||
| 697 | - | |||||||||||||||||||||||||||||||||||||
| 698 | - | |||||||||||||||||||||||||||||||||||||
| 699 | int | - | ||||||||||||||||||||||||||||||||||||
| 700 | ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx) | - | ||||||||||||||||||||||||||||||||||||
| 701 | { | - | ||||||||||||||||||||||||||||||||||||
| 702 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||||||||||||||
| 703 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 704 | ; | - | ||||||||||||||||||||||||||||||||||||
| 705 | BIGNUM *x, *y; | - | ||||||||||||||||||||||||||||||||||||
| 706 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||||||||||||||
| 708 | if (point->Z_is_one
| 0-13036 | ||||||||||||||||||||||||||||||||||||
| 709 | return executed 13036 times by 2 tests: 1;return 1;Executed by:
executed 13036 times by 2 tests: return 1;Executed by:
| 13036 | ||||||||||||||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||||||||||||||
| 711 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 712 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 713 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 714 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||
| 715 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 716 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 717 | ) | - | ||||||||||||||||||||||||||||||||||||
| 718 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 719 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 720 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||
| 721 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 722 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 723 | ) | - | ||||||||||||||||||||||||||||||||||||
| 724 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 725 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 726 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 727 | ) | - | ||||||||||||||||||||||||||||||||||||
| 728 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 729 | - | |||||||||||||||||||||||||||||||||||||
| 730 | if (!EC_POINT_get_affine_coordinates_GF2m(group, point, x, y, ctx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 731 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 732 | if (!BN_copy(&point->X, x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 733 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 734 | if (!BN_copy(&point->Y, y)
| 0 | ||||||||||||||||||||||||||||||||||||
| 735 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 736 | if (!(BN_set_word((&point->Z),1))
| 0 | ||||||||||||||||||||||||||||||||||||
| 737 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 738 | - | |||||||||||||||||||||||||||||||||||||
| 739 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||
| 740 | - | |||||||||||||||||||||||||||||||||||||
| 741 | err: code before this statement never executed: err: | 0 | ||||||||||||||||||||||||||||||||||||
| 742 | if (ctx
| 0 | ||||||||||||||||||||||||||||||||||||
| 743 | BN_CTX_end(ctx); never executed: BN_CTX_end(ctx); | 0 | ||||||||||||||||||||||||||||||||||||
| 744 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||||||||||||||
| 745 | return never executed: ret;return ret;never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||
| 746 | } | - | ||||||||||||||||||||||||||||||||||||
| 747 | - | |||||||||||||||||||||||||||||||||||||
| 748 | - | |||||||||||||||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||||||||||||||
| 750 | int | - | ||||||||||||||||||||||||||||||||||||
| 751 | ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num, | - | ||||||||||||||||||||||||||||||||||||
| 752 | EC_POINT *points[], BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 753 | { | - | ||||||||||||||||||||||||||||||||||||
| 754 | size_t i; | - | ||||||||||||||||||||||||||||||||||||
| 755 | - | |||||||||||||||||||||||||||||||||||||
| 756 | for (i = 0; i < num
| 179-4992 | ||||||||||||||||||||||||||||||||||||
| 757 | if (!group->meth->make_affine(group, points[i], ctx)
| 0-4992 | ||||||||||||||||||||||||||||||||||||
| 758 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 759 | } executed 4992 times by 2 tests: end of blockExecuted by:
| 4992 | ||||||||||||||||||||||||||||||||||||
| 760 | - | |||||||||||||||||||||||||||||||||||||
| 761 | return executed 179 times by 2 tests: 1;return 1;Executed by:
executed 179 times by 2 tests: return 1;Executed by:
| 179 | ||||||||||||||||||||||||||||||||||||
| 762 | } | - | ||||||||||||||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||||||||||||||
| 764 | - | |||||||||||||||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||||||||||||||
| 766 | int | - | ||||||||||||||||||||||||||||||||||||
| 767 | ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, | - | ||||||||||||||||||||||||||||||||||||
| 768 | const BIGNUM *b, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 769 | { | - | ||||||||||||||||||||||||||||||||||||
| 770 | return executed 215095 times by 3 tests: BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);Executed by:
executed 215095 times by 3 tests: return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);Executed by:
| 215095 | ||||||||||||||||||||||||||||||||||||
| 771 | } | - | ||||||||||||||||||||||||||||||||||||
| 772 | - | |||||||||||||||||||||||||||||||||||||
| 773 | - | |||||||||||||||||||||||||||||||||||||
| 774 | - | |||||||||||||||||||||||||||||||||||||
| 775 | int | - | ||||||||||||||||||||||||||||||||||||
| 776 | ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, | - | ||||||||||||||||||||||||||||||||||||
| 777 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 778 | { | - | ||||||||||||||||||||||||||||||||||||
| 779 | return executed 214986 times by 3 tests: BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);Executed by:
executed 214986 times by 3 tests: return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);Executed by:
| 214986 | ||||||||||||||||||||||||||||||||||||
| 780 | } | - | ||||||||||||||||||||||||||||||||||||
| 781 | - | |||||||||||||||||||||||||||||||||||||
| 782 | - | |||||||||||||||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||||||||||||||
| 784 | int | - | ||||||||||||||||||||||||||||||||||||
| 785 | ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, | - | ||||||||||||||||||||||||||||||||||||
| 786 | const BIGNUM *b, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||
| 787 | { | - | ||||||||||||||||||||||||||||||||||||
| 788 | return executed 214877 times by 3 tests: BN_GF2m_mod_div(r, a, b, &group->field, ctx);return BN_GF2m_mod_div(r, a, b, &group->field, ctx);Executed by:
executed 214877 times by 3 tests: return BN_GF2m_mod_div(r, a, b, &group->field, ctx);Executed by:
| 214877 | ||||||||||||||||||||||||||||||||||||
| 789 | } | - | ||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |