| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/ec_oct.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point, | - | ||||||||||||
| 6 | const BIGNUM *x, int y_bit, BN_CTX *ctx) | - | ||||||||||||
| 7 | { | - | ||||||||||||
| 8 | if (group->meth->point_set_compressed_coordinates ==
| 0-10571 | ||||||||||||
| 9 | ((void *)0)
| 0-10571 | ||||||||||||
| 10 | - | |||||||||||||
| 11 | && !(group->meth->flags & 0x1)
| 0-10571 | ||||||||||||
| 12 | ERR_put_error(16,(295),((2|64)),__FILE__,24) | - | ||||||||||||
| 13 | ; | - | ||||||||||||
| 14 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 15 | } | - | ||||||||||||
| 16 | if (!ec_point_is_compat(point, group)
| 0-10571 | ||||||||||||
| 17 | ERR_put_error(16,(295),(101),__FILE__,29) | - | ||||||||||||
| 18 | ; | - | ||||||||||||
| 19 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 20 | } | - | ||||||||||||
| 21 | if (group->meth->flags & 0x1
| 0-10571 | ||||||||||||
| 22 | if (group->meth->field_type == 406
| 4526-6045 | ||||||||||||
| 23 | return executed 4526 times by 1 test: ec_GFp_simple_set_compressed_coordinates(group, point, x,return ec_GFp_simple_set_compressed_coordinates(group, point, x, y_bit, ctx);Executed by:
executed 4526 times by 1 test: return ec_GFp_simple_set_compressed_coordinates(group, point, x, y_bit, ctx);Executed by:
| 4526 | ||||||||||||
| 24 | y_bit, ctx); executed 4526 times by 1 test: return ec_GFp_simple_set_compressed_coordinates(group, point, x, y_bit, ctx);Executed by:
| 4526 | ||||||||||||
| 25 | else | - | ||||||||||||
| 26 | - | |||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | - | |||||||||||||
| 32 | - | |||||||||||||
| 33 | return executed 6045 times by 1 test: ec_GF2m_simple_set_compressed_coordinates(group, point, x,return ec_GF2m_simple_set_compressed_coordinates(group, point, x, y_bit, ctx);Executed by:
executed 6045 times by 1 test: return ec_GF2m_simple_set_compressed_coordinates(group, point, x, y_bit, ctx);Executed by:
| 6045 | ||||||||||||
| 34 | y_bit, ctx); executed 6045 times by 1 test: return ec_GF2m_simple_set_compressed_coordinates(group, point, x, y_bit, ctx);Executed by:
| 6045 | ||||||||||||
| 35 | - | |||||||||||||
| 36 | } | - | ||||||||||||
| 37 | return never executed: group->meth->point_set_compressed_coordinates(group, point, x,return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx);never executed: return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx); | 0 | ||||||||||||
| 38 | y_bit, ctx); never executed: return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx); | 0 | ||||||||||||
| 39 | } | - | ||||||||||||
| 40 | - | |||||||||||||
| 41 | - | |||||||||||||
| 42 | int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, | - | ||||||||||||
| 43 | EC_POINT *point, const BIGNUM *x, | - | ||||||||||||
| 44 | int y_bit, BN_CTX *ctx) | - | ||||||||||||
| 45 | { | - | ||||||||||||
| 46 | return never executed: EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx);return EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx);never executed: return EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx); | 0 | ||||||||||||
| 47 | } | - | ||||||||||||
| 48 | - | |||||||||||||
| 49 | - | |||||||||||||
| 50 | int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, | - | ||||||||||||
| 51 | EC_POINT *point, const BIGNUM *x, | - | ||||||||||||
| 52 | int y_bit, BN_CTX *ctx) | - | ||||||||||||
| 53 | { | - | ||||||||||||
| 54 | return never executed: EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx);return EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx);never executed: return EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx); | 0 | ||||||||||||
| 55 | } | - | ||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | - | |||||||||||||
| 59 | size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, | - | ||||||||||||
| 60 | point_conversion_form_t form, unsigned char *buf, | - | ||||||||||||
| 61 | size_t len, BN_CTX *ctx) | - | ||||||||||||
| 62 | { | - | ||||||||||||
| 63 | if (group->meth->point2oct == 0
| 0-41855 | ||||||||||||
| 64 | && !(group->meth->flags & 0x1)
| 0-41855 | ||||||||||||
| 65 | ERR_put_error(16,(123),((2|64)),__FILE__,76); | - | ||||||||||||
| 66 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 67 | } | - | ||||||||||||
| 68 | if (!ec_point_is_compat(point, group)
| 0-41855 | ||||||||||||
| 69 | ERR_put_error(16,(123),(101),__FILE__,80); | - | ||||||||||||
| 70 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 71 | } | - | ||||||||||||
| 72 | if (group->meth->flags & 0x1
| 0-41855 | ||||||||||||
| 73 | if (group->meth->field_type == 406
| 201-41654 | ||||||||||||
| 74 | return executed 41654 times by 1 test: ec_GFp_simple_point2oct(group, point, form, buf, len, ctx);return ec_GFp_simple_point2oct(group, point, form, buf, len, ctx);Executed by:
executed 41654 times by 1 test: return ec_GFp_simple_point2oct(group, point, form, buf, len, ctx);Executed by:
| 41654 | ||||||||||||
| 75 | else | - | ||||||||||||
| 76 | - | |||||||||||||
| 77 | - | |||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | - | |||||||||||||
| 81 | - | |||||||||||||
| 82 | return executed 201 times by 1 test: ec_GF2m_simple_point2oct(group, point,return ec_GF2m_simple_point2oct(group, point, form, buf, len, ctx);Executed by:
executed 201 times by 1 test: return ec_GF2m_simple_point2oct(group, point, form, buf, len, ctx);Executed by:
| 201 | ||||||||||||
| 83 | form, buf, len, ctx); executed 201 times by 1 test: return ec_GF2m_simple_point2oct(group, point, form, buf, len, ctx);Executed by:
| 201 | ||||||||||||
| 84 | - | |||||||||||||
| 85 | } | - | ||||||||||||
| 86 | - | |||||||||||||
| 87 | return never executed: group->meth->point2oct(group, point, form, buf, len, ctx);return group->meth->point2oct(group, point, form, buf, len, ctx);never executed: return group->meth->point2oct(group, point, form, buf, len, ctx); | 0 | ||||||||||||
| 88 | } | - | ||||||||||||
| 89 | - | |||||||||||||
| 90 | int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, | - | ||||||||||||
| 91 | const unsigned char *buf, size_t len, BN_CTX *ctx) | - | ||||||||||||
| 92 | { | - | ||||||||||||
| 93 | if (group->meth->oct2point == 0
| 0-34424 | ||||||||||||
| 94 | && !(group->meth->flags & 0x1)
| 0-34424 | ||||||||||||
| 95 | ERR_put_error(16,(122),((2|64)),__FILE__,106); | - | ||||||||||||
| 96 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 97 | } | - | ||||||||||||
| 98 | if (!ec_point_is_compat(point, group)
| 0-34424 | ||||||||||||
| 99 | ERR_put_error(16,(122),(101),__FILE__,110); | - | ||||||||||||
| 100 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 101 | } | - | ||||||||||||
| 102 | if (group->meth->flags & 0x1
| 0-34424 | ||||||||||||
| 103 | if (group->meth->field_type == 406
| 9269-25155 | ||||||||||||
| 104 | return executed 25155 times by 1 test: ec_GFp_simple_oct2point(group, point, buf, len, ctx);return ec_GFp_simple_oct2point(group, point, buf, len, ctx);Executed by:
executed 25155 times by 1 test: return ec_GFp_simple_oct2point(group, point, buf, len, ctx);Executed by:
| 25155 | ||||||||||||
| 105 | else | - | ||||||||||||
| 106 | - | |||||||||||||
| 107 | - | |||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | - | |||||||||||||
| 111 | - | |||||||||||||
| 112 | return executed 9269 times by 1 test: ec_GF2m_simple_oct2point(group, point, buf, len, ctx);return ec_GF2m_simple_oct2point(group, point, buf, len, ctx);Executed by:
executed 9269 times by 1 test: return ec_GF2m_simple_oct2point(group, point, buf, len, ctx);Executed by:
| 9269 | ||||||||||||
| 113 | - | |||||||||||||
| 114 | } | - | ||||||||||||
| 115 | return never executed: group->meth->oct2point(group, point, buf, len, ctx);return group->meth->oct2point(group, point, buf, len, ctx);never executed: return group->meth->oct2point(group, point, buf, len, ctx); | 0 | ||||||||||||
| 116 | } | - | ||||||||||||
| 117 | - | |||||||||||||
| 118 | size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, | - | ||||||||||||
| 119 | point_conversion_form_t form, | - | ||||||||||||
| 120 | unsigned char **pbuf, BN_CTX *ctx) | - | ||||||||||||
| 121 | { | - | ||||||||||||
| 122 | size_t len; | - | ||||||||||||
| 123 | unsigned char *buf; | - | ||||||||||||
| 124 | - | |||||||||||||
| 125 | len = EC_POINT_point2oct(group, point, form, | - | ||||||||||||
| 126 | ((void *)0) | - | ||||||||||||
| 127 | , 0, | - | ||||||||||||
| 128 | ((void *)0) | - | ||||||||||||
| 129 | ); | - | ||||||||||||
| 130 | if (len == 0
| 2-1285 | ||||||||||||
| 131 | return executed 2 times by 1 test: 0;return 0;Executed by:
executed 2 times by 1 test: return 0;Executed by:
| 2 | ||||||||||||
| 132 | if ((
| 0-1285 | ||||||||||||
| 133 | ((void *)0)
| 0-1285 | ||||||||||||
| 134 | ) { | - | ||||||||||||
| 135 | ERR_put_error(16,(281),((1|64)),__FILE__,140); | - | ||||||||||||
| 136 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 137 | } | - | ||||||||||||
| 138 | len = EC_POINT_point2oct(group, point, form, buf, len, ctx); | - | ||||||||||||
| 139 | if (len == 0
| 0-1285 | ||||||||||||
| 140 | CRYPTO_free(buf, __FILE__, 145); | - | ||||||||||||
| 141 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 142 | } | - | ||||||||||||
| 143 | *pbuf = buf; | - | ||||||||||||
| 144 | return executed 1285 times by 1 test: len;return len;Executed by:
executed 1285 times by 1 test: return len;Executed by:
| 1285 | ||||||||||||
| 145 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |